espressif / esptool-js

Javascript implementation of flasher tool for Espressif chips, running in web browser using WebSerial.
https://espressif.github.io/esptool-js/
Apache License 2.0
290 stars 108 forks source link

How can I flash an esp32 using files from a Github Release? #143

Closed AllanOricil closed 3 months ago

AllanOricil commented 6 months ago

For example, this Release has a build for the CYD. How can I configure esptool-js to use the release files, from .zip, and proper flash indexes?

This is the content of the .zip

image

Thank you in advance.

brianignacio5 commented 5 months ago

Go to https://espressif.github.io/esptool-js/ and click Connect under Program section.

Add binaries (.bin) and flash offset address in the list. The list of binaries to flash and the flash offset address are usually defined in the partitions table.

Click Program. See the flashing output. If successful you can disconnect

AllanOricil commented 5 months ago

I'm looking for a way to build a custom site where people can just click on a button called "flash", or "update", to flash their boards easily. @brianignacio5

brianignacio5 commented 5 months ago

One thing you can do is to prepare a TOML file with your binaries and call the ESP-Launchpad with the URL (like GitHub for example) of your TOML and it can be used for flashing monitor etc.

Here is the link to the ESP-Launchpad tutorial in Elektor magazine: https://www.elektormagazine.com/magazine/elektor-328/62435

Here is the ESP Launchpad repository: https://github.com/espressif/esp-launchpad

Note: This project uses esptool-js as dependency so it is doing the same thing but simplify your binaries configuration.

AllanOricil commented 5 months ago

@brianignacio5 one last question. Do you know a way I can pass parameters while flashing the board with my build? For example, during builds I can set WIFI_SSID and WIFI_PASSWORD as build variables. However I can't ship firmwares with these values hard-coded. I need the user to set them up when flashing.

AllanOricil commented 5 months ago

Never mind. I think I will change my code to read those env specific variables at runtime from a config file.

DrSkunk commented 3 months ago

@AllanOricil Maybe ESP Web Tools suit your usecase better https://esphome.github.io/esp-web-tools/

AllanOricil commented 3 months ago

@AllanOricil Maybe ESP Web Tools suit your usecase better https://esphome.github.io/esp-web-tools/

@DrSkunk thank you

Im actually using it already :D

This is my project https://github.com/AllanOricil/esp32-mfa-authenticator