Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts

Tuesday, March 10, 2009

Arduino serial + GPS data on single OpenWrt serial port

I want to process the GPS data on OpenWrt, and still communicate with the arduino port even though I have only one serial port on my test platform (Fonera).

I've connected both Adruino rx/tx and GPS tx pins to the serial pins of the Fonera box, but I'm using two diodes in both tx lines to isolate problems. Now I can receive NMEA data from GPS, but also sensor data from Arduino. I can also send commands to the arduino.

Illustration:

GPS tx ->diode-> rx FON rx <-diode<- tx Arduino
GPS gnd --------> gnd FON gnd <-------- gnd Arduino
FON tx --------> rx Arduino

stty settings on Fonera:
# ttyS0 38400 bps, 8 data bits, no parity, no hardware HS, no echo
./stty -F /dev/ttyS0 raw cs8 -parenb -crtscts -echo speed 38400
I also commented the /dev/ttyS0 line from /etc/inittab to disable the automatic Serial console of OpenWrt