Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82606

CLONE - QSerialPort does not receive data on Windows (5.13.1+)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.13.1, 5.14.1
    • Serial Port
    • None
    • Windows

    Description

      QSerialPort is not able to receive any data from a serial port on Windows in 5.13.1 and 5.14.1.  Data is being received by the serial port itself, however QSerialPort does not register any data being received.  This causes the following symptoms (that I've tested, more symptoms may occur)

      • readRead() is never emitted
      • waitForReadyRead() always returns false
      • bytesAvailable() always returns 0
      • QIODevice::read(char *data, qint64 maxSize) is never able to read data, returning 0 every time.

      The issue is not present on Ubuntu.  If I run the same exact code on Ubuntu, it works as expected.  I've tested both with physical and virtual serial devices/ports.

      I've attached a minimal example, provided by kuzulis in QTBUG-78714, which he indicated worked for him (although Qt version / OS he used not specified).  This example works for me on Ubuntu, but not in Windows.

      I used a virtual serial port pair by Eltima.  You can see that the data is actually sent and received between the two ports, but QSerialPort never actually ingests the data from the port.  Two PNG attachments confirming that data is being received by the port, but the output of this minimal test program shows that readyRead is never emitted.

      I've verified in my own code that bytesAvailable(), waitForReadyRead(), and QIODevice::read exhibit the symptoms I listed earlier only in Windows.

      I was able to find that, similar to QTBUG-78714 above, if I open and close the serial port using another piece of software (XCTU in this case), then QSerialPort is able to read data as expected.  However, this is only the case for physical COM ports, and the open/close method does not fix the issue with virtual com ports.

      I opened a new issue separate from QTBUG-78714 (and a bunch of other similar bug reports) because this doesn't seem to be an issue specific to readyRead(), but instead at the root of QSerialPort being able to ingest data from the serial port itself (e.g. bytesAvailable() always being 0, etc)

      Attachments

        1. console.png
          console.png
          16 kB
        2. qtbug78714.zip
          238 kB
        3. serial_demo.zip
          205 kB
        4. Virtual Ports.png
          Virtual Ports.png
          71 kB

        Activity

          People

            kuzulis Denis Shienkov
            falloutst Mark Staver
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: