Fixes for Arduino Yun
Hi Swift,
I had two issues with BreakfastSerial and Yun board using StandardFirmata 2.3 (bundled with Arduino IDE 1.5.4):
- initialization was failing with
FirmataNotOnBoardExceptiondue to emptyfirmata_versionproperty. It could be caused by changes in Firmata protocol, because 2.3 only responds with queryFirmware (0x79) which setsfirmwareandfirmware_version. Also it's only done after boot, so I added protocol version query on init. - setting LED value didn't work without setting port mode to output, so I also added it in
Ledinit.
I don't have any board other than Yun, so I'm unable to tell if these changes broke anything on other boards :(
Awesome, thanks for your contribution! The only question I have is about that call it iterate. I think it might be unnecessary, but you'll have to check that on your setup. Mind reporting back once you give it a try?
Actually, after looking at it further, my above comment is wrong because the board would raise an exception before it runs the thread. Disregard.
I'm still not convinced the iterate call is right though. What guarantee do we have that the first bytes we're going to iterate through are the version? Maybe it should be:
while self.board.bytes_available():
self.board.iterate()
You're right. Added in edcb504
LGTM. I'll verify that it works as expected on other boards and get this merged asap.