Solved QSerialport, cannot open pseudo terminal device port
-
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 mefalse
, 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 returnstrue
, so I could be right.update
I tried to appendqWarning() << "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 -
use tty0tty, as it is "true" virtual serial ports