Set DTR and RTS from code
-
wrote on 22 May 2020, 09:15 last edited by HvdB
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!
-
wrote on 23 May 2020, 17:47 last edited by
@Denni-0
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... -
@Denni-0
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.
1/4