Fully prepared SD card image. once I have my setup finalised I will upload a torrent of the SD card images for both wlan and Access point modes.
This is my caterpillar tracked Raspberry Pi robot. It is fitted with a tilt controlled camera and is controlled through a web portal or web app on an iOS phone. wireless controls is over wlan. video is streamed with little to no latency making for a cool little spy vehicle.
I have attached my HTML and script files for others to use as they see fit.
how to assemble the tracks https://youtu.be/RxB7USuMwRw
EDIT: the default username and password for the cam stream is user: userxyz pass: pass1234
you can change this by editing /opt/mjpg-streamer/mjpg-streamer-experimental/run.sh
EDIT: I added an addition file "Body_SD_Card.stl" This alternative body has a slot for a spare SD card built into it. The reason being it takes a lot of setting changes to take the robot from working on a wifi network to being able to operate independently anywhere by becoming a Wifi Access Point and connecting to the robot directly. I have been experimenting with a way to script these setting changes without breaking anything and decided it would just be easier to swap the SD card.
I use S3D and only place supports where they are needed so just use your own 3D printing experience to put supports where they will be needed
print 2x trackSegments for 64 track segments in total.
Raspberry pi 3
L9110 H bridge - You will need 2x these drive the motors
N20 6volt 256:1 reduction - You will need 4 available from hobby king
Pi Camera and extended cable (20-30cm)
Nylon stand off's - 4x 6mm 4x 20mm - A cheap kit like this from hobby king will have them all
XT60 battery connection with mounting tabs - available from hobby king
high intensity white LED
5volt switching BEC
4x M3x8 countersunk
4x M3 Nylock nuts
4x 3mm x 2mm rare earth magnets easily found on ebay
3mm cable ties
double sided tape
6mm spiral wrap
a 2-3cell lip battery (I'm using a 3cell 5200mAh which powers the bot for over 10hours)
...and almost forgot 1x 9g servo.
Prepping the raspberry pi
Download the Raspbian lite distro and install onto an 8gig or larger sd card
before you eject the SD from your PC creat a file called ssh and drop icon to the root of the card.
Next create a file called "wpa_supplicant.conf" in the root of the SD and past the following:
change networkName and networkPassword to your wifi network name and pass word.
this will prepare your Raspberry pi for headless use, you can now put the SD in the Pi and power it up, look for the Pi's IP on your wlan and connect to it by ssh.
installing the software
google is your friend I will point you in the right direction but for more detailed help there is plenty of it online.
to begin with make sure your pi is completely up to fate with:
$ sudo apt-get update
$ sudo apt-get upgrade -y
install git to allow cloning into GitHub
$ sudo apt-get install git-core
$ git clone git://git.drogon.net/wiringPi
$ cd ~/wiringPi
$ Sudo ./build
install the web server lighttpd
$ sudo apt-get install lighttpd -y
$ sudo lighttpd-enable-mod cgi
$ sudo lighttpd-enable-mod fastcgi
$ sudo nano /etc/lighttpd/lighttpd
Change serve.document-root =“/var/www/html” to serve.document-root =“/var/www
$ sudo /etc/init.d/lighttpd stop
$ sudo /etc/init.d/lighttpd start
Install jpg-streame-experimental using the supplied script in the files copy the script to your home directory and execute it with:
$ sudo ./install-jpg-streamer.sh
$ git clone https://github.com/srcshelton/servoblaster
$ cd servoblaster
$ make servod
in order to get the various software to run on start up edit the rc.local file
$sudo nano /etc/rc.local
paste the following into the file above the last line exit 0 the #comments explain what the commands do.
# Start stream from PiCam
sudo /opt/mjpg-streamer/mjpg-streamer-experimental/run.sh &
# Start Servoblaster Daemon on pins 31,33
sudo /home/pi/servoblaster/servod --daemonise=1 --p1pins=31 --max=230 --idle-timeout=250
# Set light to off
gpio write 7 0
# Set all motors to off
gpio write 0 1
gpio write 1 1
gpio write 2 1
gpio write 3 1
gpio write 4 1
gpio write 5 1
gpio write 6 1
gpio write 21 1
# Set GPIO pins in use to output mode
gpio mode 7 out
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
gpio mode 4 out
gpio mode 5 out
gpio mode 6 out
gpio mode 21 out
Finally you can copy the contents of the WWW folder to /var/www/
typing the IP address of the Pi into a web browser on your network should display the web page to control the robot.
What to do next...
with the pi software setup its a good idea to wire all the components together and get them working before you install them in the robot.
connect gpi0 7 to the led
connect gpio 0,1,2...6 and 21 to the motor drivers
connect gpio 31 to the tilt servo