Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamhow to flash bk7238 via OTA from openbeken to esphome
To OTA-flash a BK7238 device currently running OpenBeken to ESPHome/LibreTiny, build an ESPHome firmware for:
bk72xx:
board: generic-bk7238-tuya
Then upload the Beken OTA .rbl file generated by ESPHome through the OpenBeken OTA page. Do not upload firmware.uf2 or a raw .bin to OpenBeken; OpenBeken’s BK OTA path expects an RBL package. OpenBeken documents BK OTA as RBL-based, and LibreTiny’s Beken build outputs include an RBL package intended for OpenBeken-style OTA. (github.com)
Important caveat: LibreTiny’s official “OpenBeken → ESPHome OTA” note is still written as applying to BK7231 only, while the current LibreTiny board database does include BK7238 / Tuya T1 support. Therefore, treat BK7238 OTA migration as the same practical method but with more risk than BK7231; be prepared to recover by UART if it fails. (docs.libretiny.eu)
For Tuya T1-family modules such as T1-U, T1-2S, T1-3S, or some XH-CB3S / WB43-style boards, the correct LibreTiny board is usually:
bk72xx:
board: generic-bk7238-tuya
LibreTiny lists generic-bk7238-tuya as a BK7238 Tuya T1 board, with a 2 MiB flash layout and RF calibration near the end of flash. (docs.libretiny.eu)
Do not use a BK7231N or BK7231T board definition unless the chip is actually BK7231N/T. A wrong family image can soft-brick the unit and require UART recovery.
Start with a very small configuration. The BK7238 Tuya layout has a relatively limited OTA/download partition, so do not begin with a large build full of web server, sensors, fonts, display code, etc. The LibreTiny BK7238 Tuya flash map shows an app area and a separate OTA/download area, so image size matters. (docs.libretiny.eu)
Example minimal ESPHome config:
esphome:
name: bk7238-test
friendly_name: BK7238 Test
bk72xx:
board: generic-bk7238-tuya
wifi:
ssid: "YOUR_WIFI_SSID"
password: "YOUR_WIFI_PASSWORD"
ap:
ssid: "BK7238-ESPHome-Fallback"
password: "fallback1234"
captive_portal:
logger:
api:
ota:
- platform: esphome
If your device uses a TuyaMCU on UART1, remember that on BK72xx the flashing/Tuya UART is typically RX1 P10 / TX1 P11. LibreTiny’s BK72xx documentation notes UART1 on P10/P11 for flashing and Tuya use. (esphome.io)
From ESPHome CLI:
esphome compile bk7238-test.yaml
Then look for the generated OTA RBL file:
find .esphome/build/bk7238-test -iname "*.rbl" -o -iname "*.uf2"
For OpenBeken OTA, you want the file similar to:
image_bk7238_app.ota.rbl
or whatever ESPHome/LibreTiny names the BK7238 Beken OTA package in your build directory.
LibreTiny’s Beken documentation says ESPHome builds generate several files, including firmware.uf2 for LibreTiny/ESPHome upload and an image_..._app.ota.rbl Beken OTA package for OpenBeken-type OTA. (docs.libretiny.eu)
Use:
*.ota.rbl
Do not use:
*.ota.ug.bin
firmware.uf2
firmware.bin
*.0x011000.rbl
for OpenBeken web OTA.
The *.ota.ug.bin file is for Tuya OTA / Cloudcutter-style flows, not for OpenBeken’s normal BK OTA panel. LibreTiny’s ESPHome flashing page distinguishes Tuya OTA .ug.bin from OpenBeken RBL migration. (docs.libretiny.eu)
OpenBeken’s web OTA performs platform checks, so rename the ESPHome-generated BK7238 OTA RBL file to something starting with the BK7238 OpenBeken platform name, for example:
OpenBK7238_esphome.rbl
For BK7231, LibreTiny explicitly documents renaming the ESPHome-generated RBL to an OpenBK..._esphome.rbl style filename before dropping it into the OpenBeken OTA panel. The same naming convention is the practical approach for BK7238, but again, BK7238 migration is less explicitly documented than BK7231. (docs.libretiny.eu)
If OpenBeken rejects the file with a magic/platform error, stop. Do not force random .bin, .uf2, or BK7231 files.
In the OpenBeken web UI:
OpenBK7238_esphome.rbl
OpenBeken’s FAQ states that for BK platforms the OTA file is RBL and can be uploaded in the web app OTA tab or by HTTP OTA. (github.com)
Save the OpenBeken configuration:
OpenBeken’s automatic template/configuration does not transfer into ESPHome. You must manually recreate the hardware mapping in YAML.
Also, if possible, make a full flash backup via UART before migrating. OTA generally should not overwrite the RF calibration partition, but if the device becomes unreachable you will need UART access.
Use a minimal ESPHome build first:
esphome:
name: bk7238-test
bk72xx:
board: generic-bk7238-tuya
wifi:
ssid: "YOUR_WIFI"
password: "YOUR_PASSWORD"
ap:
ssid: "BK7238-Recovery"
captive_portal:
logger:
api:
ota:
- platform: esphome
After the device is online in ESPHome, add relays, buttons, sensors, TuyaMCU, light outputs, etc. incrementally.
This reduces the chance that the first OTA image exceeds the available OTA partition.
| Symptom | Likely cause | Fix |
|---|---|---|
| OpenBeken rejects file | Wrong file type or wrong filename prefix | Use *.ota.rbl, rename to OpenBK7238_esphome.rbl |
| Device reboots but never appears | Wrong Wi-Fi credentials, bad YAML, unsupported peripheral config | Look for fallback AP; otherwise UART recovery |
| OTA upload fails partway | Image too large, weak power, Wi-Fi instability | Use smaller YAML, improve power/network |
File is firmware.uf2 only |
You are looking at ESPHome OTA/UART package, not OpenBeken RBL | Search build directory for *.rbl |
| Build output says BK7231T/N | Wrong board selected | Stop and fix board: generic-bk7238-tuya |
| Device is dead after flash | Wrong image family or failed boot | Recover via UART using ltchiptool/BK flashing tool |
If OTA fails and the device does not join Wi-Fi, recover through UART.
For BK7238 Tuya T1 boards, LibreTiny lists the flashing connections as:
USB-UART TX -> BK7238 P10 / RX1
USB-UART RX -> BK7238 P11 / TX1
GND -> GND
3.3 V -> stable 3.3 V supply
CEN -> briefly pull to GND to reset
The LibreTiny BK7238 board page documents P10/RX1, P11/TX1, and CEN reset for flashing. (docs.libretiny.eu)
Use a proper 3.3 V supply. LibreTiny’s BK72xx flashing guide explicitly warns that weak USB-UART 3.3 V regulators are a common cause of flashing failure. (docs.libretiny.eu)
Use this flow:
ESPHome YAML with bk72xx: generic-bk7238-tuya
↓
Compile
↓
Find ESPHome-generated BK7238 *.ota.rbl
↓
Rename to OpenBK7238_esphome.rbl
↓
Upload in OpenBeken OTA page
↓
Device reboots into ESPHome
Do not upload firmware.uf2 to OpenBeken. Use the generated Beken OTA RBL file. Because BK7238 support is newer and less explicitly documented for OpenBeken-to-ESPHome OTA than BK7231, keep the first image minimal and be ready for UART recovery.