-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
The latest webflasher code does have lots and lots of fixes regarding keeping the connection active, flash speed, etc.
However there have been some changes which makes other features of the webflasher unusable since the ESP is put into flash mode immediately.
Some logic changes are needed in the webflasher code, which probably also require some changes in ESPEasy.
Related repos which need to be forked:
Logic changes needed:
Different modes, like "flashing firmware" and "maintainance mode".
The first one needs the ESP to be put into flash mode, the second one should not.
This does sound easy, but it actually isn't, as in Windows the USB device is gone while the device reboots into a different mode.
So the browser needs to reconnect and this reconnect often fails and/or causes a WDT reboot on the ESP.
This means there needs to be some way to detect which mode is active, which differs per ESP-type. And we do have a lot of them lately:
- ESP32-S2 (most problematic one as it is using TinyUSB)
- ESP32-S3
- ESP32-C3
- ESP32-C5
- ESP32-C6
- ESP32-C61
- ESP32-P4
Each of these act differently, so this involves a lot of testing.
Complicating factor is that the webflasher tries to send IMPROV calls, which seem to affect the reliability of connecting to the ESP a lot.
So when connecting to the ESP to flash, these should be suppressed and maybe in ESPEasy there should be some mechanism to act differently to IMPROV commands in some specific use cases. (or ignore them)
Another really complicating factor is that there is no simple way out of "bootloader mode", according to @Jason2866
The behavior differs per ESP-variant and also on some devices whether it was put into "bootloader mode" via the JTAG interface or via the "boot" button.
For some devices the user may need to power cycle the device to get out of "bootloader mode".
Ideas:
Check the output of the ESP device to see if there is a string indicating "waiting for download" (literal string may differ per ESP model) and then sync the internal known state.
If we want to query IMPROV calls, setup WiFi or use the console, we need to (somehow) manage to bring device out of boot mode in firmware mode.