logo elektroda
logo elektroda
X
logo elektroda

How to flash LN882H with open source Tasmota/Esphome style firmware - backup procedure included

p.kaczmarek2  297 63507 Cool? (+24)
📢 Listen (AI):

TL;DR

  • LN882H modules can be flashed over UART with open-source Tasmota/Esphome-style firmware to free cloud-controlled devices and integrate them with Home Assistant.
  • Wire module TX, RX, GND, 3V3, and BOOT/GPIOA9 to ground, and keep GPIOA9 low throughout the entire flashing process.
  • Backup uses `python LN882H_Flash_Dumper.py COMx flashdump`, and the firmware flash command is `LN882H_CMD_Tool.exe COMx download flash 921000 0x0 flashimage.bin`.
  • After flashing, power-cycle the module, disconnect BOOT from ground, and open 192.168.4.1 to configure it like other OpenBeken/Tasmota-style devices.
  • A reliable external 3.3V supply is recommended because powering directly from the USB-to-UART adapter’s 3.3V pin may fail.
Generated by the language model.
LN882H module with visible electronic components on a yellow background.
Here I will show you how you can easily flash the new LN882 modules via UART, just like you would flash ESP8266. Flashing those modules will soon allow you to free them from the cloud and connect them to Home Assistant. I've already covered some of the more technical details in the LN882H datasheet topic, so here I will only present the firmware change guide.


2025.01.04 UPDATE:
Please see this topic for latest discussion and YOUTUBE LN882H tutorial.


Update 2026
As of 2026, this platform read/write is also supported by our flash tool:
https://github.com/openshwprojects/BK7231GUIFlashTool
The connection (soldering, wires), is the same, but you can use our tool instead of the legacy one.
Please check it out and use it instead of legacy tools, let us know how it works for you!

Hardware preparation
You will need an USB to UART converter and a reliable 3.3V power supply. Powering directly from 3.3V pin on USB to UART converter may not work.
The procedure is very similiar to ESP8266 and BK7231, so watch our flashing tutorials here:
https://www.youtube.com/@elektrodacom
But basically, in case of LN882, you need to connect:
- Module TX -> UART RX
- Module RX -> UART TX
- Module GND -> UART GND
- Module 3V3 -> UART 3V3 (make sure your USB UART supports and is in 3V3 mode if it is selectable)
- Module BOOT/GPIOA9 -> GND
GPIOA9 must remain LOW during whole flashing process (do not disconnect it!.
Then, once all connections are done, connect USB to UART converter to your PC.

NOTE: if you try to flash and it fails, or you want to flash again, make sure to disconnect and reconnect USB to UART converter from your PC, while keeping BOOT signal low.

Soldering tips
If you are new to soldering, you can watch some of our BK7231 flashing guides, BK7231 is a different module but soldering method is the same. For example:



Module can be easily desoldered with some flux, some extra Pb solder, and solder wick.
Here is desoldered module:
WiFi module with Lightning LN882H chip on a wooden surface. LN882H module with visible pads and pin labels.
In order to solder wires easily, first add some flux:
LN882 module with visible solder points and markings TX, RX, and BOOT.
Then add some Pb solder to the pads (also tin the wires):
PCB with pins labeled 3V3, GND, RX, TX, A1, A0, and BOOT.
Then, solder wires:
Image of LN882 module with soldered wires.
And, finally, here is my circuit - it's an USB to UART converter in 3.3V mode with an extra AMS1117-3.3V / TC1264-3.3V LDO on proto board so I can get reliable 3.3V current source:
Breadboard with connected wires and USB to UART converter on a wooden table.

Making original firmware backup
Extract both archives to single directory, like:
Screenshot of the LN882H_Flash_Dumper directory on Windows.
Navigate to it in CMD, install Python if you're missing it, change COMx to your COM port name, like COM15, run the command:

python LN882H_Flash_Dumper.py COMx flashdump

NOTE: You must have in the same directory as Python script! Otherwise, you will get this error:
Screenshot of a Python error during an attempt to flash dump using LN882H Flash Dumper.
If you have connected something incorrectly, or swapped RX and TX, you will get:
Screenshot of an error when running LN882H Flash Dumper.
Otherwise, the slow and long flash dump procedure will begin:
Screenshot showing flash memory dump process in terminal.
Flash read will continue until it hits the end of the flash, it will end with following message:
Screenshot showing error message Error: Fail. Command execution error.
This is not an error! Dump files will be created here:
View of LN882H_Flash_Dumper directory with various files.

Flashing new firmware

First, get new firmware for NL882H platform, it should be available here, either check link or Releases tab:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/LN882H.md
https://github.com/openshwprojects/OpenBK7231T_App
Navigate to the dir, just like when doing flash backup, then use:

LN882H_CMD_Tool.exe COMx download flash 921000 0x0 flashimage.bin

It should flash in few moments:
Console screenshot showing the LN882H module flashing process.
To run firmware, disconnect everything from power, disconnect BOOT from ground, and reconnect power:
Screenshot of Wi-Fi connection to the OpenLN882H network.
Connect to the access point, open page at 192.168.4.1 and configure your device like you'd configure any other OpenBeken/OpenBL602/OpenW600/OpenW800/OpenXR809/Tasmota device.
OpenLN882H interface with configuration buttons.
For mode OBK tips, please see our channel:
https://www.youtube.com/@elektrodacom
For a generic IoT devices teardowns list and guides list, see:
https://openbekeniot.github.io/webapp/devicesList.html

Download
Here are tools used for flashing, as described in this topic:
LN882H_Too...1.0.16.zip (4.36 MB)You must be logged in to download this attachment.
LN882H_Fla...Dumper.zip (1.15 kB)You must be logged in to download this attachment.

Summary
LN882H is very easily flashable via UART, just like ESP. You need to solder 5 wires: 3.3V, ground, RX, TX and boot signal, boot must be pulled low for bootloader to work. Remember to power off/on whole module after each flashing cycle, this is mandatory. The flashing procedure will allow you to flash our multiplatform firmware so your devices can work with Home Assistant and be free from the cloud.
PS: At the time of the posting this topic, LN882H port is still WIP, so please wait patiently for Release to be posted on Github.

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14412 posts with rating 12358 , helped 650 times. Been with us since 2014 year.

Comments

ferbulous 14 Jan 2024 06:32

Which oem/smart home device using this chip? Haven’t seen this one yet [Read more]

p.kaczmarek2 14 Jan 2024 07:35

We have mentioned few devices with this chip in our datasheet topic: https://www.elektroda.com/rtvforum/topic4027545.html Futhermore, soon our devices list will be updated to include LN882H: https:... [Read more]

p.kaczmarek2 20 Jan 2024 15:39

2024-01-20 UPDATE Now OpenBeken OTA on OpenLN882H is working. Futhermore, builds are now public, see: https://github.com/openshwprojects/OpenBK7231T_App/releases https://obrazki.elektroda.pl/8423092500_1705761556_thumb.jpg... [Read more]

voodoopt 22 Jan 2024 22:30

Is it possible to flash the chip without removing it from the PCB? ATTENTION it is not connected to 220v [Read more]

p.kaczmarek2 22 Jan 2024 22:41

It should be, but keep in mind that you need to have access to BOOT pin, and you also have to make sure that RX and TX are not connected on your board, because, if for example, there is a button with a... [Read more]

voodoopt 23 Jan 2024 00:43

cozilife smart switch https://obrazki.elektroda.pl/3511312200_1705967044_thumb.jpg [Read more]

p.kaczmarek2 23 Jan 2024 08:41

If you have the same switch as me, then it may be hard to access BOOT without desoldering the module. Futhermore, are RX/TX used for some purpose on your board? [Read more]

divadiow 23 Jan 2024 09:17

if it's this device I was able to solder boot in place and flash LN-02 without desoldering the module or cutting RX/TX. https://www.elektroda.com/rtvforum/viewtopic.php?p=20911009#20911009 [Read more]

p.kaczmarek2 23 Jan 2024 09:25

Fair point, but it may require some tricky soldering. I have the same device as you @divadiow (as you probably know) and I'm halfway in the process of making YT video for that. [Read more]

divadiow 23 Jan 2024 09:28

True. A little tricky! You have to be careful once soldered. I ripped the pad off boot on my first LN-02 mini switch not moving it around delicately enough 😳 [Read more]

voodoopt 28 Jan 2024 12:38

I can't flash the chip, try with 3 different programmers -> Arduino Nano with CH340 -> Prolific USB-to-Serial Comm Port (USB to TTL) -> ESP programer (USB-SERIAL CH340) I use with AMS1117 3.3 800mah... [Read more]

p.kaczmarek2 28 Jan 2024 12:43

How your setup looks like? Why are you trying to flash LN882H with BK7231 flasher or bkWriter? It's not a BK7231. It will not work. You need to use the tool I mentioned in the flashing guide. [Read more]

voodoopt 28 Jan 2024 12:48

C:\temp\LN882H_CMD_TOOL>python LN882H_Flash_Dumper.py COM23 flashdump LN882H flash dump tool v1.0 Loading RAMCode... Error: Fail. Could not go in download mode. I've already checked the pins and... [Read more]

p.kaczmarek2 28 Jan 2024 12:48

Do you know that after every attempt, even if it fails, you need to disconnect whole setup from power, while keeping boot on GND all the time? If you try to flash, and it fails, then it will lock itself... [Read more]

voodoopt 28 Jan 2024 22:07

Thank you, the first step is done and I know that the programmer is working. Now you can dump ------------------------------------------------ C:\temp\LN882H_CMD_TOOL>LN882H_Flash_Dumper.py COM21 flashdump LN882H... [Read more]

p.kaczmarek2 29 Jan 2024 04:40

Do you power off/on after doing the dump? It's required after every operation. [Read more]

divadiow 29 Jan 2024 07:33

and unplug/replug the USB-TTL with GND/BOOT still connected to the LN-02 before powering up from external 3.3v. I did a LN882H/WL2S last night. I also shortened my cables after moving the USB-TTL closer... [Read more]

voodoopt 03 Feb 2024 11:45

I've tried everything, I always get the error with and withtou admin command line C:\temp\LN882H_CMD_TOOL>LN882H_CMD_Tool.exe COM21 download flash 2000000 0x0 c:\temp\LN882H_CMD_TOOL\OpenLN882H.bin Fail.... [Read more]

p.kaczmarek2 03 Feb 2024 11:51

I'd start with shortening the wires. We already had cases where BK7231 flashing was failing due to the too long wires between USB to UART converter and WiFi module. [Read more]

FAQ

TL;DR: 70 °C internal temperature was logged on stock settings, but drops to 32 °C after PowerSave 2; “LN882H flashing is very similar to ESP8266 flashing” [Elektroda, p.kaczmarek2, post #20923772] Use 115 200 baud and keep BOOT (A9) low for reliable uploads [Elektroda, voodoopt, post #20958664]

Why it matters: Correct wiring, speed and power rules prevent bricked modules and overheating.

Quick Facts

• Flash size: 2 MB NOR, dump script trimmed to 0x200000 bytes [Elektroda, divadiow, post #21284784] • Stable upload speed: 115 200 baud; 2 Mbit/s often fails [Elektroda, voodoopt, post #20958664] • BOOT=A9 must stay at GND from power-on until flashing ends [Elektroda, p.kaczmarek2, post #20905518] • PowerSave 2 cuts idle current from ≈55 mA to 35 mA (-36 %) [Elektroda, max4elektroda, post #21064064] • OTA bug fixed in releases ≥1.17.789; Firefox now works [Elektroda, divadiow, post #21332121]

1. What minimum hardware is required to flash an LN882H module?

  1. USB-to-UART adapter that outputs true 3 V3 (CH340 or CP2102 proven). 2. Solid 3 V3 supply ≥300 mA; many adapters sag. 3. Five leads: 3 V3, GND, RX, TX, BOOT (A9). 4. Optional: pogo pins or fine wires for in-circuit work [Elektroda, p.kaczmarek2, post #20905518]

2. Which pins go where?

• Module TX → UART RX • Module RX → UART TX • 3 V3 ↔ 3 V3 • GND ↔ GND • A9 (BOOT) ↔ GND (keep low) Any disconnect of A9 before power-cycle aborts flashing [Elektroda, p.kaczmarek2, post #20905518]

3. How do I enter download mode every time?

  1. Hold A9 at GND. 2. Remove and re-insert USB power to both UART and module. 3. Start flash command. After any failure repeat the full power cycle—soft reset is not enough [Elektroda, p.kaczmarek2, post #20933029]

4. Flash tool stops with “Fail. Error downloading file”. Fix?

Set baud to 115 200 bps; many CH340/FTDI clones error at 2 000 000 bps. Example: “Ok.” after lowering speed on COM21 [Elektroda, voodoopt, post #20958664]

5. Can I flash without desoldering the module?

Yes, if you can grip A9 and ensure RX/TX lines are not tied to buttons or capacitors. Cut the trace or lift parts if debouncing cap blocks UART [Elektroda, p.kaczmarek2, post #20923772]

6. Quick 3-step firmware backup before experimenting?

  1. python LN882H_Flash_Dumper.py COMx flashdump 2. Wait ~5 min for 2 MB readout. 3. Verify flashdump_flash.bin size == 2097152 bytes [Elektroda, divadiow, post #21284784]

8. How do I enable PowerSave automatically?

Add in Startup Command: backlog delay_s 5; PowerSave 2. From release 1.17.772 the firmware applies PowerSave after Wi-Fi connects, so no boot lock [Elektroda, max4elektroda, post #21064290]

9. Edge-case: BL0937 energy meter shows 125 V after PowerSave.

PowerSave disables the interrupt clock BL0937 needs. Keep PowerSave 0 on power-monitor plugs or voltage reading will be wrong [Elektroda, max4elektroda, post #21052031]

10. OTA upload crashes when I use Firefox. Work-around?

Firmware ≤1.17.772 overflowed a 4 kB buffer when the header and payload arrived in one TCP packet, often triggered by Firefox. Patched in 1.17.789 (PR #1441) [Elektroda, max4elektroda, post #21319958] Use Chrome or update firmware.

11. How can I reset a forgotten Web-UI password?

From 1.17.800 you can power-cycle, then enter 5 wrong logins within 3 min; firmware offers full config reset unless Flag 77 disables it [Elektroda, max4elektroda, post #21086964]

13. Linux/Mac flashing tool available?

Yes. Open-source LN882Loader (CLI) handles dump and flash on Linux/macOS; requires PySerial [ste­fanmandl, 2025].

15. How do I change a duplicate MAC address?

mac write xx:xx:xx:xx:xx:xx works but device reboots with new IP. Verify the MAC is unique before saving [Elektroda, Advian1, post #20996463]

16. Quick How-To: flash in 3 steps

  1. Hold A9 → GND, power module.
  2. LN882H_CMD_Tool COMx download flash 115200 0x0 OpenLN882H_xxx.bin
  3. Power-cycle, release A9, connect to AP 192.168.4.1 and configure.
Generated by the language model.
%}