G35 Arduino Raspberry Pi Controller

Just some notes on the setup of the Pi -> Arduino uploader for G35 lights..

Wifi starts on boot (assuming it finds a compatible adaptor). Sets up “Blinkenlights” access point with WPA2 security and the Pi’s IP address is

A simple python web server is also started and this can be reached at

User account is pi, password also is pi. Not very secure but you have to have the WPA2 pass-phrase to get in.

During startup of the server, the directory /home/pi/hexfiles is scanned and all the “.hex” files are used to create buttons that trigger the uploading of the desired hex file to the arduino. Some of the filenames are a bit crap so you can also place the text to use instead of the filename into a “.txt” file with the same name as the “.hex” file

If you add/delete and files in /home/pi/hexfiles then you can either restart the pi or go to the /home/pi/www directory and run ./update.py

Here’s what you’ll see in your brower:

Simple table of buttons

Simple table of buttons

That shows what I mean about the filenames. As an example, I created “Off.txt” with the text “Switch Off!” in it. That button would just be labelled “Off” otherwise.

Hex files are needed for the arduino. These can be built on the pi – the SD card contains everything necessary.

To add more sketches…

Get them across to the pi, somewhere under sketchbook/G35 would be good but it doesn’t really matter. If you cd into your sketch directory then just “cp ~/sketchbook/Makefile .” and type “make”. When it’s finished you’ll have the “sketchname”.hex file in the build-uno sub-directory. Copy that into /home/pi/hexfiles, cd to /home/pi/www and just ./update.py to recreate the index.html page.

If the arduino and lights are connected “make upload” from the sketch directory will upload the hex file to the arduino (the arduino IDE does all of this behind the scenes but it isn’t easy to get at the hex file using that PoS).


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *