mirror of
https://github.com/meshtastic/python.git
synced 2025-12-27 01:47:50 -05:00
Some devices (e.g. Heltec V3.1) are reset when the RTS or DTR pins are messed with, which means that without workarounds, Meshtastic CLI will cause a reset with any operation that opens the serial port. This behavior is documented in this PySerial issue: https://github.com/pyserial/pyserial/issues/124 On Linux, we already handle this by disabling the HUPCL termios flag, which has the effect of preventing the offending lines being toggled. On Windows, setting the initial state of RTS and DTR before opening the port has a similar effect. Implement this workaround so that Meshtastic CLI can be used on Windows with these devices.