Software
There are three pieces of software that make this project possible. The VB6 Wifi_Robot client application (runs on Windows), the CarServer which is written in C and runs on the router running OpenWRT WhiteRussian v0.9 (Linux), and the microcontroller firmware. I've provided tested firmware for both PIC16F628A microcontroller and the popular Arduino (Freeduino MaxSerial). All software is released under the GNU GPL v2 license.
The following instructions assume you have a Linksys WRT54GL with OpenWRT WhiteRussian v0.9 installed and connected to the internet. See this guide for OpenWRT installation instructions.
Installing CarServer
If you just want to use the software
SSH in to your router then ...
# cd /tmp
# wget http://www.jbprojects.net/projects/wifirobot/carserver_1_mipsel.ipk
# ipkg install ./carserver_1_mipsel.ipk
If you just want to use the software
SSH in to your router then ...
# cd /tmp
# wget http://www.jbprojects.net/projects/wifirobot/carserver_1_mipsel.ipk
# ipkg install ./carserver_1_mipsel.ipk
Compiling and Installing CarServer
If you want to see how it works or modify it yourself
You'll need to download the OpenWRT SDK (Linux Only) and follow this guide for compiling software: Eric Bishop's Writing and Compiling A Simple Program for OpenWRT(just follow Part I)
Makefile place in /OpenWrt-SDK-Linux-i686-1/package/carserver/
Makefile place in /OpenWrt-SDK-Linux-i686-1/package/carserver/src
carserver.c place in /OpenWrt-SDK-Linux-i686-1/package/carserver/src
Your compiled ipkg will show up in /OpenWrt-SDK-Linux-i686-1/bin/packages. Then
# scp carserver_1_mipsel.ipk root@<router_ip>:/tmp/.
to copy it to the router. SSH in and install it.
If you want to see how it works or modify it yourself
You'll need to download the OpenWRT SDK (Linux Only) and follow this guide for compiling software: Eric Bishop's Writing and Compiling A Simple Program for OpenWRT(just follow Part I)
Makefile place in /OpenWrt-SDK-Linux-i686-1/package/carserver/
Makefile place in /OpenWrt-SDK-Linux-i686-1/package/carserver/src
carserver.c place in /OpenWrt-SDK-Linux-i686-1/package/carserver/src
Your compiled ipkg will show up in /OpenWrt-SDK-Linux-i686-1/bin/packages. Then
# scp carserver_1_mipsel.ipk root@<router_ip>:/tmp/.
to copy it to the router. SSH in and install it.
Great Resource
There seems to afree e-book on the WRT54G series of routers called the Linksys WRT54G Ultimate Hacking. I believe it's meant to be free. Google Books has the whole book viewable. It can also be downloaded here: (password: ____ ) This book outlines how to add a serial port, setup the software, as well as a bunch of other hacks.
There seems to a
Edit: (September 20, 2008)
I've been contacted by one of the authors. It isn't a free e-book. You can view the whole book on Google Books here or for a more convenient format and to support the authors,check it out at Amazon. It's a great book!
I've been contacted by one of the authors. It isn't a free e-book. You can view the whole book on Google Books here or for a more convenient format and to support the authors,check it out at Amazon. It's a great book!
Getting the Serial Port Working
We need to use TTS/1, so if you only add one serial port -- make sure its that one. Assuming you have OpenWRT WhiteRussian v0.9 installed, SSH in to the router. The instructions in the book linked above are a bit outdated. Here is the updated version:
We need to use TTS/1, so if you only add one serial port -- make sure its that one. Assuming you have OpenWRT WhiteRussian v0.9 installed, SSH in to the router. The instructions in the book linked above are a bit outdated. Here is the updated version:
# ipkg update
# ipkg install setserial
# ipkg install setserial
# cd /usr/sbin
# wget http://www.jbprojects.net/projects/wifirobot/stty.tgz
# tar -zxvf stty.tgz
# chmod 755 stty
# wget http://www.jbprojects.net/projects/wifirobot/stty.tgz
# tar -zxvf stty.tgz
# chmod 755 stty
Add the following lines to /etc/init.d/custom-user-startup to make the serial port work on start-up and have the CarServer automatically start.
/usr/sbin/setserial /dev/tts/1 irq 3
/usr/sbin/stty -F /dev/tts/1 raw speed 9600
/bin/carserver &
/usr/sbin/setserial /dev/tts/1 irq 3
/usr/sbin/stty -F /dev/tts/1 raw speed 9600
/bin/carserver &
Running Wifi_Robot Client App:

wifi_robot_client.zip
This file contains both the VB6 source code and compiled EXE. You can just extract the wifi_robot_client.exe and config.txt you don't want to deal with the programming stuff. The project will open and compile in VB6 if you'd like to modify it. It's Windows-only, but if anyone wants to make an alternative client app, I'll be happy to post it here and give you credit. This software is just slightly modified from the Computer Controller RC Car project posted a few years back.
wifi_robot_client.zip
This file contains both the VB6 source code and compiled EXE. You can just extract the wifi_robot_client.exe and config.txt you don't want to deal with the programming stuff. The project will open and compile in VB6 if you'd like to modify it. It's Windows-only, but if anyone wants to make an alternative client app, I'll be happy to post it here and give you credit. This software is just slightly modified from the Computer Controller RC Car project posted a few years back.
Microcontroller Firmware
PIC
You'll need a PIC programmer to burn the firmware. Personally I use a P16PRO40 that I bought on eBay. There are many pic programmers that you can purchase or make yourself for a few dollars worth of parts. You can compile the HEX yourself using Microchip's MPLAB or just download and program the HEX file provided. The PIC asm is based off of this PIC16F628 UART Test guide.
car_pic.asm
car_pic.HEX
You'll need a PIC programmer to burn the firmware. Personally I use a P16PRO40 that I bought on eBay. There are many pic programmers that you can purchase or make yourself for a few dollars worth of parts. You can compile the HEX yourself using Microchip's MPLAB or just download and program the HEX file provided. The PIC asm is based off of this PIC16F628 UART Test guide.
car_pic.asm
car_pic.HEX
Arduino (Freeduino MaxSerial)
You can follow these tutorials to get your Arduino up and running fast. The code can be downloaded to the Freeduino MaxSerial without an extra programmer.
car_arduino.c
If you're using a Freeduino MaxSerial, make sure you complete the small hardware modification that will stop the Freeduino from resetting every time it receives data from the router serial port. See the hardware section above for more technical details of the problem.
Download All Files
wifi_robot_software.zip
This zip-file contains all of the compiled binaries and source code mentioned above.
You can follow these tutorials to get your Arduino up and running fast. The code can be downloaded to the Freeduino MaxSerial without an extra programmer.
car_arduino.c
If you're using a Freeduino MaxSerial, make sure you complete the small hardware modification that will stop the Freeduino from resetting every time it receives data from the router serial port. See the hardware section above for more technical details of the problem.
Download All Files
wifi_robot_software.zip
This zip-file contains all of the compiled binaries and source code mentioned above.
Disclaimer
I have done my best to ensure to all information above is accurate. If there are any errors, please e-mail at jon@jbprojects.net and I'll make any corrections.
I have done my best to ensure to all information above is accurate. If there are any errors, please e-mail at jon@jbprojects.net and I'll make any corrections.
No comments:
Post a Comment