QSerialPort
-
Hi,
Is it expected that you read only one line ?
You should rather get everything from the serial port, accumulate in a buffer and then process the data once you have a full frame (or more). -
Hi,
Is it expected that you read only one line ?
You should rather get everything from the serial port, accumulate in a buffer and then process the data once you have a full frame (or more). -
Can you share also the thread related code ?
-
What do you expect from emitting a signal in awhile(1)loop?!
It will never get processedEdit:
Ah havent seen your comment. You only emit once when the loop has ended.Have a look at the synchronous and asynchronous
QSerialPortexamples here:@Pl45m4 Hi.
I am sorry but the code is correct on syntax, semantic and semiotic/pragmatic level. The creation of and object has to happen inside the working loop I concluded; (in run loop). I think it has to do with usb port access on low level (QSerialPort c/c++ Qt code). I think. The error is gone now.I got it from one of SGaist comments/replies.
Perhaps SGaist could give us more enlightenment why it has to be inside run loop (or custom loop like I have)? Perhaps because it is made on heap?
regards, Thomas
-
@Pl45m4 Hi.
I am sorry but the code is correct on syntax, semantic and semiotic/pragmatic level. The creation of and object has to happen inside the working loop I concluded; (in run loop). I think it has to do with usb port access on low level (QSerialPort c/c++ Qt code). I think. The error is gone now.I got it from one of SGaist comments/replies.
Perhaps SGaist could give us more enlightenment why it has to be inside run loop (or custom loop like I have)? Perhaps because it is made on heap?
regards, Thomas
-
Where is readttyUSB0 instantiated / is it moved to a thread somewhere? If yes then you forgot to move sPort (btw: very strange name for a member var) as it has no parent.
-
Where is readttyUSB0 instantiated / is it moved to a thread somewhere? If yes then you forgot to move sPort (btw: very strange name for a member var) as it has no parent.
@Christian-Ehrlicher Hi. Sorry for my late reply. Well it is in mainwindow constructor. This is in constructor.
rttyUSB0->moveToThread(threadttyUSB0); connect(threadttyUSB0,SIGNAL(started()),rttyUSB0,SLOT(doWork())); connect(rttyUSB0,SIGNAL(usb0Data(QString)),this,SLOT(readSerialCom(QString))); threadttyUSB0->start();```Declared in .h file in private part.
What I do in readSerialCom(QString) is not important.
I let this loop to run for a week with no problem. No compile error. Should be ok.
Thomas
-
@SGaist Hi. SGaist. One question. What is the best way (board?) to boot Linux into Qt graphic App (I need access to /dev- USB) in max 2 to 3 seconds? But to be on open source non commercial side. I tried raspberry Pi and eglfs but it needs 10 seconds. regards Thomas
-
@SGaist Hi. SGaist. One question. What is the best way (board?) to boot Linux into Qt graphic App (I need access to /dev- USB) in max 2 to 3 seconds? But to be on open source non commercial side. I tried raspberry Pi and eglfs but it needs 10 seconds. regards Thomas
@Tomaz if you are using yocto, you can disable certain services at start or change the boot order by prioritising your app
-
@SGaist Hi. SGaist. One question. What is the best way (board?) to boot Linux into Qt graphic App (I need access to /dev- USB) in max 2 to 3 seconds? But to be on open source non commercial side. I tried raspberry Pi and eglfs but it needs 10 seconds. regards Thomas