Solved Set DTR and RTS from code
Hi there, I am new to Qt5 programming, but do have some Python 3 programming experience. I used to do quite a bit of programming in Delphi, but I now want to switch to Python.
The issue at hand is the behaviour of the DTR and RTS outputs, which seems to differ in the Delphi and even the pyserial implementation. I use the two signal lines together as power supply to power a small PIC microcontroller interface and as said before programs using Delphi, or pyserial work straight away, but all the coding samples using QtSerialPort fail to run. I have tried many variants (dataTerminalReady=False, and/or setDataTerminalReady(True) both in False and True) but none work... I have read quite a bit about issues with the DTR/RTS behaviour in QtSerialPort and wonder whether it might be better to resort to using pyserial?
OS is Windows 10 64 bit and the serial interface is based on the FTDI USB chip. Qt version is 5.14 and Python version is the 3.7.7. 64 bit version.
Can anybody provide some guidance on this topic? Many thanks!
Hi Denni, thank you for answering my primary question, whether to consider pyserial rather than QtSerialPort. QtSerialPort just seemed to be a neat solution for the serial connectivity, but I will now look at using pyserial and am hopeful that will work as expected. I also checked out the MVC methodology which indeed is an interesting concept, but I think a bit of overkill for my home project.
I will just keep the topic alive still for some time, just in case somebody has a solution...
@HvdB Qt is not only GUI. Qt has more: networking, serial port, SQL, ...
So, I don't see how using QSerialPort will break MVC...
Either you use QSerialPort or serial.tools from Python is a detail and your preference.
@Denni-0 Denni thank you for your further explanations and offer to assist, but I prefer to try myself first. If I get stuck I will gladly get back to you!