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.

2 Responses to G35 Arduino Raspberry Pi Controller

  1. Jim says:

    When can we see the arduino portion of the code?

  2. Dave Boulton says:

    Hi Jim,

    Not entirely sure what you mean. This post was about getting stuff to an Arduino via a Raspberry Pi. The Arduino sketches I’ve used are at https://github.com/davidb24v/G35Stuff, the library this is based on is at https://github.com/sowbug/G35Arduino.

    There doesn’t seem to be much happening with these lights at the moment. I’ll still be playing with a few ideas this Xmas though.

    If there’s anything specific you want then just yell and I’ll try to pass on what I understand about these things. Mostly, I’ve used the work of Sowbug and others – you can see a long way if you stand on the shoulders of giants, or whatever.


Leave a Reply

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