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

2 comments:

  1. Did you send information form the Arduino to the fonera using the RX of the fonera?

    I've been sending info with the Serial.print of the arduino and making a cat /dev/ttyS0 > log.txt and I don't get anything. Is the same device witch sends and recieves data form the arduino?

    Thanks a lot!

    ReplyDelete
  2. Could you tell me how you powered your GPS in this situation? I am also trying to hook up my GPS (Globalsat BR-355) to my OM1P router (same board as the Fonera 2100)

    The GPS wants 4.5V ~ 6.5V but the router only supplies 3.3V - will I need to power the GPS from a separate power supply?

    Cheers,
    robert

    ReplyDelete