BreakfastSerial icon indicating copy to clipboard operation
BreakfastSerial copied to clipboard

Fixes for Arduino Yun

Open suda opened this issue 11 years ago • 4 comments

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 FirmataNotOnBoardException due to empty firmata_version property. It could be caused by changes in Firmata protocol, because 2.3 only responds with queryFirmware (0x79) which sets firmware and firmware_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 Led init.

I don't have any board other than Yun, so I'm unable to tell if these changes broke anything on other boards :(

suda avatar Jun 02 '14 15:06 suda

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?

theycallmeswift avatar Jun 02 '14 15:06 theycallmeswift

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()

theycallmeswift avatar Jun 02 '14 15:06 theycallmeswift

You're right. Added in edcb504

suda avatar Jun 02 '14 16:06 suda

LGTM. I'll verify that it works as expected on other boards and get this merged asap.

theycallmeswift avatar Jun 02 '14 16:06 theycallmeswift