1. PyPA
  2. Python Packaging Authority Projects
  3. pypi
  4. Issues


Issue #51 invalid

setRTS appears to do nothing

Roger Garrett
created an issue

I have a USB/tty/RF device that allows for serial communications over an RF channel. I have it working when I use my program written in C# and running on a PC. But using python and pySerial, it doesn't work. Although a call to the write() method does indeed return the correct number of bytes that should have been written, the correpsonding read() method (connected to a separate USB/tty/RF device, never receives the data.

I detected the status of the RTS line on both the outgoing and incoming devices while running my C# program (which uses Microsoft's serial class) and they both show 3.3 volts. But when running the python program, using the pySerial class, the RTS line always shows 0 volts. This leads me to believe that the status of the RTS line is the difference between my C# program (using Microsot serial class) and my python program (using pySerial), and that RTS line difference is what's causing the devices to not operate properly.

I tried including the "rtscts = 1" parameter in the call to serial.Serial() and also tried the MySerialDevice.setRTS(1) method. Neither of those resulted in the RTS line actually getting set to 1, i.e. showing a 3.3 voltage on the physical line.

HOW do I get the RTS line on the device to actually get set to logical True (ie. to 3.3 volts)?

Comments (5)

  1. Roger Garrett reporter


    Looking through the specs for the RF board portion of the USB/tty/RF device I found the description of the EN (enable) pin. The RTS pin from the tty board connects directly to the EN pin of the RF board. Normally the RTS pin is at 3.3 volts, thereby enabling the EN pin on the RF board, which enables the RF board for operation. But when running a python program on a Raspberry Pi and using the pySerial class, that RTS pin is never enabled (no matter how much you might try to pass 'rtscts=1' to the instantiation method of the class or later calling the setRTS() method on the object.

    BUT! The specs for the RF board indicate that the board is ALWAYS in enable mode IF the EN pin is UN-connected! So I disconnected the RTS line from the EN pin, and now it works!!!

    It's frustrating that the pySerial class doesn't handle the RTS line properly, but at least I ow have a functioning RF link. :)

  2. Roger Garrett reporter

    Status changed to invalid? It's not invalid. It's a definite problem and I found a definite resolution of it. If someone else comes across this it's much better to have a posted solution than for them to have to go through the same hassle that I did to finally discover the solution.

  3. Log in to comment