I have an RPi2 and an RPi3 and both are running ArchLinux. On the RPi2 the /dev/ttyAMA0 seems to have an issue with the TX pin where it seems to echo back whatever it sees on the RX pin. The RX pin on the RPi2 does not seem to be receiving anything, but seems to be sending it right back out the TX pin via AMA0.
AMA0 on the RP02 (TX&RX) are connected to USB0 on the RPi3 (RX&TX), respectively.
Below is a python example of the RPi2 talking to the RPi3 and vice-versa. The RPi2 should have read "3. Hello Back" but instead it was received by the RPi3 (the device which wrote it).
On the RPi2 via AMA0
Python 2.7.10 (default, May 30 2015, 02:17:57) [GCC 4.9.2 20150304 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import serial >>> serAMA=serial.Serial("/dev/ttyAMA0",9600) >>> serAMA.inWaiting() 0 >>> # 1. write a message ... >>> serAMA.write("1. Hello World") 14 >>> # 4. read the message back ... >>> serAMA.inWaiting() 0 >>> # There is a problem here!! ... >>> On the RPi3 via USB0
Python 2.7.11 (default, Mar 31 2016, 01:51:21) [GCC 5.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import serial >>> serUSB=serial.Serial("/dev/ttyUSB0",9600) >>> serUSB.inWaiting() 0 >>> # 2. try to read the message ... >>> serUSB.inWaiting() 14 >>> serUSB.read(serUSB.inWaiting()) '1. Hello World' >>> # 3 write a message back ... >>> serUSB.write("3. Hello Back!") 14 >>> # Let's check over here just to make sure ... >>> serUSB.read(serUSB.inWaiting()) '3. Hello Back!' >>> # how did I get the same message back? ... >>>
/boot/cmdline.txton the RPi2 ?