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. USB Ports not listed on Linux with Qt 5.3.1 [Solved]

USB Ports not listed on Linux with Qt 5.3.1 [Solved]

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 4.8k 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.
  • A Offline
    A Offline
    ad5xj
    wrote on 15 Sept 2014, 16:00 last edited by
    #1

    I am somewhat confused. I know there have been posts from last year on this subject ("QSerialPortInfo list all available port on Linux":http://qt-project.org/forums/viewthread/33369) and the solution seemed to be a temporary one (http://www.qtcentre.org/threads/56487-QSerialPortInfo-get-all-available-port-in-Linux-and-Mac?p=252525#post252525).

    Since my app is cross-platform, it will be necessary for all platforms to perform the same -- without major code modifications for platform differences. I also do not want to resort to command line results like
    @$ lsusb -tv@

    I have noticed that one problem may be that Ubuntu (and the Linux Mint variation) list USB ports differently from serial TTY devices even though USB ports are listed generically as /dev/ttysUSBn.

    Here we are, nearly a year later, and possibly two versions of Linux (and at least two Qt updates ) later and it is still unclear where this stands.

    I see no QUSBSerialPort class or any modifications to the QSerialPortInfo that is an essential fix for this problem. So what is the current situation on non-physical off-board devices like a USB bus device - and how should it be addressed at this point. The former re-compile solution seems unacceptable at this late date.

    AD5XJ

    Ken AD5XJ

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JKSH
      Moderators
      wrote on 15 Sept 2014, 16:25 last edited by
      #2

      Hi,

      Even though they both have the word "serial" in their names, "Universal Serial Bus" and "Serial Port" are completely different (and incompatible) things. See "here":http://deltas.blog.com/2012/11/28/usb-vs-rs-232/ for a discussion about their differences.

      QSerialPort supports the RS-232 protocol. It cannot talk to USB devices.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ad5xj
        wrote on 15 Sept 2014, 16:54 last edited by
        #3

        JKSH

        OK...just for the sake of the discussion; let's use your superficial semantic approach (no such discrimination exists for less technical users) what is the facility in Qt to list and use USB ports as a serial device?

        Ken AD5XJ

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JKSH
          Moderators
          wrote on 16 Sept 2014, 06:24 last edited by
          #4

          Hi ad5xj,

          [quote author="ad5xj" date="1410800094"]what is the facility in Qt to list and use USB ports as a serial device?[/quote] QSerialPortInfo lists all your physical and virtual serial ports (including USB ones). QSerialPort lets you use those ports.

          I used Ubuntu 13.10 64-bit with Qt 5.3.1 (downloaded from http://qt-project.org/downloads ), and was able to communicate with a serial device through an "ATEN UC232A":http://www.aten.com/Mobility-&-USB/USB-Converters/USB-to-Serial-Converter~UC232A.html without issues. The test code from "your link":http://www.qtcentre.org/threads/56487-QSerialPortInfo-get-all-available-port-in-Linux-and-Mac?p=252525#post252525 worked fine with ttyUSB0.

          If it doesn't work for you, please state:

          • Your OS version
          • How you installed Qt
          • What you tried, and what results you got

          [quote author="ad5xj" date="1410796823"]I have noticed that one problem may be that Ubuntu (and the Linux Mint variation) list USB ports differently from serial TTY devices even though USB ports are listed generically as /dev/ttysUSBn.

          ...

          I see no QUSBSerialPort class or any modifications to the QSerialPortInfo that is an essential fix for this problem.[/quote]There probably was nothing to fix from Qt's side.

          In your link, kuzulis (a maintainer of the Qt Serial Port module) guessed that the user's copy of the module was built without the library (libudev) required to query the Linux kernel's device manager, which resulted in it being unable to query ttyUSB0.

          However, the "official packages":http://qt-project.org/downloads are built with libudev.

          [quote author="ad5xj" date="1410800094"]let’s use your superficial semantic approach (no such discrimination exists for less technical users)[/quote]Apologies, I think I misunderstood your post originally. I was trying to say that, while QSerialPort can talk through a USB-to-RS232 converter, it cannot talk to a USB storage device or a USB mouse (both of which can be plugged into a USB port).

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ad5xj
            wrote on 16 Sept 2014, 15:45 last edited by
            #5

            So as I understand your reply...the only time a USB port will be listed by QSerialPortInfo is when there is a USB-Serial adapter connected? ? ?

            Ken AD5XJ

            1 Reply Last reply
            0
            • J Offline
              J Offline
              JKSH
              Moderators
              wrote on 16 Sept 2014, 15:53 last edited by
              #6

              [quote author="ad5xj" date="1410882341"]So as I understand your reply...the only time a USB port will be listed by QSerialPortInfo is when there is a USB-Serial adapter connected? ? ?[/quote]Correct. That's because a USB port is not a serial port.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • G Offline
                G Offline
                gifthonest
                wrote on 16 Sept 2014, 18:43 last edited by
                #7

                Hi,

                accordind to how i have seen their difference on deltas.blog.com they both have the word “serial” in their names, “ Serial Bus” and “Serial Port”but are completely different things.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  ad5xj
                  wrote on 18 Sept 2014, 15:49 last edited by
                  #8

                  Well, in truth of fact, USB IS serial - it has to be by the very electronic nature of the bus -- it is just not a RS-232 serial device -- just as SATA is serial but is not an ATA device ( ATA being parallel data).

                  It is not helpful to play these semantic games.

                  It would have been appropriate to say "USB ports only show up in QSerialPortInfo when a USB->Serial adapter is attached because USB p-n-p devices can be any type of serial device (like a mouse or keyboard or even a SATA external drive)" - that is the appropriate and direct approach instead of these semantic and frankly, useless arguments given the original question.

                  I now have an idea what to do with my application. Thanks JKSH

                  Ken AD5XJ

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    JKSH
                    Moderators
                    wrote on 19 Sept 2014, 02:47 last edited by
                    #9

                    Hi ad5xj,

                    I'm glad to hear that you've found a way forward, and I wish you all the best for your project. Thank you also for your feedback; I will strive to be clearer in my future posts.

                    To be fair though, I replied your original post by saying that "QSerialPort supports the RS-232 protocol. It cannot talk to USB devices". Was that insufficient to answer your original question (as I understood it) of "Why doesn't QSerialPortInfo display my USB ports?" or "How can I get QSerialPortInfo to display my USB ports?"

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    1

                    7/9

                    16 Sept 2014, 18:43

                    • Login

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