I spent this Saturday doing a fun project: controlling a mobile robot using raspberry pi and smartphone device. I would like to learn about using Raspberry Pi and how to implement a web server on it to enable it being controlled via network.
Actually this is pretty straightforward, so here are the steps:
1. Implement web server on Raspi.
I implemented web server on Raspberry Pi using instruction from this instructables: http://www.instructables.com/id/Web-Control-of-Raspberry-Pi-GPIO/?ALLSTEPS
2. Edit the control.php from that instructables at point 1 to control the LED on the motor controller for testing. I added buttons to control GPIO 7 and 8 for the LED. The edited file: Control.php
3. On the RaspPi, Download the python library for the motor controller from this site. I also made a simple function to move the robot forward, so that I can execute it by typing “python forward.py” on the shell script at point 4. Here is the code: forward.py
4. Update the GPIOServer.h from that instructables I mentioned on point 1 by adding pin 7 and 8 to control the LED and pin 17 to instruct the robot to move forward. This shell script will be run all the time to read the database of the input output that are implemented in point 1 &2. Once it finishes reading the database, it will echo GPIO pins on the RaspPi. This is the updated code: GPIOServer.sh
And after that, by connecting your smart devices to the RaspPi, you can control the robot. Have FUN!