QSerialPort
-
bq. I use ttyS0 that linked to rfcomm0.
How do you create this link? why you do not use rfcomm0 directly?
Also, please try to build QtSerialPort from latest sources and try to debug it.
It is interest that "Resource temporarily unavailable" belongs to EAGAIN native error code.
Can you check, what of syscall return this error? ::write() or ::read() or something?
-
I can use rfcomm0 directly but it not change the result.
What do you mean from "latest sources", I just use demo example from latest version of QT.
no ::write() or ::read() not gives any errors . I use only QByteArray data = serial->readAll();
I try run GtkTerm that connects to ttyS0 and everything working fine.
If I do the same from demo example then after receiving data around 5 sec. error msg appears.
I can also use cat /dev/rfcomm0 and no problems. -
bq. What do you mean from “latest sources”
Please see "WIKI":https://qt-project.org/wiki/QtSerialPort how to manually to build and install latest sources of QtSerialPort from Git.
bq. I use only QByteArray data = serial->readAll();
In this case, I suspect that this error go out from the system read() call or, maybe from QSocketNotifier... Need to do debugging. Only you yourself can do it.
PS: It is better, please add this issue to Qt bug-tracker.. With a complete description as to reproduce it and so forth.
-
UPD: Seems, I suspect where is a problem.. I try to create a patch for this. Please, wait.
-
It will be very nice if you have any ideas about this problem.
-
Please try this patch: https://codereview.qt-project.org/#change,85414
Just try to change content in lines 772-775 and 895 and try to rebuild and check this error again. Because I can not able to reproduce this error on my side.
-
thank you I'll try it tomorrow when I'll back to my job. Hope it will works.
-
Hi tried to get to the code for Serial Port but it very complicated. Have to do a lot of registration and because I started with Linux just last month it will take more time that I have. Project have to be ready yesterday so I'm in trouble. If it possible can I found the famous SerialPort source code on the other way. You put changed *.cpp file but without all others file I can't do much with it.
-
- download and install Git
- enter command to download sources:
@git clone git://gitorious.org/qt/qtserialport.git@ - enter command to change directory:
@cd qtserialport@ - enter command to fetch a patch:
@git fetch https://codereview.qt-project.org/p/qt/qtserialport refs/changes/14/85414/2 && git checkout FETCH_HEAD@ - Run QtCreator and open
@qtserialport/qtserialport.pro@
file in root directory - From the QtCreator, select your Kit with your desired Qt version (5.2) and re-build library
- Open the console and go-to to the "shadow" build directory of the QtCreator
- enter command:
@sudo make install@ - re-run your application and check again
-
Thank you, I'll try right now.
-
had some problem with git but now is OK
-
Now project opens but I have message:
@Executable /home/***/Documents/qtserialport/build-qtserialport-Desktop_Qt_5_2_1_GCC_64bit-Debug/examples/serialport/blockingmaster/blockingmaster does not exist.@
I have correct Kit information. "Shadow" build directory I spouse is "//build-qtserialport-Desktop_Qt_5_2_1_GCC_64bit-Debug" ? -
bq. “Shadow” build directory I spouse is “//build-qtserialport-Desktop_Qt_5_2_1_GCC_64bit-Debug” ?
Yes. Now you should to run "sudo make install" to install QtSerialPort into your Qt 5.2 place (you can check it, see new qserialport*.so in your Qt 5.2 directory).
bq. Now project opens but I have message:
By default, the "make" command build only the library, without the examples.
To build examples you should to enter "make all", or, is more simple - try to open blockingmaster.pro file from QtCreator and re-build an example and to run. :)
-
Thank you. I tried "Terminal" from examples and it not gives error messages but just stop to receive data. Nothing like this happens if I read data from Linux terminal.
-
Thank you for all your time. I really appreciate that. But it seams that QSerialPort have problems. I switched to QBluetooth and now I receive all data as it have to be.
Best regards. -
Can you please repeat again but with the new :
@git fetch https://codereview.qt-project.org/p/qt/qtserialport refs/changes/14/85414/3 && git checkout FETCH_HEAD@
command?
-
***** ~/Documents/qtserialport $ git clone git://gitorious.org/qt/qtserialport.git
Cloning into 'qtserialport'...
remote: Counting objects: 5574, done.
remote: Compressing objects: 100% (2815/2815), done.
remote: Total 5574 (delta 3819), reused 3756 (delta 2719)
Receiving objects: 100% (5574/5574), 1.46 MiB | 840 KiB/s, done.
Resolving deltas: 100% (3819/3819), done.***** ~/Documents $ cd qtserialport
***** ~/Documents/qtserialport $ git fetch https://codereview.qt-project.org/p/qt/qtserialport refs/changes/14/85414/3 && git checkout FETCH_HEAD
fatal: Not a git repository (or any of the parent directories): .git -
Need to do change directory from "~/Documents/qtserialport"
~/Documents/qtserialport $ cd qtserialport
because you do pull into ~/Documents/qtserialport but not into ~/Documents
please try again :)
-
hi again.
Now I tried the new one you sent me. But unfortunately I have the same result. No error messaged but data stops after a few seconds. -
Ok. Many thanks for your time. Seems that the solution of this problem should be postponed until I won't get an Bluetooth dongle and so on.