jgautier/firmata — pull request #27 by brainrape (2013-07-08 01:37:00+00:00)
Title: Fix: connection only works right after board boot

Node-firmata initializes by waiting for a Version Report from the board. This is only sent automatically on boot. So unless rebooting the board after starting node-firmata, it will not connect.
This is particularly painful with Arduino Leonardo, where the serial device disappears during reboot, so the only way to get it working is to start node-firmata after the bootloader has finished, but before the version report was sent (about 1 second window).
This diff fixes the above bug by sending a version report request and a firmware query when the serial port opens, and waiting for the response.