Questions tagged [qtserialport]

The QtSerialPort module provides classes to make serial port programming easier and portable.

It is available starting with Qt 5.1. Documentation can be found here.

Two classes are included:

The main class is QSerialPort that provides functions to access serial ports.

You can get information about the available serial ports using the QSerialPortInfo helper class, which allows an enumeration of all the serial ports in the system.

148 questions
14
votes
3 answers

Qt and serial port programming

Is there any serial port facilities in Qt ? If not, which crossplatform (desirable) libraries (for working with serial port and, maybe, with other I/O ports), do you recommend ?
cybevnm
  • 2,586
  • 4
  • 30
  • 33
11
votes
2 answers

QtSerialPort instantiating in wrong thread, causing signals/slots to fail

I'm using the QtSerialPort library to talk to a virtual COM port via USB. The COM port returns data and works properly when testing it with the example projects given with QtSerialPort, but fails when I run it as part of my project. I inspected the…
Mike Trpcic
  • 25,305
  • 8
  • 78
  • 114
8
votes
1 answer

QSerialPort readLine() extremely slow compared to readAll()

The data I'm reading from a serialport (in Qt, using QtSerialPort/QSerialPort) is separated by the newline '\n' and return '\r' characters, which is the way I intend to look at it for parsing. The line length may very, but it is very easy to extract…
Rachael
  • 1,965
  • 4
  • 29
  • 55
7
votes
2 answers

Qt Serial Port - Reading data consistently

I am sending (writing) bytes to a device via my serial port. I am using the QSerialPort (http://qt-project.org/wiki/QtSerialPort) module to instantiate device IO support. When I send messages to my INSTEON modem (serial), upon reading my message the…
Alex Hendren
  • 446
  • 1
  • 5
  • 18
6
votes
1 answer

How to setup QSerialPort on a separate thread?

Following the official documentation I'm trying to do this: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { QThread *thread = new QThread; Worker *worker= new Worker(); worker->moveToThread(thread); //init…
anat0lius
  • 2,145
  • 6
  • 33
  • 60
6
votes
1 answer

Driver CH341 USB Adapter Serial Port or QSerialPort not Works in Linux

The following code works for me correctly in Windows, but Linux does not work. I am using the same PC, both operating systems are installed native. I do not use virtual machine. I need to work on Linux. I have tried in different linux distributions…
Kijam
  • 189
  • 1
  • 1
  • 11
6
votes
1 answer

Qt 3rd Party Library Static Linking (QtSerialPort)

Turns out static linking was working, but only for Qt libraries. My 3rd party library QtSerialPort is not linking statically. After some reasearch, I've found that I either have to build this library statically or I have to link directly to a .pri…
awpitt13
  • 155
  • 9
5
votes
1 answer

QSerialPort effect on `/dev/ttyS*` after process end?

When a Qt app using QSerialPort experiences a non-clean shutdown (e.g. due to receiving and not handling SIGINT), how is the file descriptor of the serial port affected? After running an app that opens a QSerialPort on /dev/ttyS0, then quitting with…
Kyle Strand
  • 15,941
  • 8
  • 72
  • 167
5
votes
3 answers

Send a signal when a USB serial cable is unplugged

Is there a way to send a signal, or any other way to tell if a USB serial cable is unplugged, using Qt?
Jared Price
  • 5,217
  • 7
  • 44
  • 74
5
votes
3 answers

QtSerialPort QSerialPort no such file or directory

I use this tutorial : http://doc-snapshot.qt-project.org/qt5-stable/qtserialport/blockingmaster.html But when I want to run it Qt Creator generates the following error: error: Unknown module(s) in QT: serialport When I hold mouse on #include…
Mahdi_Nine
  • 14,205
  • 26
  • 82
  • 117
4
votes
1 answer

QT Serial Port Reading

I am trying to read the data sent by a device plug via usb. First i read the data via this command sudo stty -F /dev/ttyUSB0 1200 sane parenb evenp cs7 -crtscts cat /dev/ttyUSB0 And the data are like this TGPHI_s -0,24 = MESURES2 BT 4 SUP36…
tlebreton
  • 43
  • 1
  • 1
  • 5
4
votes
3 answers

how does readyRead() work in Qt?

It's my first question on this website ! I have some trouble reading datas from a COM port, I send a complete message from another COM port, and when I receive it with Qt, it's always cut in multiple submessages. void SerialPortReader::init() { …
palador
  • 273
  • 2
  • 3
  • 11
4
votes
2 answers

QSerialPort is causing a program stop (endless loop?) if opening device

I want to write on a serial device. Unfortunately I have the feeling the QSerialPort is not properly implemented under linux. In contrast to other methods (python) I get !sometimes! a hang of the program when I try to…
dgrat
  • 2,214
  • 4
  • 24
  • 46
4
votes
3 answers

Communication Arduino-C++ do not read Arduino

I have the following code: QSerialPort…
Elseine
  • 741
  • 2
  • 11
  • 23
4
votes
2 answers

Qt Serial Port communication

I am writing a Qt application to communicate with another computer over a serial port. I have 2 real issues. 1. I can send and receive data fine, but sometimes the serial port "eats" part of my input. For example if I send: cd…
Muricula
  • 1,174
  • 3
  • 9
  • 16
1
2 3
9 10