logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 63273 297

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.
ADVERTISEMENT
📢 Listen (AI):
  • ADVERTISEMENT
  • #152 21052818
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    So you guys are saying that DHT11 is still not working on LN882H? I need to find some time and hook up my LN882H and scope to check...
    Helpful post? Buy me a coffee.
  • #153 21052927
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    @divadiow : I just opened PR#1186 as a slight extension to PR#1143:

    Using "PowerSave 1" should work as in the release versions, e.g. should work with power metering using interrupt counting like BL0937.
    But if you don't need this feature you could also use "PowerSave 2" to enable sleep mode.

    BTW: When using "sleep mode" I see random WiFi "reconnects" due to errors in log:

    Info:MAIN:Time 48, idle 0/s, free 98840, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    TEMP: adc raw:  776, temp_IC:   27 Total:137112; Free:98840;
    Info:MAIN:Time 49, idle 0/s, free 98840, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    +--------------- net device info ------------+
    |netif type    : STA                         |
    |netif hostname: ln_sta                      |
    |netif ip      = 192.168.0.58                |
    |netif mask    = 255.255.255.0               |
    |netif gateway = 192.168.0.1                 |
    |netif mac     : [00:50:XX:XX:XX:XX]         |
    +--------------------------------------------+
    Info:MAIN:Time 50, idle 0/s, free 98096, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    Info:MAIN:Time 51, idle 0/s, free 98840, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    [WLIB_I]W:F13=0x00004F6E, PA=0x87024C8D, RT=0x04160241
    [WLIB_I]W:EN_BP,LLS_CNT = 12
    [WLIB_I]W:F13=0x00004F6E, PA=0x87524C8D, RT=0x04160263
    [WLIB_I]W:EN_BP,LLS_CNT = 14
    [WLIB_I]W:F13=0x00004F6F, PA=0x87524C8D, RT=0x0416028B
    [WLIB_I]W:EN_BP,LLS_CNT = 16
    [WLIB_I]W:F13=0x00004F6F, PA=0x87524C8D, RT=0x041602B1
    [WLIB_I]W:EN_BP,LLS_CNT = 18
    Info:MAIN:Time 52, idle 0/s, free 98840, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    [WLIB_I]W:F13=0x00004F74, PA=0x87524C8D, RT=0x041602D9
    [WLIB_I]W:EN_BP,LLS_CNT = 20
    [WLIB_I]W:F13=0x00004F6E, PA=0x87524C8D, RT=0x04160302
    [WLIB_I]W:EN_BP,LLS_CNT = 22
    [WLIB_I]W:F13=0x00004F6E, PA=0x87524C8D, RT=0x0416032A
    [WLIB_I]W:EN_BP,LLS_CNT = 24
    [WLIB_I]W:F13=0x00004F74, PA=0x87524C8D, RT=0x04160352
    [WLIB_I]W:EN_BP,LLS_CNT = 26
    [WLIB_I]W:F13=0x00004F74, PA=0x87524C8D, RT=0x0416037E
    [WLIB_I]W:EN_BP,LLS_CNT = 28
    Info:MAIN:Time 53, idle 0/s, free 98840, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    [WLIB_I]W:F13=0x00004F6F, PA=0x87524C8D, RT=0x041603A4
    [WLIB_I]W:EN_BP,LLS_CNT = 30
    [WLIB_I]W:F13=0x00004F70, PA=0x87524C8D, RT=0x041603CB
    [WLIB_I]W:EN_BP,LLS_CNT = 32
    [WLIB_I]W:F13=0x00004F74, PA=0x87524C8D, RT=0x041603F2
    [WLIB_I]W:EN_BP,LLS_CNT = 34
    [WLIB_I]W:F13=0x00004F74, PA=0x87524C8D, RT=0x04160416
    [WLIB_I]W:EN_BP,LLS_CNT = 36
    [WLIB_I]W:F13=0x00004F74, PA=0x87524C8D, RT=0x0416043C
    [WLIB_I]W:EN_BP,LLS_CNT = 38
    Info:MAIN:Time 54, idle 0/s, free 98840, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    [WLIB_I]W:F13=0x00004F6F, PA=0x87524C8D, RT=0x04160464
    [WLIB_I]W:EN_BP,LLS_CNT = 40
    [WLIB_E]System-Error = 0xc1
    [WLIB_I]Disconnected.
    STA disconnected to target AP!
    [WLIB_I]Disconnected.
    [WLIB_I]Status: Scan Successful. Initiating Join: 
    [WLIB_I]SSID      = MYSSID
    [WLIB_I]BSSID     = 00:11:22:33:44:55
    [WLIB_I]Channel   = 8
    [WLIB_I]RSSI      = -61
    [WLIB_I]StationID = XX:XX:XX:XX:XX:XX
    [WLIB_I]Status: Initiating Authentication.
            CH= 8,RSSI= -62,BSSID:[11:22:33:44:55:66],SSID:"MYSSID"
            CH= 8,RSSI= -63,BSSID:[22:33:44:55:66:77],SSID:"SSID1"
            CH=12,RSSI= -78,[WLIB_I]Status: Authentication Successful. Initiating Association.
    BSSID:[11:22:33:44:55:66],SSID:"MYSSID"
    [WLIB_I]Peer's HT-Capabilities:
    [WLIB_I]ht_capable             = 1
    [WLIB_I]ldpc_cod_cap           = 0
    [WLIB_I]smps_mode              = 3
    [WLIB_I]greenfield             = 0
    [WLIB_I]short_gi_20            = 1
    [WLIB_I]short_gi_40            = 0
    [WLIB_I]rx_stbc                = 0
    [WLIB_I]max_rx_ampdu_factor    = 3
    [WLIB_I]min_mpdu_start_spacing = 5
    [WLIB_I]htc_support            = 0
    [WLIB_I]sta_amsdu_maxsize      = eff
    [WLIB_I]chan_width             = 0
    [WLIB_I]dsss_cck_40mhz         = 0
    [WLIB_I]Status: Association Successful.
    [WLIB_I]Connected.
    [WLIB_I]sta_conn_step_set: CONNECTED
    STA connected to target AP!
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 55, idle 0/s, free 100464, MQTT 0(3), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 56, idle 0/s, free 100464, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    Info:MAIN:Time 57, idle 0/s, free 100464, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    +--------------- net device info ------------+
    |netif hostname: ln_sta                      |
    |netif ip      = 192.168.0.58                |
    |netif mask    = 255.255.255.0               |
    |netif gateway = 192.168.0.1                 |
    |netif mac     : [00:50:XX:XX:XX:XX]         |
    +--------------------------------------------+
    Info:MAIN:Time 58, idle 0/s, free 100464, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    TEMP: adc raw:  787, temp_IC:   31 Total:137112; Free:100464;
    Info:MAIN:Time 59, idle 0/s, free 98096, MQTT 0(4), bWifi 1, secondsWithNoPing -1, socks 0/0 POWERSAVE
    +--------------- net device info ------------+
    
  • #154 21055168
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    max4elektroda wrote:
    I just opened PR#1186 as a slight extension to PR#1143:


    OK. so it's not a measurement of power use as such, but using this PR and "powersave 2" seems to be the only powersave mode so far that makes
    this bulb usable for me. Temperatures are 60+ and then it'll crash otherwise, all within a minute or two of lighting the bulb. This is with LED current limited to "BP5758D_Current 2 2".

    The longest this device has ever stayed online, with the lowest temps, with the bulb lit:
    Screenshot of the OpenLN882H_C25E1088 LED bulb management software interface.

    "powersave 2" loaded manually after boot as startup command set still means no device working and safe mode required to change back.

    I did add a small heatsink, but still it would get too hot with powersave 1. And it shouldn't need one.

    Close-up of the inside of an LED bulb with a small heat sink visible.
  • #155 21055190
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    Wait a moment, by "gets too hot", do you mean that you've measured the temperature externally in some reliable way, or do you base your conclusions on the internal temperature of LN882H? I don't know how well the calibration of that internal temperature may be, so I would take care with interpreting that.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #156 21055191
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    Board Language: polish
    I have two switches (relay) on LN882 and OpenBK,
    In the off state the temperatures are as follows:
    #1 Internal temperature: 66.7°C
    #2 Internal temperature: 61.5°C

    Should it be like that?
  • ADVERTISEMENT
  • #157 21055199
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    p.kaczmarek2 wrote:
    Wait a moment, by "gets too hot", do you mean that you've measured the temperature externally in some reliable way, or do you base your conclusions on the internal temperature of LN882H? I don't know how well the calibration of that internal temperature may be, so I would take care with interpreting that.


    I have not measured the external temperature, no. I only have the internal to go on. The only things that are knowns are that the temperature reading is seemingly way lower with powersave 2 and the bulb stays working.

    Added after 1 [minutes]:

    Piorun2002 wrote:
    I have two switches (relay) on LN882 and OpenBK,
    In the off state the temperatures are as follows:
    #1 Internal temperature: 66.7°C
    #2 Internal temperature: 61.5°C

    Should it be like that?


    with Build on Apr 20 2024 13:12:55 version 1186_merge_02081583662a?
  • ADVERTISEMENT
  • #158 21055207
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    Board Language: polish
    Build on Apr 15 2024 15:04:48 version 1.17.546, so I will do the upgrade

    Dodano po 35 [minuty]:

    Quote:

    Piorun2002 wrote:
    I have two switches (relay) on LN882 and OpenBK,
    In the off state the temperatures are as follows:
    #1 Internal temperature: 66.7°C
    #2 Internal temperature: 61.5°C

    Should it be like that?


    with Build on Apr 20 2024 13:12:55 version 1186_merge_02081583662a?


    Where can I download it?
    I tested these: 1.17.546 and 1.17.553
  • #160 21055291
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Piorun2002 wrote:

    Where can I download it?

    Just as an additional hint to the information from divadiow:
    You need an account and need to be logged in to git in order to see and download these files.
  • #161 21055301
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    or, attached
    Attachments:
    • OpenLN882H_1186_merge_02081583662a_OTA.bin (334.46 KB) You must be logged in to download this attachment.
  • #162 21055335
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    Board Language: polish
    Online for 8 minutes and 21 seconds
    #1 Build on Apr 21 2024 08:20:54 version 1.17.553, Internal temperature: 65.2°C
    #2 Build on Apr 20 2024 13:12:55 version 1186_merge_02081583662a, Internal temperature: 64.8°C

    Do I need to set something in the configuration?
  • #163 21055350
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Yes, you need to set the "PowerSave" to 1 or even 2.
    In case you didn't see this an additional warning:
    Don't set "PowerSave 2" as startup command or the device won't connect to WiFi.
    You need to set it later as a command.
  • #164 21055421
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    Board Language: polish
    Before:
    Internal temperature: 64.0°C
    Reply from 192.168.10.157: bytes=32 time=1ms TTL=255
    Reply from 192.168.10.157: bytes=32 time=4ms TTL=255

    After PowerSave 2:
    Internal temperature: 36.0°C
    Reply from 192.168.10.157: bytes=32 time=56ms TTL=255
    Reply from 192.168.10.157: bytes=32 time=73ms TTL=255

    After PowerSave 1:
    Internal temperature: 47.2°C
    Reply from 192.168.10.157: bytes=32 time=31ms TTL=255
    Reply from 192.168.10.157: bytes=32 time=63ms TTL=255
  • #165 21055655
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    Those are a very promising results. Is the WiFi stable?


    Maybe we should do some kind of internal work-around for power save so it can stay in short startup command but is still fired after wifi connection internally?
    Helpful post? Buy me a coffee.
  • #166 21055670
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    That would probably be the best solution, I just didn't find the time to figure out the startup process yet and how to delay the actual setting (especially when this has to be limited to one platform).
    If you can point out where to look, I could try (but only next weekend).

    BTW: it's so annoying not to have the source of wifi library.
    I really would like to have a look there and e.g. find out, what the error/reconnect I saw in the log #153 is about...
  • #167 21055731
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    Board Language: polish
    p.kaczmarek2 wrote:
    Those are a very promising results. Is the WiFi stable?

    good enough - HA (over MQTT) can turn on/off without delay
  • #168 21062931
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    Board Language: polish
    After installing the switch into the installation box, the switch heats up to 70C, and in the PowerSave mode only 32C.
    From what I understand, it is not possible to execute the PowerSave 2 command with a delay in OpenBK itself.
    Could advice me how to create a script / triger in OpenHAB to enable PowerSave 2 mode after the switch sends a message to MQTT that it is online?
  • #169 21063418
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    You can call the command from remote, e.g. via wget or curl, like
    curl 'http://<IP.of.your.device>/cmd_tool?cmd=PowerSave+2'
  • #170 21063719
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    I pushed an attempt to fix that, the code now sets powersave for LN882H in STA connect callback. I haven't tested it. Can anyone test?

    Full PR link:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1186
    My changes;
    https://github.com/openshwprojects/OpenBK7231...mits/68fd014f193a3e5e0ea72c203d5c74bd27a5bad8
    Helpful post? Buy me a coffee.
  • #171 21063738
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Quick test:

    [EDIT:]
    Sorry, first reply (doesn't work) was too fast (somehow update didn't work and I tested an other version)

    It works as expected!
    Autostart will use PowerSave 1 or 2 and Wifi is connected!!!
  • #172 21063748
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    Ok but what if it connects, and then you, for example, turn off the router, wait 15 minutes, and chip tries to reconnect? Is the reconnection broken then?

    Do I have to turn off the PowerSave in STA disconnect callback?
    Helpful post? Buy me a coffee.
  • #173 21063753
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    I will test this tomorrow with settings 1 and 2
    [Edit]
    I can say that the reconnect after the "PowerSave 2" setting and WiFi error (see above) works
  • #174 21063767
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    Ok, maybe also @divadiow can check? I would like to merge that PR.
    Helpful post? Buy me a coffee.
  • #175 21064064
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Here are my results after further testing:

    PowerSave works as a startup command as expected: After connection to WiFi the measured current drawn is reduced, in my case when measureing the 3.3V current used by a single module from approx 90 mA to 50 (PowerSave 1) or 35 mA (PowerSave 2).

    When connection to Wifi is lost (router down), it will start trying to reconnect without any pause between network scans for ~ 150 seconds. During this time power is even increased to near 100mA.
    After this period it will do network scans every 10 seconds or so - current at ~ 90mA (like without PowerSave).

    When router or AP is back, it will reconnect and power drops again to the expected current.

    BUT: After the reconnect (here with PowerSave 1) I couldn't effectively change PowerSave - not to 2, even not to 0. It stayed at PowerSave 1.
    At least, that's what my multimeter showed - the logs followed the command and displayed PowerSave 2 or no PowerSave - only there was no change in current drawn.

    Trying to disconnect AP again (this time it didn't cause the "intense" try for reconnect but module used the "normal" scan every 10 to 20 seconds) and after another reconnect, it stayed in "PowerSave 0" (that was the last state I configured) even if I set PowerSave to 2.

    Testing another period with no AP (this time 150 seconds of heavy scanning) - And after another reconnect, it ended up in PowerSave 2 mode

    So there is a drawback: You can't use PowerSave as a "regular user command" any more - changes are reflected in logs, but current won't change.
    So it looks like changing this is ONLY possible during connection of WiFi.

    What we would need would be something like: only set PowerSave while Wifi is connected, not only during completion of connection ...

    Added after 1 [hours] 41 [minutes]:

    Maybe just move this code

    #if defined(PLATFORM_LN882H)
    		// LN882H hack, maybe place somewhere else?
    		// this will be applied after WiFi connect
    		if (g_ln882h_pendingPowerSaveCommand != -1) {
    			LN882H_ApplyPowerSave(g_ln882h_pendingPowerSaveCommand);
    			g_ln882h_pendingPowerSaveCommand = -1;
    		}
    #endif


    into "void Main_OnEverySecond()"
    under the case
    if (g_bHasWiFiConnected) {
    ?

    I can't promise, but I will try to code it later today ...

    Added after 1 [hours] 16 [minutes]:

    Updated the PR accordingly and installed the generated image:

    Changes see here

    During my tests everything worked now:
    - Startup command is applied after Wifi is connected
    - every change of PowerSave in the Command Tool is applied
  • #176 21064277
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    Sure, I can accept this change, we could maybe improve it a bit (in powersave command check whether sta is connected, if yes, do immediatelly change, otherwise delay it until connect event), but this "on every second" callback is called... well, on every second, and checking integer variable on every second is not really that costly, so I think we can go with current version.

    So, shall I merge? @divadiow ?
    Helpful post? Buy me a coffee.
  • #177 21064290
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    That was my idea, to. I think we could also move it to the "every ten second" part where network infos are printed.
    But if we can do the "sta connected" test during powersave command - even better.
    I would then suggest to simply ignore a command when WiFi is not connected and just print a warning message in this rare/impossible(?) case - you probably can't change this over the network if WiFi is down, only a scripted change would fail.

    So if this is possible: leave the "delayed" part as you proposed, but only delay startup command and the other changes are only done, if WiFi is connected.

    Added after 12 [minutes]:

    Thinking a second time:
    Just do your proposal: - If WiFi is disconnected, do change delayed, during WiFi connect callback as you proposed - this is the next possible point, where a change can happen.
    If WiFi is present, do the change immediately.
  • #178 21064321
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    p.kaczmarek2 wrote:
    So, shall I merge? @divadiow ?


    Hi sorry I've not had time to engage with this further yet. I can this evening if still required by then
  • #179 21064462
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    I hope this version is o.k. now - it works for me (and there is no need to check every second ;-)).
  • #180 21064516
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12314
    This is a better version, just what about AP mode? I think we can ignore it altogether?
    Helpful post? Buy me a coffee.
📢 Listen (AI):

Topic summary

✨ The discussion focuses on flashing LN882H modules with open-source firmware similar to Tasmota/Esphome, enabling cloud-free operation and integration with Home Assistant. Flashing requires a USB to UART converter with reliable 3.3V power supply, connecting module TX to UART RX, RX to TX, GND to GND, and 3.3V to 3.3V. Users report challenges including access to the BOOT pin, interference from board components on RX/TX lines, and the necessity of short wiring to ensure stable flashing. Various USB to UART converters (CH340, FT232RL, PL2303, CP2101) have differing success rates; CH340 and CP2101 are recommended over some FTDI and PL2303 adapters. Correct baud rate (115200) and running the flashing tool from non-system drives (e.g., D:) improve success. The LN882H_CMD_Tool is used for flashing and dumping firmware; flashing requires power cycling and keeping BOOT grounded during operations. Users successfully dumped firmware but often encountered "Fail. Error downloading file" during flashing, resolved by adjusting baud rate, shortening cables, and using compatible USB-UART adapters.

Power-saving features are under active development; enabling PowerSave mode reduces power consumption and device temperature but may cause WiFi connection issues in some firmware versions. PowerSave commands can be set via startup commands or command tool, with better effect when applied directly via command tool. Temperature monitoring shows LN882H devices run hot (up to 74°C) without load, improved by PowerSave mode. Integration with energy metering (BL0937) is affected by PowerSave due to interrupt handling. Static IP assignment is currently unimplemented in firmware. DHT sensor support is partially implemented; drivers require manual start commands, and pin mapping must be correct. NTP client requires manual driver start and supports server IP configuration via commands. Safe mode can be triggered by power cycling to reset device settings. Firmware and tools are evolving with ongoing commits addressing power management, filesystem (LittleFS), and device stability.

Overall, flashing LN882H modules demands careful hardware setup, compatible USB-UART adapters, correct flashing parameters, and power cycling. Firmware features like power saving, sensor support, and network configuration are improving but still have limitations. Community contributions and testing continue to enhance LN882H open-source firmware usability and integration.
Generated by the language model.

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.
ADVERTISEMENT