qserialport's readyread not emitted until I send some bytes.
-
Hello, all:
I encounterd a very strange problem related to qserialport. I created a qserialport object in a non-ui thread and do send/receive operations within that thread.
After running a couple hours, readyread signal was suddenly not received any more. At this moment, I tried unplug all serial cables and did a send operation, the readyready signal was received again. This issue is 100% reproducible.
Can anyone help? Thanks!
-
What Qt version and OS?
-
What Qt version and OS?
Qt version: 5.14.2
OS: Windows 64 bit -
Hi
Do you use a usb serial adaptor ? -
Also please show the relevant code and read https://forum.qt.io/topic/119074 (and maybe others wrt this topic)
-
Noop, I only used the serial port connected to the motherboard. 3 pins are being used: Tx, Rx and Gnd.
-
OK, I heared that some qt versions have many issues with qserialport. Can anyone tell me that which version has been varified without qserialport problem? Thanks!
-
I narrowd down the problem with a serial port monitoring software. It seems the root cause is that after it receives data from the sender(187511), it never send back ioctl_serial_get_commstatus to the sender thus the whole receive session never gets terminated.
But if I send some data back to the sender(187512), the ioctl_serial_get_commstatus gets sent again(187514).
Any hints how to fix this? Thanks!
-
I narrowd down the problem with a serial port monitoring software. It seems the root cause is that after it receives data from the sender(187511), it never send back ioctl_serial_get_commstatus to the sender thus the whole receive session never gets terminated.
But if I send some data back to the sender(187512), the ioctl_serial_get_commstatus gets sent again(187514).
Any hints how to fix this? Thanks!
Tested qserialport on 5.12.4, 5.12.10, 5.14.2, 5.13.2 and non of them work...After spending many hours looking at driver ioctl sequences, I believe the main cause is that the qserialport send() can mess up the recv process of the serialport thus causing readyread signal not trigger anymore.
Switched to qextserialport and the problem is gone... It is a extremely painful experience to inspect this issue. I think the qt dev team should either escalate the serial port bugs to higher levels or just simply announce the serial port is not usable at all.
Alex