serial port implementation QT4.8
-
I am running RedHat RHEL6.1. Also QtCreator2.8.1
The new PC's do not come with serial ports any more so I have a PCIex serial card in my PC.
I can talk to my serial devices via minicom through the USB ports using a USB to RS232 converter. I cannot talk to the serial devices through the third party PCIex card via minicom.Additionally my c++ code will not communicate "correctly" through the USB to RS232. It appears that commands are being received by the devices, the responses are garbled or corrupted. There must be something I'm missing in set up or control that is causing this. Any suggestions on where to look? Please don't say to upgrade to QT5.1 That is not an option in the I.T. environment that I am working in.
Thanks for any help.
-
If you say that data is corrupted most probably it will be setting the baud rate or flow control etc. Did you try to use QSerialPort library ? For Qt 4.8 it is not there. It is available as openSource. You can download, compile & use it.
-
@qt_emp said in serial port implementation QT4.8:
Please don't say to upgrade to QT5.1
No, I would not recommend that. Rather upgrade to Qt 5.9.x or the upcoming Qt 5.12, both are long term support versions. If you still need support for Qt 4.8, you will have to pay for it, as the official support has ended.
Just to add to @dheerendra: which serial port library do you use? QtSerialPort?
One thing you have to keep in mind with USB serial adapters, they are slower than real serial ports. Dot.
Especially the receiver side is buffered, so you will most likely not receive every character on it's own, but often a chunk of characters that are received in a specific timeout (e.g. 16 milliseconds).
So the only thing you can do, is to debug your program, read the specification of the external device and if you still encounter problems, think about a serial port spy hardware that allows you to capture the data that is sent over the serial line. Believe me, 95% of errors are in code, not in the hardware.
Good luck!
PS: My new mainboard for AMD Ryzen still has a serial port onboard, only the 9 pole ribbon cable and the slot connecter were missing. Otherwise it works fine in Linux. Maybe your mainboard has a hidden serial port too?