Hello,
When I open a serial connection with pyserial, it seems that the pyserial library sends a DTR signal (even if I have dsrdtr=False).
Why is that?
ser = serial.Serial(com_port, 115200, timeout=5, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, xonxoff=False, rtscts=False, writeTimeout=None, dsrdtr=False, interCharTimeout=None);
ser.write("hello world\n");
If I do the same program in C, this does not happen.
That's a problem in my case, because I use the DTR signal for a special purpose.
How can avoid that pyserial sends a DTR signal?
Regards,
David
Its typical for terminal applications to set DTR to "active" when the port is opened. "dsrdtr" only controls if hardware flow control is used, not if the control line is used.
wehn no hardware fow control is configured, you can use ser.setDTR(False) to change the state of the line back.
Thanks for the quick reply.
> you can use ser.setDTR(False) to change the state of the line back.
That's too late for my case. (my device interprets the DTR "active" as the request to make a reset of my device).
Is it possible to open the serial, and avoid setting DTR to "active"?
I can modify your library for this, but maybe having this option in the official library is useful for other people?
Regards,
David
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
I would like to open this again: i'm doing some developing on the very popular Arduino-platform and it uses DTR to reset the microprocessor so that it can be programmed from a USB-serial port. The problem is now that each time I establish a serial connection to read some values from the Arduino the device is reset! Given the popularity of the platform I think it would be a good idea to have a way to avoid touching DTR on init!