Linux comes with many serial text and gui based serial communication programs. My favorite is minicom - friendly menu driven serial communication program. If you are addicted to DOS / Windows TELIX (a telecommunications program originally written for DOS and was released in 1986), minicom is for you under Linux / UNIX. May 31, 2017 I have developed a class library 'Serial.h' to use serial port (com port) on both Windows and Linux. This cross-platform 'Serial' class is written in C. A simple example for C console program using the class is demonstrated. As an another example, using it with wxWidgets for GUI application.
Active3 years, 5 months ago
I am learning Qt and I wanted to create a GUI with some buttons which sends data to boot my ARM device through serial console (instead of minicom).I know there is a serial communication library already provided by Qt.I just wanted to know if this is a realistic approach to take at U-boot level? Or will I mess my data ? Just to visualize the requirement better :
These commands can be in some text file.Though,I still have to think of the design and that's why i just wanted to know if its even possible?
Thanks in advance !!
MinionMinion
3 Answers
yes it is possible, I have done that in my project, problem is reading result from the serial port,sometime you will get some junk characters so it is difficult to decide command issued is pass or failed, and qt window freezing issue when no activity is done within time-limit. Ford ids software hack.
vkumarvkumar
To Qt4, use QextserialportFrom Qt5, use QSerialPort
Qextserialport & QSerialPort work on linux and windows with the same code.
Johann CambolyJohann Camboly
On windows, there is a part of WinAPI that can handle the serial communication and I think it can be used with Qt as any other C/C++ library.
Note that for this to work, your device has to appear as COM port in your device manager.
On linux, there is a C library called termios, but I have no experience with it so far.
mausikmausik
Linux Gui Interface
Not the answer you're looking for? Browse other questions tagged qtserial-portarmembedded-linuxu-boot or ask your own question.
Introduction
To use Python as a graphical interface for an Arduino powered robot, programmatically read the USB with the pySerial library. However, waiting for input from pySerial's Serial object is blocking, which means that it will prevent your GUI from being responsive. The process cannot update buttons or react to input because it is busy waiting for the serial to say something.
Linux Serial Communication Gui Tutorial
The first key is to use the root.after(milliseconds) method to run a non-blocking version of read in the tkinter main loop. Keep in mind that when TkInter gets to the root.mainloop() method, it is running its own while loop. It needs the things in there to run every now and then in order to make the interface respond to interactions. If you are running your own infinite loop anywhere in the code, the GUI will freeze up. Alternatively, you could write your own infinite loop, and call root.update() yourself occasionally. Both methods achieve basically the same goal of updating the GUI.
However, the real issue is making sure that reading from serial is non-blocking. Normally, the Serial.read() and Serial.readline() will hold up the whole program until it has enough information to give. For example, a Serial.readline() won't print anything until there is a whole line to return, which in some cases might be never! Even using the after() and update() methods will still not allow the UI to be updated in this case, since the function never ends. This problem can be avoided with the timeout=0 option when enitializing the Serial object, which will cause it to return nothing unless something is already waiting in the Serial object's buffer.