On 06/15/2011 12:57 AM, Martin Peach wrote:
I've found out that if I send the arduino the "version" message, then these messages _are_ received (also in Windows), while when the Arduino send them just after connecting, they are lost in Windows.
So I think there must be an issue either in the Windows version of [comport] or in the Windows drivers, that if a message is received too soon after connecting, it is lost.
Yes I've run into that with arduino on MacOSX; the arduino bootloader is active for about 5 seconds after power-up, or whenever the port is opened if you are powering it via USB, so you have to be careful not to send anything through the serial port in the first 5 seconds or the arduino will interpret it as an incoming program.
But I'm talking about the opposite direction. Messages sent from the Arduino to the computer immediately after the connection is established,
already powered on and running StandardFirmata 2. In Pd I send the message "open 0" to the [arduino] object
In linux: [comport]'s left outlet outputs some data coming from the arduino, which happen to be the messages telling the firmware version and such
In windows: [comport]'s left outlet doesn't output anything.
So my guess is that the Arduino board, as soon as the connection is established from Pd, immediately sends data. In Linux this data is received and output by [comport], in Windows it is lost. I'm talking about data sent from Arduino to the computer, not viceversa.
My guess may be entirely wrong, of course. It's just the only explanation I can think of.
Note that these messages that the arduino sends (immediately after opening the connection through comport) are NOT being triggered by anything being sent by the [arduino] abstraction to the arduino board through [comport].
A possible explanation, now that I think about it, may be that the Arduino board does not send the firmware version every time a connection is established, but every time it is reset, and for some reason (due to differences in the way drivers work) establishing the connection from Pd in Limux triggers an Arduino reset while establishing the connection from Pd in Windows does not.
Is it so?
Ohhhhhhhh, it may be relevant (though I don't directly see how) that when I test on Windows I do it through a virtual machine (on a linux host which is the one on which i test it in Linux).