ESPHome can be flashed in few different ways, depending on your needs.
All binary files generated by ESPHome will be in
.esphome/build/<yourdevice>/.pioenvs/<yourdevice>/. The methods described below may require you to get a file from that directory.
If you're using the GUI (ESPHome Dashboard) this path will be in your
This path will be referred to as build directory.
The flasher program built-in LibreTiny is also available for ESPHome.
python -m esphome run yourdevice.ymlto recompile AND upload the firmware
python -m esphome upload yourdevice.ymlto upload without recompiling
The device needs to be connected to your PC with a UART-TTL adapter. Refer to chip connection guides to learn how to connect your device.
If your device is already running ESPHome, refer to the OTA guide below.
The built-in flasher is not yet available in the GUI. Here are your options:
- OTA, using the downloaded UF2 file (if you're already running ESPHome)
- wired (also UF2), using ltchiptool
- wirelessly, using tuya-cloudcutter
Read below for more details on each of these methods.
This method requires having ESPHome already installed on your device.
- If you've added the Web Server component, navigate to the device's IP address (or
.localname) in your web browser. Grab
firmware.uf2from the build directory and drop it on the "OTA Update" field.
- You can also use ESPHome CLI to flash via OTA. Add a
--deviceargument to the command, as such:
python -m esphome upload yourdevice.yml --device yourdevice.local
Using ltchiptool (wired, via UART)
The UF2 file may have a different name, depending on the project you're building. Usually it's best to grab the latest (sorted by date) file with UF2 extension from the build directory.
Converting devices with tuya-cloudcutter
This currently applies to BK7231T and BK7231N only.
tuya-cloudcutter can't be used for other chips.
image_bk7231x_app.ota.ug.bin file from the build directory - take care to choose the correct file. It must have "OTA" and "UG" in its name.
Next, refer to Using tuya-cloudcutter guide.
Migrating from OpenBeken (OTA)
OpenBeken is a custom, Tasmota-like firmware for non-ESP chips. Currently, this part of the guide applies to BK7231 only, as that's the only chip supported both by LT and OBK.
OBK is compatible with standard Beken OTA packages, but the web panel does a filename check to prevent chip type mismatch. Grab the
image_bk7231t_app.ota.rbl file from build directory (note: without "UG" in the name!), rename it to something like
OpenBK7231T_esphome.rbl (change T to N depending on the chip type), and drop it on the OTA panel.
Migrating from ESPHome to OpenBeken
ESPHome is only compatible with UF2 OTA packages, which OpenBeken doesn't provide. You need to create an UF2 package manually, using ltchiptool (see ltchiptool#7 for more info). Grab an .RBL file from OpenBeken Releases page, and run this command:
This will create
OpenBeken.uf2 file that you can upload on the ESPHome web server dashboard page. Pay attention to the chip selection - incorrectly built UF2 file may brick your device! Make sure to download the right .RBL file of OpenBeken, and to choose the correct board (