tools/mpremote: Add control for rts / dts running in linux. #17532
+60
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
mpremote
is not working on my laptop running Ubuntu 24.04.2 LTS when trying to connect to anESP32-CAM
with theCAM-MB
. This board has DTR connected to RST and requires DTR to be LOW for the ESP to be running. By adding the new options--dtr [0|1|off|on]
and--rts [0|1|off|on]
you can steer the logical level of the two lines.In addition, many drivers seem to pull the signals up either when the device is closed or opened. This causes the ESP32 to perform a hard reset, which can take more than 1s. A special loop has been added if entering raw REPL mode is required.
The PR also solves #11451.
Testing
For the test I'm using the modified code since some weeks with an ESP32-CAM and MB, ESP32 NodeMCU Dev Kit C V2 and ESP8266 NodeMCU with ESP-12F module. I used it to copy files, install modules and with the REPL, or cause.
In addition, some of the tests in
tools/mpremote/tests
can be run as well, but not all. As the ESP will perform are hard reset in my case, the tests using theresume
command will not work. To run the other tests, you need to provide the environment variable MPREMOTE to point to the mpremote.py while adding the required options:Trade-offs and Alternatives
When running without providing one of the new options, the code runs as before.