esphome / esp-web-tools

Open source tools to allow working with ESP devices in the browser
https://esphome.github.io/esp-web-tools/
Apache License 2.0
427 stars 118 forks source link

Upload fails with ESP32-S2 native USB #375

Open jonasniesner opened 1 year ago

jonasniesner commented 1 year ago

When trying to use esp-web.tools to upload to an esp32-s2 with its onboard usb, the upload fails.

On Windows (Chrome or Edge), I get the following error

ESP Web Tools 9.2.1 by Nabu Casa; https://esphome.github.io/esp-web-tools/ install-dialog-2aee1312.js:424 esptool.js install-dialog-2aee1312.js:424 Serial port WebSerial VendorID 0x303a ProductID 0x2 install-dialog-2aee1312.js:424 Connecting... install-dialog-2aee1312.js:424 . install-dialog-2aee1312.js:424 Detecting chip type... install-dialog-2aee1312.js:424 ESP32-S2 install-dialog-2aee1312.js:424 Chip is ESP32-S2FH32 install-dialog-2aee1312.js:424 Features: Wi-Fi,Embedded 4MB Flash install-dialog-2aee1312.js:424 Crystal is 40MHz install-dialog-2aee1312.js:424 MAC: 48:27:e2:57:7c:10 install-dialog-2aee1312.js:424 Uploading stub... install-dialog-2aee1312.js:724 Error: Timeout at ia.read (install-dialog-2aee1312.js:424:72641) at async ta.command (install-dialog-2aee1312.js:424:55233) at async ta.check_command (install-dialog-2aee1312.js:424:58833) at async ta.mem_block (install-dialog-2aee1312.js:424:59483) at async ta.run_stub (install-dialog-2aee1312.js:424:65415) at async ta.main_fn (install-dialog-2aee1312.js:424:66917) at async install-dialog-2aee1312.js:724:2934 (anonymous) @ install-dialog-2aee1312.js:724 await in (anonymous) (async) _confirmInstall @ install-dialog-2aee1312.js:724 await in _confirmInstall (async) handleEvent @ styles-e96248a3.js:1 install.openepaperlink.de/:1 Uncaught (in promise) DOMException: Failed to execute 'open' on 'SerialPort': Failed to open serial port.

And in 1 out of 10 times, the upload works, but only if i hold the GPIO 0 button. Uploading to ESP32 or Esp32-S3 works with no problems.

On Linux, I get this error:

ESP Web Tools 9.2.1 by Nabu Casa; https://esphome.github.io/esp-web-tools/ install-dialog-2aee1312.js:424 esptool.js install-dialog-2aee1312.js:424 Serial port WebSerial VendorID 0x303a ProductID 0x2 install-dialog-2aee1312.js:424 Connecting... install-dialog-2aee1312.js:424 . install-dialog-2aee1312.js:424 . install-dialog-2aee1312.js:424 . install-dialog-2aee1312.js:424 . install-dialog-2aee1312.js:424 . install-dialog-2aee1312.js:424

install-dialog-2aee1312.js:424 Detecting chip type... install-dialog-2aee1312.js:424 ESP32-S2 install-dialog-2aee1312.js:424 Chip is ESP32-S2FH32 install-dialog-2aee1312.js:424 Features: Wi-Fi,Embedded 4MB Flash install-dialog-2aee1312.js:424 Crystal is 40MHz install-dialog-2aee1312.js:424 MAC: 48:27:e2:57:7c:10 install-dialog-2aee1312.js:424 Uploading stub... install-dialog-2aee1312.js:724 Error: Timeout at ia.read (install-dialog-2aee1312.js:424:72641) at async ta.command (install-dialog-2aee1312.js:424:55233) at async ta.check_command (install-dialog-2aee1312.js:424:58833) at async ta.mem_block (install-dialog-2aee1312.js:424:59483) at async ta.run_stub (install-dialog-2aee1312.js:424:65415) at async ta.main_fn (install-dialog-2aee1312.js:424:66917) at async install-dialog-2aee1312.js:724:2934 (anonymous) @ install-dialog-2aee1312.js:724 await in (anonymous) (async) _confirmInstall @ install-dialog-2aee1312.js:724 await in _confirmInstall (async) handleEvent @ styles-e96248a3.js:1 install-dialog-2aee1312.js:424 esptool.js install-dialog-2aee1312.js:424 Serial port WebSerial VendorID 0x303a ProductID 0x2 install-dialog-2aee1312.js:424 Connecting... install-dialog-2aee1312.js:724 DOMException: Failed to execute 'setSignals' on 'SerialPort': Failed to set control signals. (anonymous) @ install-dialog-2aee1312.js:724 await in (anonymous) (async) _confirmInstall @ install-dialog-2aee1312.js:724 await in _confirmInstall (async) handleEvent @ styles-e96248a3.js:1 install-dialog-2aee1312.js:724 Uncaught (in promise) DOMException: Failed to execute 'setSignals' on 'SerialPort': Failed to set control signals. await (async) _confirmInstall @ install-dialog-2aee1312.js:724 await in _confirmInstall (async) handleEvent @ styles-e96248a3.js:1 install-dialog-2aee1312.js:724 Uncaught (in promise) DOMException: Failed to execute 'open' on 'SerialPort': The port is already open. at https://install.openepaperlink.de/js/install-dialog-2aee1312.js:724:5560

Is this an issue of esptool-js ?

ssieb commented 1 year ago

https://github.com/esphome/esp-web-tools/issues/374#issuecomment-1550285777

sblantipodi commented 1 year ago

as wrote in the issue linked by ssieb, using web tools 8.0.6 somewhat fixes the problem. hard to say why newer esp web tools 9.2.1 works worse than the older 8.0.6