-
Notifications
You must be signed in to change notification settings - Fork 0
Flashing
If you have read through the Prerequisites you should have selected a pre-compiled Tasmota firmware binary or chosen to compile your own Tasmota firmware binary.
Once you have followed Hardware preparation, your device should be in Flash Mode and ready for a Tasmota firmware binary file to be flashed. For that you need a flashing tool.
Optionally, you may want to back up the device manufacturer's firmware. To do so, you must use esptool. Refer to the instructions below.
Tasmota PyFlasher is specifically designed for use with Tasmota binaries with an easy to use GUI. It is based on NodeMcu Pyflasher and esptool.py.
Download the latest release for your platform (currently only Windows). Double click the downloaded file and it'll start, no installation required. Simple and fast...
- Connect your device to the serial-to-USB adapter or plug in NodeMCU/D1 mini.
- Select the correct Serial port (COM# port). Leave on auto-select if not sure.
- Browse to the Tasmota firmware binary you downloaded or compiled.
🔴 Set Erase flash to yes, wipe all data!!! if it is the first time flashing Tasmota on the device or you're experiencing issues with the existing flash and need to do a full erase.
If you're upgrading an already flashed Tasmota and wish to keep your settings, set it to no.
- Click Flash Tasmota and wait until done.
If the flash was successful the Console window will display:
Unplug your serial programming adapter or device and plug it back in or connect to another power source. Your device is now ready for Initial configuration. For proper device initialization after the firmware upload completes, power down and power up the device.
Message COM# failed to connect: Failed to connect to Espressif device: Timed out waiting for packet header
means your device is not connected (recheck COM port number and USB cable) or not in flash mode (retry flash mode procedure for your device).
Sometimes a "successful" flash will still result in a device that does not function as expected. If your device exhibits strange behaviors, we recommend that you use esptool.py to erase the flash as described below. And, if you are using esptool.py for erasing, you might as well upload the firmware that way as well. But definitely erase using esptool.py.
Esptool is the official tool for flashing ESP8266 chips and is the most reliable. Use version 2.8 or up.
It requires Python, if you do not have an installed copy of Python 2.x or 3.x download and install it from https://www.python.org.
Download the esptool Source code to a folder of your choice. Go to the folder and install Esptool with command
python setup.py install
Make sure you followed the steps to put your device in flash mode. Place your chosen firmware binary file in the same folder as esptool.py.
Esptool uses the serial interface to communicate with your device. On Windows these interfaces are named COM1, COM2, etc. and on Linux they are named /dev/ttyUSB0, /dev/ttyUSB1, etc. Before using esptool, make sure you know which serial port your programming adapter is connected to.
The following use COM5
as an example. Change COM5
with your serial port designation.
Ensure the device is in flash mode before each step.
Backup the current firmware with the following command:
esptool.py --port COM5 read_flash 0x00000 0x100000 fwbackup.bin
When the command completes the device is not in flash mode anymore. Repeat the process of putting your device in programming mode.
Erase the complete flash memory holding the firmware with the following command:
esptool.py --port COM5 erase_flash
It only takes a few seconds to erase 1M of flash.
When the command completes the device is not in flash mode anymore. Repeat the process of putting your device in programming mode.
Load the chosen Tasmota firmware file with the following command (e.g., tasmota.bin
in this example):
esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 tasmota.bin
Unplug your serial programming adapter or your device and plug it back in or connect to another power source. Your device is now ready for Initial configuration. For proper device initialization after the firmware upload completes, power down and power up the device.
The executable version of esptool is maintained by Ivan Grokhotkov and releases are kept at https://github.com/igrr/esptool-ck/releases. Supports Linux, Linux ARM, Windows 32-bit and Mac
For the purpose of simplicity only the Windows version will be explained here, but the commands and parameters are the same for Windows, Linux and Mac.
Download the latest release of Esptool-CK and extract the compressed file to a folder of your choice.
Place your chosen firmware binary file (e.g., tasmota.bin
in the example below) in the same folder as Esptool-CK to simplify the process.
The following commands use COM5
as an example. Change COM5
with your port designation.
Ensure the device is in flash mode before each step.
esptool -cp COM5 -ce -v
Once the erase is complete, put device back into programming mode and upload the firmware
esptool -cp COM5 -bm dout -cf tasmota.bin -v
Unplug your serial programming adapter or your device and plug it back in or connect to another power source. Your device is now ready for Initial configuration. For proper device initialization after the firmware upload completes, power down and power up the device.
Tutorials for setting up development environments if you want to modify the code or default settings and compile your own binaries.
- PlatformIO - setup and configure PlatformIO for compilation and upload
- PlatformIO CLI - use the PlatformIO command line interface on Linux for compilation and upload
- PlatformIO-Core - automate firmware builds using PlatformIO-Core and flash with esptool
- Visual Studio Code - setup and configure Visual Studio Code with PlatformIO for Tasmota
- Atom - beginner guide building Tasmota firmware using Atom with PlatformIO plugin
- Arduino IDE - setup and configure Arduino IDE for Tasmota compilation and upload
- Docker Tasmota - compile from a Docker container using PlatformIO
In PlatformIO, be sure that you always have the latest build of the ESP Core.
Delete the following in your .platformio
folder (%USERPROFILE%\.platformio
in Windows):
- Everything in
.platformio/platforms
- All folders that begin with
framework...
in.platformio/packages
Can only create a firmware binary. Use one of the tools to flash it to your device.
- Gitpod - compile your own binary in the cloud using Gitpod.
- TasmoCompiler - simple web GUI to compile Tasmota with your own settings
Tasmota is NOT a developer of these tools. For help and troubleshooting you will need to get support from those projects.
- Tuya Convert - easy OTA flash for devices with Tuya chips, no disassembly required
- Sonoff DIY - OTA flash for select Sonoff devices (some disassembly required)
- Node-RED OTA server and firmware manager - Node-RED flow for managing OTA updates
- OTA over SCP - setup and configure "OTA over SCP" upload for PlatformIO
- Python HTTP OTA server - setting up a small Python server to serve OTA upgrade binaries
- SonOTA - OTA flash eWeLink based devices (mostly outdated)
If you have encountered problems during flash see the FAQ. Ask for help in Discord or Community Forum
Wiki has moved to link on the left.