-
Notifications
You must be signed in to change notification settings - Fork 639
Binaries
You will need the latest version of the esptool.py tool. From now on I will assume you have it somewhere on your path, otherwise use the absolute path to it in the commands below.
You will also need a binary image of the ESPurna firmware. Pre-built binary images for the latest releases are available in the releases page. Grab the latest one for your device and save it locally.
if you haven't already, consider backing up your stock firmware. Backup the stock firmware
To flash the image you will need to boot your board in flash mode. The procedure is exactly the same as when you are getting ready to flash a new image and it will depend on your device. Check the supported hardware page for instructions.
esptool will hard reset after each operation so unless GPIO0 is still connected to ground you will need to go into boot mode manually every time you want to backup, erase or write flash.
Erasing a flash is not dangerous, you can always boot into flash mode and flash a new firmware.
Erasing is important as it nullifies the current flash, so you'll have a clean flash. (If you flash a new firmware without erasing it first, leftover data from previous image -probably won't effect but- may render your device unstable.)
If the device becomes unstable or you want a fresh install you will have to first erase the flash image using this command:
esptool.py --port /dev/ttyUSB0 --baud 115200 erase_flash
To flash the binary into your device go into flash mode and run the next command replacing firmware.bin
with the path (relative or absolute) to the pre-built image you previously downloaded.
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash -fs 1MB -fm dout 0x00000 firmware.bin
"fs" stands for "flash size" and is set to 1 megabyte in the example (-fs 1MB). That is the standard size for most Sonoff devices. If you are using a 4 megabyte module you might want to change this value to "4MB" (this maybe important as extra space will be used by SPIFFS and you'll larger storage. this maybe crucial, e.g if you want to add some SPIFFS based logging system). DOUT flash mode should work for all devices.
You can also let esptool autodetect the flash size based on SPI flash ID (-fs detect). If esptool fails to detect to size, it will show a warning and use default value of 4MB (4 megabytes).
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash -fs detect -fm dout 0x00000 firmware.bin
If you're looking for support:
- Issues: this is the most dynamic channel at the moment, you might find an answer to your question by searching open or closed issues.
- Wiki pages: might not be as up-to-date as we all would like (hey, you can also contribute in the documentation!).
- Gitter channel: you have better chances to get fast answers from project contributors or other ESPurna users. (also available with any Matrix client!)
- Issue a question: as a last resort, you can open new question issue on GitHub. Just remember: the more info you provide the more chances you'll have to get an accurate answer.
- Backup the stock firmware
- Flash a pre-built binary image
- Flash a virgin Itead Sonoff device without opening
- Flash TUYA-based device without opening
- Flash Shelly device without opening
- Using PlatformIO
- from Visual Studio Code
- Using Arduino IDE
- Build the Web Interface
- Over-the-air updates
- Two-step updates
- ESPurna OTA Manager
- NoFUSS
- Troubleshooting
- MQTT
- REST API
- Domoticz
- Home Assistant
- InfluxDB
- Prometheus metrics
- Thingspeak
- Alexa
- Google Home
- Architecture
- 3rd Party Plugins
- Coding style
- Pull Requests