callaa / qfirmata

Firmata library for Qt/QML
GNU Lesser General Public License v3.0
16 stars 5 forks source link

Windows cannot get protocol version #4

Open andtro opened 6 years ago

andtro commented 6 years ago

While running the basics.qml example on windows it gets hung up on requesting the protocol version while it works fine on linux. I'm not sure where to get started for fixing this.

callaa commented 6 years ago

Does it print any warning messages? There could be some QSerialPort settings that aren't being set. You can also try inserting debug prints to src/backends/serialport.cpp to see if any data is actually received.

andtro commented 6 years ago

I temporarily fixed the problem by excluding COM1 from the list of ports. This is a communication port that shows up only when I have a docking station attached to my laptop. So as you would guess, when I detach my laptop from the dock basics.qml works fine. The problem is that the program attempts to open COM1 first and cannot (probably because it is not a normal port). My approach of excluding COM1 in PortSelector.qml works, but it would be more robust to have a way to stop communication with the current port while switching ports.

After more testing I found that the only way to freeze the program is if COM1 is used as the first firmata.backend.device. Otherwise when COM1 is opened after another port, nothing happens and the program does not freeze.