1

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?
... 
>>> 
4
  • probably not the answer, but have you disabled the serial console by editing the /boot/cmdline.txt on the RPi2 ? Sep 19 '16 at 18:49
  • @ShreyasMurali ... good idea, I can try that and let you know how it went. Thank you! - Chris
    – ChrisVollo
    Sep 19 '16 at 18:55
  • @ShreyasMurali: yes, that did it! Thank you so much!
    – ChrisVollo
    Sep 19 '16 at 19:10
  • You know you can connect the serial lines of the pis together, no need for a usb to serial adaptor. Unless you are using it for something else. Sep 19 '16 at 23:48
0

Thanks to @ShreyasMurali (see comment) I edited /boot/cmdline.txt to be this:

root=/dev/mmcblk0p2 rw rootwait console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 elevator=noop

And now it works! Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.