Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement handshake on serial communication for ESP devices #2433

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paulvanharen
Copy link

@paulvanharen paulvanharen commented Jul 18, 2023

I ran a classroom using Mu and many ESP devices. In the classroom were about 40 students with different laptops. Running code was troublesome. The behavior when using the RUN button was flaky, and dependent on the precise laptop. Hitting RUN and RUN again gave different results.

What happens is the following:

  • On RUN, the first thing to do is to reset the device
  • The time for reset is dependent on the start-up script and default program
  • In some occasions, the program download starts before the start-up script is completed

Inspired by the mpremote tool I implemented a handshake on the serial port for the RUN command.

This works fine in my environment; it provides a robust solution. Please note, the testing has been limited.
Glancing through the issues mentioned here at Github, the following issues appear to be similar and may be affected (solved?): #2397, #2319, #1996 and #1433. Unfortunately, I have no means to verify the last claim.

The RUN button will reboot the attached device. Depending on the speed
of the device, the speed of the connected computer, the USB tree and
the contents of the boot scripts, this make take some time.
Instead od just sending the script to run after some time, we now first
wait for the python prompt to appear. This brings a robust RUN behavior.
@paulvanharen paulvanharen changed the title Serial communication on ESP needs handshake Implement handshake on serial communication for ESP devices Dec 11, 2023
@satmandu
Copy link

@ntoll Do you know who needs to be pinged to get some of these PRs reviewed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants