Firmata is a serial communication protocol designed for transferring data between (for example) a microcontroller board and a host computer. Software running on the host (the Pi, in this case) can control, either by reading or writing to, ports on the target microcontroller (the Arduino, in this case).
There are a couple of different approaches typically adopted by Firmata users. One is to use a pre-written Arduino sketch called 'StandardFirmata' to handle the Arduino's ports, and the host side software then communicates with StandardFirmata as necessary to set or read specific Arduino interfaces. Another, more difficult but more powerful approach is for the Arduino programmer to write programs that directly use the Firmata library to handle the Arduino's ports, which allows the programmer to handle custom logic and preprocessing or postprocessing of the data within the Arduino sketch before or after shipping the data betweem the two endpoints.
My plan is to start off by using StandardFirmata to read and set port values. After I'm successful doing that, I may (or may not) consider rolling up my sleeves and doing some custom Firmata coding on the Gertduino.
The main page of the Firmata wiki is at http://firmata.org/wiki/Main_Page and the Firmata protocol itself is documented at http://firmata.org/wiki/Protocol. The Arduino Firmata library is documented at http://arduino.cc/en/reference/firmata.
Several Python modules have been developed to simplify the use of Firmata from the host side. Some of these are listed at https://github.com/firmata/arduino (under the heading of "Firmata Clients"). I am going to try using pyFirmata as it is the one that I've seen most frequently used in the examples that I've found.
As the Firmata protocol has evolved over time, it's a good idea to ensure that the version that you're using on the Arduino side is compatible with the library that you've chosen on the Pi side. The most-recently-released version of the protocol is 2.3. The pyFirmata repository at https://github.com/tino/pyFirmata states that it is compliant with Firmata version 2.1 (and version 2.3 should be backwards compatible with version 2.1). To find out which version of Firmata is installed on the Pi (for use when programming the Arduino), I took a look at Firmata.h (which is located in the /usr/share/arduino/libraries/Firmata directory of the Pi) and discovered that it is up-to-date with version 2.3.1:
A quick check of Google brings up a number of discussions about using Firmata to communicate between the Raspberry Pi and the Arduino, each with a common theme but a slightly different approach to the implementation. As noted earlier, most of the examples that I have seen use the pyFirmata module on the Pi, and they mostly all use the StandardFirmata.ino example program on the Arduino.
The MagPI magazine, issue 7, has a great article on using the firmata protocol to communicate between Arduino and the Raspberry PI. See https://ex.ploit.ws/themagpi/The_MagPi_issue_7.pdf on pages 4 through 6. That article assumes that the Arduino is connected to the Pi via serial-over-USB, so the procedures that the author describes differ from those that I will need to use with the Gertduino, but the differences look to be easily manageable.
The most complete description of using Firmata to communicate between the Pi and an Arduino that I've found is not on the web per se (unless you have an O'Reilly Safari subscription like I do, that is, in which case it can be found starting at http://my.safaribooksonline.com/book/hardware/raspberry-pi/9781449365288/14dot-arduino-and-raspberry-pi/sec14_3_html), but rather is contained in the pages of the O'Reilly book "Raspberry Pi Cookbook" (see http://shop.oreilly.com/product/0636920029595.do). You can see a sampler of that content here: http://razzpisampler.oreilly.com/ch10.html
So it looks like I'm going to start playing with Firmata. I'll let you know what I find out.