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

QSerialPortInfo Provides USBHUB Info instead of Port Info

    XMLWordPrintable

Details

    • Linux/X11
    • 5
    • Foundation PM Staging

    Description

      Hi, I cross compiled Qt for the RaspberryPi (64-bit) and ran into a weird issue using serial ports. Here's the lsusb output on the Pi:

      Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
      Bus 001 Device 014: ID 2341:045f Arduino SA Nicla Vision Virtual Comm Port in HS Mode
      Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

      And then if I use the default QSerialPortInfo example on the documentation page I get this output:

      Port: "ttyACM0" 
       Location: "/dev/ttyACM0" 
       Description: "" 
       Manufacturer: "" 
       Serial number: "" 
       Vendor Identifier: "1106" 
       Product Identifier: "3483"

       Port: "ttyAMA0" 
       Location: "/dev/ttyAMA0" 
       Description: "" 
       Manufacturer: "" 
       Serial number: "" 
       Vendor Identifier: "" 
       Product Identifier: ""

       Port: "ttyS0" 
       Location: "/dev/ttyS0" 
       Description: "" 
       Manufacturer: "" 
       Serial number: "" 
       Vendor Identifier: "" 
       Product Identifier: ""

       

      /dev/ttyACM0 should have returned a product and vendor ID of 2341:045f. This happens correctly on windows/mac/linux64-bit using the pre-compiled libraries.

       

      Anyway, what's the ID 1106:3483? It turns out that's: https://pci-ids.ucw.cz/read/PC/1106/3483 - which is a USB3.0 host controller which is on the RaspberryPi 4 and upstream of the USB CDC device plugged into the PI. I can confirm visually that the chip on the Pi is the VL805. Weirdly, this device doesn't show up in lsusb. It looks like the USB2.0 interface on it does though.

       

      I think I can get around this issue by using the serial port name however which is correct to just test that the VID/PID are correct on linux in my application. It looks like I can use the sysfs interface to find the right pid/vid since they are correct there. E.g.

      $ cat /sys/class/tty/ttyACM0/device/uevent 
      DEVTYPE=usb_interface
      DRIVER=cdc_acm
      PRODUCT=2341/45f/200
      TYPE=239/2/1
      INTERFACE=2/2/1
      MODALIAS=usb:v2341p045Fd0200dcEFdsc02dp01ic02isc02ip01in00

       

      But, this should probably get fixed. Note, I have some bug reports of users running into this on desktop linux also using the standard Qt Libraries for linux: https://github.com/openmv/openmv-ide/issues/168 - so, it's not likely a cross-compile issue.

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivan.solovev Ivan Solovev
            kwabena Kwabena Agyeman
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes