Qt World Summit: Submit your Presentation

QSerialPortInfo list all available port on Linux

  • Hello,

    I have a FTDI, USB to Serial connected to my own device, I try to list all port (as I can have multiple device connected), open a communication port & send data to my device.

    I have no problem for communicating on Windows, but on Linux & Mac I can't get the informations on my serial port.

    This is the code I used to show port :

    @QStringList SerialPortChannel::availablePorts()
    QStringList ports;

    for (QSerialPortInfo port : QSerialPortInfo::availablePorts())
        //Their is some sorting to do for just list the port I want, with vendor Id & product Id
        qDebug() << port.portName() << port.vendorIdentifier() << port.productIdentifier()
                 << port.hasProductIdentifier() << port.hasVendorIdentifier() << port.isBusy();
        ports += port.portName();
    return ports;


    This is the my class constructor where I open the port :

    @SerialPortChannel::SerialPortChannel(QString port)
    : QObject()
    , m_port(port)
    online = m_port.open(QIODevice::WriteOnly);
    qDebug() << "Connected to : " << port;

    //Configure the port


    This work well on Windows, I can see my port.

    On Linux (Tested on Ubuntu 13.04 & Mint 15 Olivia ) : I can see my device with some name like : ttysUSB0, but any other informations like vendor id and product id are null. I can't open a communication, open return false. I have all informations listed on my OS, so it's a bug in my application.

    On Mac (10.8.5) , I can't even see the name and all others informations, but the device is connected to my Os as I can see him in the system info panel.

    What did I do wrong ? Is it something to configure on Linux or Mac ?

  • Qt Champions 2020

Log in to reply