COM_Arduino.SerialPort = myPort
COM_Arduino.Baud = Serial.Baud9600
COM_Arduino.Bits = Serial.Bits8
COM_Arduino.Stop = Serial.StopBits1
COM_Arduino.Parity = Serial.ParityNone
if COM_Arduino.Open Then
COM_Arduino.Write("HUB_ON")
COM_Arduino.Flush
App.SleepCurrentThread(100)
COM_Arduino.Close
Else
MsgBox("errore")
End
This works fine on windows. On Linux, however, no. I can get it to work (I hear the noise of a hub turning on) only if I execute the line in debug, putting a breakpoint first.
I specify that an error is not thrown, but that the “write” instruction simply has no effect.
Does the following line also stop the Serial Port working on Linux?
If it does then your data will not be sent out.
Also, after the thread is paused for your time period, you then close the port ensuring no more data is sent.
Sorry for my late reply but I was doing it from work and so I haven’t seen your reply until today.
Unfortunately I cannot help anymore as I don’t have a Linux machine to hand but hopefully someone who does maybe able to help you more.
Some updates: I realized that, on windows, opening and closing the serial port at each “Sub” does not give any problems. The device is not reset. On Linux, on the other hand, the device is reset at each “Open”. Therefore, the behavior is completely different, with the same code.