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. Serial port doesn't work after few minutes
QtWS25 Last Chance

Serial port doesn't work after few minutes

Scheduled Pinned Locked Moved Unsolved General and Desktop
serialraspbian
7 Posts 4 Posters 2.4k Views
  • 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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by
    #1

    I'm facing a weird behavior I have never seen before.
    Raspbian Stretch, Qt 5.9.2.

    My application open a serial port (i.e. /dev/ttyUSB0) and I can send and receive data.
    After few minutes (it's not always the same amount of time) the port seems to be still open, but no data is transmitted or received anymore. Closing and reopening the port will lead it back to work.

    I inspected dmesg and udevadm monitor but no activity is shown when this happens.
    I changed RPi, USB dongle (tried with different chipsets), power supply, USB port and sd-card.

    Please note this doesn't happen all the times... in few cases it worked for at least 15 hours without any problem!
    And it isn't related to the message exchanged: it happened even with no serial activity at all, and while exchanging data.

    Of course I'm not asking you a solution - would be nice, but I guess your crystal ball is still being repaired.
    I'm not sure where is the root cause: hardware, operating system, my application...

    What I'm asking is any idea about how you would investigate further on such an issue.

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2

      Hi. I'm using QSerialPort in a lot of projects without any problem.
      Normally your problem is related to the hardware.
      But, when I'm not receive nothing from a serial port or from a tcp socket, I close and open the serial porto or the tcp socket.
      I do this with QSerialPort but also with Delphi and other development platform because this problem can happen.

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      M 1 Reply Last reply
      0
      • mrdebugM mrdebug

        Hi. I'm using QSerialPort in a lot of projects without any problem.
        Normally your problem is related to the hardware.
        But, when I'm not receive nothing from a serial port or from a tcp socket, I close and open the serial porto or the tcp socket.
        I do this with QSerialPort but also with Delphi and other development platform because this problem can happen.

        M Offline
        M Offline
        Mark81
        wrote on last edited by
        #3

        @mrdebug said in Serial port doesn't work after few minutes:

        But, when I'm not receive nothing from a serial port or from a tcp socket, I close and open the serial porto or the tcp socket.
        I do this with QSerialPort but also with Delphi and other development platform because this problem can happen.

        Well, I cannot close and open the port because I don't know when I don't receive data :-)
        I mean, I might wait for 6 hours before a message is actually sent to my system.

        Anyway, this problem must not happen! I have plenty of RPi out there that works with 4 serials each 24/7 for years... they never missed data!

        I'm sure there's something wrong in this setup but I don't know how to find out what it is.

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

          Hi,

          Is this specific to 5.9.2 ?
          Can you check with an earlier version ?
          Can you check against 5.10 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Is this specific to 5.9.2 ?
            Can you check with an earlier version ?
            Can you check against 5.10 ?

            M Offline
            M Offline
            Mark81
            wrote on last edited by
            #5

            @SGaist said in Serial port doesn't work after few minutes:

            Hi,

            Is this specific to 5.9.2 ?
            Can you check with an earlier version ?
            Can you check against 5.10 ?

            I cannot easily check against other versions because I have to cross-compile all again. If I have some time I would do.
            In the meanwhile I'm looking to find a configuration that works (I'm afraid about RPi revisions and USB converters).
            Another test I'm going to do is understand if it's Qt- or system-related, i.e. open a serial terminal (minicom or just cat) and see what happens.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You don't have to rebuild everything, you can start with only the qtbase module and then build only the modules you need with the usual combo qmake/make/make install.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • M Offline
                M Offline
                mostefa
                wrote on last edited by
                #7

                Hi @Mark81

                Can you share the settings of your serial port?
                Are you sure about them ? Is Flow Control enabled?

                1 Reply Last reply
                0

                • Login

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