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 implementation QT4.8
Forum Updated to NodeBB v4.3 + New Features

serial port implementation QT4.8

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 685 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.
  • Q Offline
    Q Offline
    qt_emp
    wrote on last edited by
    #1

    I am running RedHat RHEL6.1. Also QtCreator2.8.1

    The new PC's do not come with serial ports any more so I have a PCIex serial card in my PC.
    I can talk to my serial devices via minicom through the USB ports using a USB to RS232 converter. I cannot talk to the serial devices through the third party PCIex card via minicom.

    Additionally my c++ code will not communicate "correctly" through the USB to RS232. It appears that commands are being received by the devices, the responses are garbled or corrupted. There must be something I'm missing in set up or control that is causing this. Any suggestions on where to look? Please don't say to upgrade to QT5.1 That is not an option in the I.T. environment that I am working in.

    Thanks for any help.

    aha_1980A 1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      If you say that data is corrupted most probably it will be setting the baud rate or flow control etc. Did you try to use QSerialPort library ? For Qt 4.8 it is not there. It is available as openSource. You can download, compile & use it.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      3
      • Q qt_emp

        I am running RedHat RHEL6.1. Also QtCreator2.8.1

        The new PC's do not come with serial ports any more so I have a PCIex serial card in my PC.
        I can talk to my serial devices via minicom through the USB ports using a USB to RS232 converter. I cannot talk to the serial devices through the third party PCIex card via minicom.

        Additionally my c++ code will not communicate "correctly" through the USB to RS232. It appears that commands are being received by the devices, the responses are garbled or corrupted. There must be something I'm missing in set up or control that is causing this. Any suggestions on where to look? Please don't say to upgrade to QT5.1 That is not an option in the I.T. environment that I am working in.

        Thanks for any help.

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @qt_emp said in serial port implementation QT4.8:

        Please don't say to upgrade to QT5.1

        No, I would not recommend that. Rather upgrade to Qt 5.9.x or the upcoming Qt 5.12, both are long term support versions. If you still need support for Qt 4.8, you will have to pay for it, as the official support has ended.

        Just to add to @dheerendra: which serial port library do you use? QtSerialPort?

        One thing you have to keep in mind with USB serial adapters, they are slower than real serial ports. Dot.

        Especially the receiver side is buffered, so you will most likely not receive every character on it's own, but often a chunk of characters that are received in a specific timeout (e.g. 16 milliseconds).

        So the only thing you can do, is to debug your program, read the specification of the external device and if you still encounter problems, think about a serial port spy hardware that allows you to capture the data that is sent over the serial line. Believe me, 95% of errors are in code, not in the hardware.

        Good luck!

        PS: My new mainboard for AMD Ryzen still has a serial port onboard, only the 9 pole ribbon cable and the slot connecter were missing. Otherwise it works fine in Linux. Maybe your mainboard has a hidden serial port too?

        Qt has to stay free or it will die.

        1 Reply Last reply
        2

        • Login

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