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. QSerialport, cannot open pseudo terminal device port
Qt 6.11 is out! See what's new in the release blog

QSerialport, cannot open pseudo terminal device port

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 1.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.
  • C Offline
    C Offline
    Cat_
    wrote on last edited by Cat_
    #1

    Hi there! I am playing with QtSerialport on Fedora 26, and since I don't have a real device to try,
    I created two serial ports using nullmodem then to simulate a communication I used minicom on one side, and screen on the other.
    So the connection has been setted up between /dev/pts/4 and /dev/pts/5 aka /tmp/loop0 and /tmp/loop1. I am trying to open a port with the following code, but the bool control variable I putted there, returns me false, so it looks like the Qt program is not able to open such device.

    QSerialPort port("/dev/pts/4");
    bool isOpened = port.open(QIODevice::ReadOnly);
    qWarning() << isOpened;
    

    Could the problem be that I have already an opened connection active between /dev/pts/4 and /dev/pts/5? I tried with /dev/pts/3 and it returns true, so I could be right.

    update
    I tried to append

    qWarning() << "available ports: " << QSerialPortInfo::availablePorts().size();
    

    But it returns available ports: 0

    UPDATE 2
    pts are not serial ports. Source: https://stackoverflow.com/questions/32572400/qt-and-virtual-serial-ports

    1 Reply Last reply
    1
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

      use tty0tty, as it is "true" virtual serial ports

      1 Reply Last reply
      1

      • Login

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