ofArduino doesn't get any data from serial (firmata)

I’m having trouble getting my ofApp to detect/establish communication.

I’m using the simple windows firmata example,
ofArduinoInst.connect ( “COM5”, 9600 );
ofAddListener (ofArduinoInst.EInitialized, this, &ofApp::SetupArduino);

When I run the debugger, the console prints ‘found 1 devices, [0] = COM5’, but the breakpoint I have on setupArduino never hits, as if it never gets the startup data from the arduino, and so ofApp just sits waiting for Arduino to be ready.

As a simple test, instead of an Arudino I connected a winxp machine, to the computer running ofApp. On both machines I open hyperterminal and I can see communication on the opposite computer when I type. So I know both computers can send/receive with serial data @9600bps.

Then on the ofApp machine, I close Hyperterminal and run ofApp. As it’s waiting for communication from an “Arduino”, I type on my winxp computer hyperterminal, and yet still nothing happens on ofApp. It doesn’t seem to get the data that I know is being sent.

Anyone have any idea why? Where does ofArduinoInst.EInitialized get set? Maybe the startup data I’m sending is not correct (0xF9 0x2 0x3)?

is there a reason you are using 9600 baud rate? standard firmata (the one that ships with arduino) is using 57600 baud rate. Have you installed that one on the arduino or something different?

I originally tried the default baud, but when that didn’t work, I slowed it down just in case it’s a speed issue…

I’ve seen some examples that use ofSerial (without ‘EInitialized’) instead of ofArduino… I would think that ofArduino came later and is the preferred way of doing it, but is that true? Or is there no advantage to ofSerial?

Also, haven’t found where ‘EInitialized’ gets set, anyone know the file that it’s in?

can you run the ofFirmata example that comes with OF and also wire it up similar to the picture when you run the app (and make sure standard firmata is installed)? The baud rate should definitely be changed…

Running openframeworks\examples\communication\firmataExample, and just changing the port to COM6

And the Arduino I upload the ‘Standard Firmata’ sketch without any changes.

The sketch seems to upload fine, and the ofapp seems to run fine, except it’s just is ‘waiting for arduino’.

Can ofSerial work with the Arduino? Not sure what else to try.


Same problems on Windows 8 with standart example. EInitialized never fired with ofArduino.
Firmata tester works great. Same code and same Arduino on OSX also work great.

send a firmware request, sometimes the arduino doesn’t resent when the serial connection is established so the event never is triggered

see here: