Strange serial behavior? [SOLVED]


8 posts
by Zerpudo » Sun Aug 18, 2013 12:17 pm
SOLVED!

I'm sending data (chars) from an Arduino via serial to a RPI. I'm receiving the data well on RX (cat /dev/ttyAMA0 to see it) , but I don't know why, the RPI is forwarding back the received data through TX to Arduino again! I still haven't told RPI what to do with those message coming in RX GPIO, so I don't understand why is it sending back to Arduino.

Any ideas? Thank you so much in advance!
Last edited by Zerpudo on Sun Aug 18, 2013 1:28 pm, edited 2 times in total.
Posts: 11
Joined: Thu Jul 18, 2013 6:59 pm
by joan » Sun Aug 18, 2013 12:25 pm
What does

stty -F /dev/ttyAMA0

report on the Pi?
User avatar
Posts: 4124
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by Zerpudo » Sun Aug 18, 2013 12:54 pm
Thank you for the response. I did what you told me and this is what I get:


speed 9600 baud; line = 0;
-brkint -imaxbel
Posts: 11
Joined: Thu Jul 18, 2013 6:59 pm
by joan » Sun Aug 18, 2013 1:16 pm
You might need to disable echo

stty -F /dev/ttyAMA0 -echo -echoe -echok
User avatar
Posts: 4124
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by Zerpudo » Sun Aug 18, 2013 1:27 pm
Thank you SO much man, it worked perfectly!! So grateful :)

Cheers!
Posts: 11
Joined: Thu Jul 18, 2013 6:59 pm
by joan » Sun Aug 18, 2013 1:29 pm
That's fortunate because that was my only idea! :D
User avatar
Posts: 4124
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by Zerpudo » Sun Aug 18, 2013 1:42 pm
Haha, well done :)

Just one thing. It must be easy but I don't know how to do it since I'm a noob! I realized that if I reboot my RPI the configuration resets again. How could I do to make it permanent?
Posts: 11
Joined: Thu Jul 18, 2013 6:59 pm
by joan » Sun Aug 18, 2013 1:58 pm
Personally I'd add a reboot crontab entry.

sudo crontab -e

Code: Select all
@reboot              /bin/stty -F /dev/ttyAMA0 -echo -echoe -echok

There are plenty of other ways.
User avatar
Posts: 4124
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK