qtserialport

how to let serial work well background and also foreground?

只谈情不闲聊 提交于 2021-02-19 08:13:05
问题 i have a serial app, The Robot class need to always receive serial message and then to do some thing, the Demo gui need to interactive Robot and get Robot.handle_readData , if no data get, need to get again and again until had data. Now i had no idea how to solve this problem, need someone give me good idea. from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtSerialPort import * class Robot(QObject): def __init__(self): super().__init__() self

How to append serial data on textbrowser pyqt5 receiving from serial port python pyqt [duplicate]

送分小仙女□ 提交于 2021-02-08 11:35:07
问题 This question already has answers here : Connect to serial from a PyQt GUI (2 answers) Closed 18 days ago . My goal is to create a GUI using PyQt5 with functionality to receive data from serial port. This data should be printed into text browser inside the GUI. Data should be printed there continuously. Reading should be toggled by pushing button. This is the GUI part of the code: class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow

How to append serial data on textbrowser pyqt5 receiving from serial port python pyqt [duplicate]

爱⌒轻易说出口 提交于 2021-02-08 11:34:40
问题 This question already has answers here : Connect to serial from a PyQt GUI (2 answers) Closed 18 days ago . My goal is to create a GUI using PyQt5 with functionality to receive data from serial port. This data should be printed into text browser inside the GUI. Data should be printed there continuously. Reading should be toggled by pushing button. This is the GUI part of the code: class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow

doesn't update serial data using button click

浪尽此生 提交于 2020-01-30 09:01:06
问题 I have a problem with the gui data, my gui doesn't update a real-time value when I click the button. the first time i click my connect button it shows the correct value, but when i change the sensor position, it doesn't update the value. Where i miss the code, i try to solve the problem from the other similar question to this question, but still does not solve my problem here is my code class SerialReadThread(QThread): received_data = pyqtSignal(QByteArray, name="receivedData") def __init__

How to know when QSerialPort is ready for more data in Qt5?

。_饼干妹妹 提交于 2020-01-06 23:51:00
问题 Is there some way to be notified when my serial device is ready to receive more data? I am implementing a program that feeds commands to a servo controller over serial using the asynchronous API of QSerialPort. The program works, but it seems that I am experiencing congestion. In my application I keep a registry of most updated servo position that I wish to synchronize with the controller with as low latency as possible. My attempt at pushing new data to the serial port as quickly as time

Qt and serial port programming [closed]

风流意气都作罢 提交于 2019-12-31 10:40:11
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Is there any serial port facilities in Qt ? If not, which crossplatform (desirable) libraries (for working with serial port and, maybe

extrange behavior of serial port using Qt

落花浮王杯 提交于 2019-12-25 02:58:06
问题 I am performing an app with QT for communicate my PC with an 8 bits microcontroller through rs-232. I am using the QtSerialPort library and the communication is working fine, but each time I write something from the PC to the micro and I receive the response, I have to close and open the serial port or I can't continue communicating.. My configuration is: 10500 bps, 8 bits, 1 stop, no parity, no flow control. The code used for the configuration and the lecture/writting of the port is the next

Communication Arduino-C++ do not read Arduino

╄→尐↘猪︶ㄣ 提交于 2019-12-19 03:56:41
问题 I have the following code: QSerialPort arduPort("COM5"); arduPort.setBaudRate(QSerialPort::Baud9600); arduPort.setDataBits(QSerialPort::Data8); arduPort.setParity(QSerialPort::NoParity); arduPort.setStopBits(QSerialPort::OneStop); arduPort.setFlowControl(QSerialPort::NoFlowControl); arduPort.open(QSerialPort::ReadWrite); cout<<arduPort.isReadable()<<endl; cout<<arduPort.isWritable()<<endl; arduPort.write("a"); QByteArray s=arduPort.readAll(); cout<<QString(s).toStdString()<<endl; And the next

Communication Arduino-C++ do not read Arduino

一曲冷凌霜 提交于 2019-12-19 03:56:06
问题 I have the following code: QSerialPort arduPort("COM5"); arduPort.setBaudRate(QSerialPort::Baud9600); arduPort.setDataBits(QSerialPort::Data8); arduPort.setParity(QSerialPort::NoParity); arduPort.setStopBits(QSerialPort::OneStop); arduPort.setFlowControl(QSerialPort::NoFlowControl); arduPort.open(QSerialPort::ReadWrite); cout<<arduPort.isReadable()<<endl; cout<<arduPort.isWritable()<<endl; arduPort.write("a"); QByteArray s=arduPort.readAll(); cout<<QString(s).toStdString()<<endl; And the next

How to setup QSerialPort on a separate thread?

我们两清 提交于 2019-12-18 13:34:18
问题 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 connections thread->start(); } Worker constructor: Worker::Worker(QObject *parent) : QObject(parent) { serial = new QSerialPort(this); //passing the parent, which should be the current thread } No compiling errors but when I execute it throws me this: QObject: Cannot create