[SOLVED] Arduino connection problem on OF0.8.4

Hi,

Recently, I am trying to connect my Arduino to OF0.8.4 on windows.

My Arduino Uno Rev3 worked fine with the official IDE.
The port it uses is COM3 (on windows);
I can upload sketches and ran it without any problems.

But when I try testing it using the official example “firmataExample” ,
the event EInitialized did not get raised.

At that moment, if I open the Arduino IDE ,open the serial monitor and then close the IDE.
Then run the firmataExample again. The example works !!!

I also find I have to open serial monitor every time I reconnect the USB line to my Arduino to make the example work.

Anyone have ideas what happened in this case?? Is this a bug or errors in OF ??
It’s annoying I have to open Arduino IDE every time my app going to run.
Thanks!!

There will be an update coming for handling arduino in the near future once it gets pulled in and is a part of the future releases. The current implementation is buggy and outdated the updates are here:

You should be able to just replace the files in the libs/openframeworks/communication folder with the ones found in that branch (while it still exists, one it gets merged it will be deleted) That means replacing ofSerial and ofArduino files

Thanks for the replying.

I have tried the code in your repo but those code with “c++ 11 only” syntax make the building failed.
I will test my project on the new coming of0.9.0 later.

ah yes I forgot about those additions. Try sending a firmware request.

ard.sendFirmwareVersionRequest()

When the port opens a connection it is supposed to reset the arduino, like what happens when you use the serial monitor on the IDE but that doesn’t actually always happen so you might be connected to the device but the event is never triggered. The arduino will only send the firmware when it first boots unless requested so just try this after the connect phase or hitting the reset button on the arduino.

1 Like

Whoa!!!

It works like a charm.
Thanks a lot.

1 Like

Really helpful!
(sorry to dig up this post, but I had the same problem with Firmata and OF 0.9.8 - just added the line to the Firmata example and everything worked)