Skip to content

Connecting Arduino to WL-520GU via Serial Port

by admin on June 24th, 2010

I successfully got my 3.3 volt arduino built on a breadboard to communicate via serial port with my ASUS WL-520gu Wireless Router.

In broad strokes I did:

  • Installed OpenWRT on my ASUS WL-520gu Wireless Router with support for stty built in (used later to change the serial ports speed to something my boarduino could reliably read)
  • Built a barebones arduino on a breadboard.  I am running mine at 3.3v to save power, which is also what the serial port on the ASUS WL-520gu Wireless Router is running at.
  • Disabled the serial terminal automatically started on the router using:
  • root@OpenWrt:~# vi /etc/inittab
    
    #tts/0::askfirst:/bin/ash --login
    #ttyS0::askfirst:/bin/ash --login
  • Ran the following shell script on the router to write any line received on the router’s serial port containing the string “START” to a temporary file:
  • stty 9600 < /dev/tts/0  # set serial port to 9600 baud
    while true
    do
    temp=$(grep -m 1 START /dev/tts/0)
    temp2=$(date +"%D-%X")
    echo $temp$temp2
    echo $temp$temp2 >> /tmp/serialdata
    echo "wrote to serialdata"
    done
  • If anyone is interested in more, please post in the comments and I’ll add more details.
  • I got the temp=$(grep -m 1 START /dev/tts/0) code from Tim’s blog
No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS