본문 바로가기

카테고리 없음

Qt Serial Port Baud Rates

Qt serial port custom baud rate
  1. Common Serial Port Baud Rates
  2. Qt Serial Port Baud Rate

Hey, I want to add the '691200' and '921600' baud rate to the Qextserialport baud rates list. QextSerialPort add new BaudRate QextSerialPort add new BaudRate. This topic has been deleted. Looks like your connection to Qt Forum was lost, please wait while we try to reconnect. + * You should have received a copy of the GNU Lesser General Public. I've been using QtSerialPort, works fine on baudrates 9600 up. I'm trying to use it on 2400 baudrate with evenparity, one stop bit and 7 data bits. But when i use it like this, the parity is out.

Active3 years, 1 month ago

I'm attempting to set a custom baud rate of 10400 to my device on Linux using Qt. However, when I run the application, the console output keeps reporting that

Baud rate of serial port /dev/ttyUSB0 is set to 10403 instead of 10400: divisor 2307.692383 unsupported

I've also set the data bits to 8, parity to no parity, and stop bits to 1, which are pretty standard.

Here's my code by the way:

When I run the application on Windows however, it works totally fine.

My device isn't able to connect with any other baud rate other than 10400. The application is able to compile and run, however the result is all garbage. I want to know if there's a way where I can specify this baud rate without any problems?

hyde
33.7k15 gold badges95 silver badges139 bronze badges
xcyl40xcyl40

2 Answers

Relevant bug report here. Basically it means, that the exact baud rate is not available, because the actual thing configured to hardware is an integer divisor of some clock frequency, and there is no exact integer divisor for the requested baud rate. The warning message is pretty descriptive about this.

It shouldn't matter, baud rates have some tolerance, but if it does cause problems (discussion under bug suggests it may...), upgrading to Qt 5.6 is suggested in the bug report.

Common Serial Port Baud Rates

hydehyde
33.7k15 gold badges95 silver badges139 bronze badges

That's a warning; it means you should fix the code, but the code still happens to work. What you're trying to do is not supported by the hardware you run on. Windows is only quieter about this, it doesn't support it either.

Kuba OberKuba Ober
73.7k10 gold badges91 silver badges211 bronze badges

Qt Serial Port Baud Rate

Not the answer you're looking for? Browse other questions tagged linuxqtserial-portbitrate or ask your own question.