qt5.13.1/5.12.5's Qserialport trouble
-
I am a friend of Qt China group.I used qt5.13.1 to receive and send serial port data, but I could not respond.Two computers have been changed. The hardware serial port and software serial port have been tested, but they cannot receive and send.But once in a while you open the serial port for the first time and then you can never send it again.I have tested qt5.13.0, qt5.12.2 and previous versions and it is ok.Except qt5.13.1.If a friend has a similar situation, follow up, looking forward to god's answer.
-
-
FYI:
A probably related bug I ran into myself
https://bugreports.qt.io/browse/QTBUG-78011 -
FYI:
A probably related bug I ran into myself
https://bugreports.qt.io/browse/QTBUG-78011I guess that is a result of QTBUG-78086...
-
Hi @761153454,
as you can read in the linked bugreport, it will be fixed in 5.12.6 and 5.13.2.
It's just a matter of time when these packages are released officially.
Regards
-
Hi, with qtserialport project from github (https://github.com/qt/qtserialport), I checkout to 5.12.8, the readyread signal is emitted normal, but bytesAvailable is still 0 even when readAll() returns non-zone bytesarray, is it still a bug?
-
@BriFuture said in qt5.13.1/5.12.5's Qserialport trouble:
is it still a bug?
Please use the library provided with your Qt installation and check again.
-
@Christian-Ehrlicher
The original .dll files for serialport doesnot work, The serialport instance can not emitreadyRead
singal, shall I reinstall Qt ? -
@BriFuture said in qt5.13.1/5.12.5's Qserialport trouble:
The serialport instance can not emit readyRead singal, shall I reinstall Qt ?
No, show some code and tell use what exact Qt version you're using.
-
@Christian-Ehrlicher
Qt: 5.12.5
MSVC 2017 WIN64
CMake Build Systemjust connect ready read signal with lambda as following:
connect(pri->serialPort, &QSerialPort::readyRead, [=] { qDebug() << pri->serialPort->bytesAvailable() << pri->serialPort->readAll(); });
with original qserialport.dll file, nothing happened, but if I replace the file with other versions build from qserialport project will get following output:
[16:38:04.833 D] 0 "$PT" [16:38:04.863 D] 0 ",14128.4,-1114.9,-35508.1,0.933,-0.968,9.591,0.014,0.017,0.007,27*7f\r\n" [16:38:05.843 D] 0 "$PTR,14131.6,-1111.6,-35504.9,0.9" [16:38:05.853 D] 0 "24,-0.968,9.59,0.015,0.018,0.007,27*42\r\n"
-
Now I change the code as two lines,
connect(pri->serialPort, &QSerialPort::readyRead, [=] { qDebug() << pri->serialPort->bytesAvailable(); qDebug() << pri->serialPort->readAll(); });
and the result is correct now.
So upgrade the Qt5SerialPort.dll to version 5.12.8 works fine for me. -
@BriFuture said in qt5.13.1/5.12.5's Qserialport trouble:
So upgrade the Qt5SerialPort.dll to version 5.12.8 works fine for me.
When you read the complete thread you would have seen that this was an issue with 5.12.5 and was fixed in 5.12.6 / 5.13.2
-
yeah, that's the reason I'd like to take a try to upgrade the serialport module,
but I'm not pretty sure that the bug is fixed as I see unsolved tag at first,and the one line code which returned wrong results really confused me.
by the way, it would be better if this thread was marked solved.
-
@BriFuture said in qt5.13.1/5.12.5's Qserialport trouble:
yeah, that's the reason I'd like to take a try to upgrade the serialport module,
Why not simply updating the whole Qt instead fiddling around with a single module?