QtSerialPort example fails

1.3k views Asked by At

I am using Qt 5.1 and when my app (which worked using QextSerialPort in v4.8.4) failed to communicate, I tried the example in ...\5.1.1\Src\qtserialport\examples\serialport\terminal. And that fails too.

I have a simple USB dongle that emulates a COM port. If I use RealTerm, I can send AT commands to it and get back OK just fine.

But the terminal example that comes with Qt does not communicate with it. I looked at an API snooper, and I am getting an unsuccessful return with error of "997:Overlapped I/O operation is in progress" for WaitCommEvent and WriteFile.

I am running it on Windows 7, and I copied the exe and DLLs over to a Windows 8 machine, and it failed to communicate as well (though I didn't do the API snooping there).

Anyone have any ideas what to try? How can the unmodified example app just plain fail? I am befuddled.

2

There are 2 answers

2
László Papp On BEST ANSWER

The terminal example should work. You can track the issue down by first getting the cwritersync example work.

If that is not working, try to make a loopback between the RX and TX lines which are usually the 2nd and 3rd pins of your 9-pins serial port.

Having got that working, you can go further, and try to use the cwriterasync example which is a step closer to what the terminal example is using.

Once, that is working, you can realize what you would have done wrong with the terminal example. It might still be a QtSerialPort bug, but in that case we need all your details about the hardware environment.

Also, please make sure in that case whether or not the terminal example works fine for instance on Unices.

5
Denis Shienkov On

Please try the Qt 5.2 with the available QtSerialPort module (or try to build a last version of the QtSerialPort from git).

I have a simple USB dongle...

What is dongle model? VID/PID?

...return with error of "997:Overlapped I/O operation is in progress..

it is not an error.