Slowly but surely I've been plodding through my phased approach to testing communication between the Pi and the Gertduino via the serial port. So far it has been delightfully drama-free.

 

It took just a few minutes of effort to load and run the complementary sample Python (PiGertduinoSerial.py) and Arduino (PiGertduinoSerial.ino) programs shown at the bottom of the page at http://friendsoftheunicorn.net/content/raspberry-pi-gertduino-serial

 

I downloaded both sample programs, scanned the source code to understand what the programs were supposed to do (encountering only one mystery - what is the purpose of the [:-2] at the end of the script?), glanced at the pySerial overview page at http://pyserial.sourceforge.net/shortintro.html, loaded the pySerial module onto the Pi, did the chmod to make the Python script executable and launched the script, loaded the Arduino code into the IDE, got scolded by the IDE for not having placed the .ino file into an identically-named directory, let the IDE fix it for me, then uploaded and ran the Arduino sketch on the Gertduino.

 

pyscreen.png

 

As I said, there was no drama - it just worked. I can turn Gertduino LEDs on and off at will by simply typing a number on the Pi's keyboard and pressing ENTER, receiving a confirmation message from the Gertduino. So I now have a simple, working template that I can modify at will to handle rudimentary program-to-program communication between the Pi and the Gertduino.

 

No, we're not there yet. But we should be there "real soon now." Next step: see if I can get Firmata running, which will provide a more structured method for communicating between programs running on the Pi and on the Gertduino.