-
Notifications
You must be signed in to change notification settings - Fork 108
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
It takes 3-5 minutes to decide that a connection cannot be established #86
Comments
espressif/esptool@2d72f56#diff-b035aa3701bf24cdb68151b147c0cfe693bbb1b27812a779f13d4255bdff1fc7L597 Agree that some delays here are probably excessive, we can speed this up. |
If esptool has removed it, can we remove it too? Or maybe we can guard it for Windows users only based on the user agent string ? |
@balloob, @igrr, and @brianignacio5, could you please provide any updates regarding this particular issue? |
Do we still have these issues ? @RushikeshPatange @balloob ? |
@brianignacio5, I have used esptool-js (example) with following dev-kits:
I encountered this issue while working with the
|
Could you try my fork in https://brianignacio5.github.io/esptool-js/ which implement #160 changes ? |
ESPLoader is initialized by calling
main_fn
. This function callsdetect_chip
, which in turn callsconnect
which triggers the connection sequence.If a device requires the BOOT mode to be held down to start flashing, the connection will fail. Currently it takes 4-5 minutes on my machine before it raises the error
Failed to connect with the device
. This seems too long.The default attempts number for
connect
is set to 7. This means that 7 times it tries the following:connect_attempt
withesp32r0_delay
set tofalse
connect_attempt
withesp32r0_delay
set totrue
main_fn
allows passing in amode
that is passed down toconnect_attempt
. It is defined as typestring
, it defaults todefault_reset
. It can be set tono_reset
to skip resetting the device insideconnect_attempt
. The resetting takes quite some time, with hardcoded sleeps. Ifesp32r0_delay
is true, there is a call to sleep 2 seconds!Because our connection runs
connect_attempt
twice for each attempt, we are trying to attempt to connect 14 times. That's already twice as many as the Python tool does by default.Below a screenshot of the console logs. This is not a full single attempt (out of 7), as it cuts off the 2nd call to
connect_attempt
withesp32r0_delay
set totrue
. The screenshot already spans 26 seconds. It has another 6 full attempts to go!Looking at
esptool
, it also resets between every attempt, but it uses different reset strategies that leverage different delays https://github.com/espressif/esptool/blob/master/esptool/loader.py#L567. The strategies are defined at https://github.com/espressif/esptool/blob/master/esptool/reset.py#L61. By default the sleep delay between RTS setting is0.05
and0.55
for a 2nd reset attempt. There are also calls to 0.1 and 0.2s sleeps. There definitely is never a 2s sleep 👀 Also there is no reference to whatesp32r0_delay
is, it's not in the Python tool.Summary:
esp32r0_delay
?The text was updated successfully, but these errors were encountered: