2

I have sample app that wait on signal from IR sensor that is connected to GPIO15 and 14:

ser = serial.Serial(port="/dev/ttyAMA0",baudrate=115200, timeout=1) io.add_event_detect(15,io.RISING, callback=inputLow, bouncetime=200) def inputLow(channel): print('signal test') 

And now I want to run screen: screen /dev/ttyAMA0 115200

  • 1) I can only run screen because when I run above application I get error device ttyAMA0 is busy
  • 2) when I run only gnu screen in terminal I see only black screen, when I send signal to IR sensor on the terminal nothing happens, screen is black

How can I read data from ttyAMA0?

2
  • What model Pi? Have you enabled serial? Commented Jan 9, 2018 at 9:11
  • RPi3, yes I've enabled Commented Jan 9, 2018 at 9:42

1 Answer 1

2

There is ABSOLUTELY NO REASON to use /dev/ttyAMA0 in a moderately up-to-date OS. This is connected to Bluetooth (by default) on Pi3 and PiZeroW.

In ALL models use /dev/serial0 which is the default serial port (if enabled), even if ports are swapped.

See How-do-i-make-serial-work-on-the-raspberry-pi3

3
  • my OS is Jessy, so I should use ttyS0 or /dev/serial0? Commented Jan 9, 2018 at 10:45
  • @Robert I don't know this Jessy but the earliest implementations of Raspbian supporting the Pi3 were half baked and poorly documented (which was the reason for my linked post), You can check if /dev/serial0 exists. Commented Jan 9, 2018 at 10:52
  • ok, ls -l /dev and I see: ttyS0 and ttyAMA0 and serial0->ttyS0, serial1->ttyAMA0 Commented Jan 9, 2018 at 11:05

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.