harmsm / PyCmdMessenger

Python interface for CmdMessenger arduino serial communication library
MIT License
80 stars 32 forks source link

DTR status not set #42

Open ovianao opened 3 years ago

ovianao commented 3 years ago

I fail to see how the self.enable_dtr is forwarded to the Serial connection, since we no longer call self.comm.setDtr() beyond this commit https://github.com/harmsm/PyCmdMessenger/commit/02124aaeac902929cb4d58f88ba92f77098496d2.

In Windows (at least), instantiating Arduino with enable_dtr=False (which is the default) does not prevent the Arduino from resetting, as the DTR flag is still set to True on the Serial connection: https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/arduino.py#L160

This is validated by checking for self.comm.dtr after the Serial port has already been open.