Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qserialport's readyread not emitted until I send some bytes.
Forum Updated to NodeBB v4.3 + New Features

qserialport's readyread not emitted until I send some bytes.

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alexyuisme
    wrote on last edited by alexyuisme
    #1

    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!

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      What Qt version and OS?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      A 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        What Qt version and OS?

        A Offline
        A Offline
        alexyuisme
        wrote on last edited by
        #3

        @Christian-Ehrlicher

        Qt version: 5.14.2
        OS: Windows 64 bit

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Do you use a usb serial adaptor ?

          A 1 Reply Last reply
          0
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Also please show the relevant code and read https://forum.qt.io/topic/119074 (and maybe others wrt this topic)

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            3
            • mrjjM mrjj

              Hi
              Do you use a usb serial adaptor ?

              A Offline
              A Offline
              alexyuisme
              wrote on last edited by
              #6

              @mrjj

              Noop, I only used the serial port connected to the motherboard. 3 pins are being used: Tx, Rx and Gnd.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                alexyuisme
                wrote on last edited by
                #7

                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!

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  alexyuisme
                  wrote on last edited by
                  #8

                  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).

                  ![alt text](session.jpg image url)

                  Any hints how to fix this? Thanks!

                  A 1 Reply Last reply
                  0
                  • A alexyuisme

                    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).

                    ![alt text](session.jpg image url)

                    Any hints how to fix this? Thanks!

                    A Offline
                    A Offline
                    alexyuisme
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved