logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 65571 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: 14591
    Help: 654
    Rate: 12612
    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: 754
    Help: 48
    Rate: 187
    @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: 5039
    Help: 438
    Rate: 891
    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.
  • ADVERTISEMENT
  • #155 21055190
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14591
    Help: 654
    Rate: 12612
    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.
  • #156 21055191
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    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?
  • #157 21055199
    divadiow
    Level 38  
    Posts: 5039
    Help: 438
    Rate: 891
    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?
  • #158 21055207
    Piorun2002
    Level 15  
    Posts: 268
    Rate: 25
    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
  • ADVERTISEMENT
  • #160 21055291
    max4elektroda
    Level 24  
    Posts: 754
    Help: 48
    Rate: 187
    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: 5039
    Help: 438
    Rate: 891
    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
    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: 754
    Help: 48
    Rate: 187
    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
    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: 14591
    Help: 654
    Rate: 12612
    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: 754
    Help: 48
    Rate: 187
    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
    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
    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: 754
    Help: 48
    Rate: 187
    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'
  • ADVERTISEMENT
  • #170 21063719
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14591
    Help: 654
    Rate: 12612
    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: 754
    Help: 48
    Rate: 187
    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: 14591
    Help: 654
    Rate: 12612
    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: 754
    Help: 48
    Rate: 187
    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: 14591
    Help: 654
    Rate: 12612
    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: 754
    Help: 48
    Rate: 187
    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: 14591
    Help: 654
    Rate: 12612
    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: 754
    Help: 48
    Rate: 187
    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: 5039
    Help: 438
    Rate: 891
    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: 754
    Help: 48
    Rate: 187
    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: 14591
    Help: 654
    Rate: 12612
    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: Need to flash LN882H and keep a recovery path? Use 5 wires and keep BOOT low; as one expert put it, "BOOT is like IO0". First dump the original flash, then write the regular firmware binary over UART, usually at 115200 baud if higher speeds fail. This FAQ is for OpenBeken/OpenLN882H users who need a practical flash, backup, OTA, and recovery workflow. [#20923772]

Dlaczego to ma znaczenie: LN882H can run cloud-free firmware, but success depends more on wiring discipline, baud rate, and power cycling than on the chip itself.

Opcja Typowe użycie Co działało w praktyce Główne ryzyko
LN882H_CMD_Tool.exe Flashowanie UART w Windows Często ruszało po zmianie na 115200 Błąd Fail. Error downloading file.
LN882H_Flash_Dumper.py Backup flash i OTP Tworzy dump przed zmianą firmware Długi odczyt, wymaga poprawnego BOOT
OTA z Web App Aktualizacja już działającego OBK Chrome/Chromium działały stabilniej niż Firefox Firefox mógł wywołać crash OTA
BK7231GUIFlashTool Nowsze narzędzie GUI Wspierane dla LN882H od aktualizacji 2026 Nadal wymaga tego samego okablowania

Najważniejszy wniosek: Najczęstsza przyczyna nieudanego flashowania LN882H nie była w module, tylko w procedurze: BOOT musi pozostać niski, po każdej próbie trzeba odłączyć i podłączyć zasilanie, a zejście do 115200 baud często rozwiązywało zapis. [#20958664]

Quick Facts

  • LN882H flashuje się przez UART podobnie do ESP8266: potrzebne są połączenia TX, RX, GND, 3.3V i BOOT/GPIOA9, a GPIOA9 musi pozostać w stanie niskim przez cały proces. [#20905518]
  • W praktyce zapis przy 2,000,000 baud często kończył się błędem, a kilka osób potwierdziło sukces dopiero po przejściu na 115200 baud. [#20958664]
  • PowerSave na LN882H potrafił mocno obniżyć temperaturę: w jednym teście spadek wyniósł z 64.0°C do 36.0°C po PowerSave 2, kosztem większych opóźnień sieciowych. [#21055421]
  • LittleFS jest systemem plików flash, który przechowuje pliki i skrypty, z odpornością na restart oraz małym narzutem pamięci. Na LN882H dodanie LittleFS zwiększało rozmiar binarki o około 42 KB. [#21069454]
  • OTA na LN882H bywało niestabilne w Firefox; po naprawce przetestowano poprawny update z buildu 1441_merge_6d6a6086fa18 do OpenLN882H_1.17.789_OTA.bin właśnie w Firefox 132.0.2. [#21332121]

How do I flash an LN882H module over UART and make a full backup of the original firmware first?

Flashowanie i backup robi się w dwóch etapach. 1. Podłącz TX↔RX, RX↔TX, GND, 3.3V oraz BOOT/GPIOA9 do GND. 2. Zrób kopię poleceniem python LN882H_Flash_Dumper.py COMx flashdump; narzędzie zapisze dump flash i OTP. 3. Wgraj nowy firmware poleceniem LN882H_CMD_Tool.exe COMx download flash 921000 0x0 flashimage.bin, a po zakończeniu odłącz BOOT od masy i zrestartuj zasilanie. Po starcie urządzenie wystawia AP na 192.168.4.1. [#20905518]

What is the BOOT pin on LN882H, and why does GPIOA9 have to stay low during the whole flashing process?

BOOT na LN882H to pin wejścia do bootloadera, a w praktyce jest nim GPIOA9. Musi pozostać niski przez cały proces, bo tylko wtedy układ pozostaje w trybie programowania; autor porównał go wprost: „BOOT is like IO0.” Odłączenie BOOT w trakcie potrafi przerwać procedurę lub zablokować kolejną próbę do czasu pełnego odcięcia zasilania. Dlatego BOOT zwiera się do GND przed podaniem zasilania i trzyma nisko do końca flashowania. [#20923772]

Why does LN882H_CMD_Tool show "Fail. Error downloading file." and what fixes actually worked, like using 115200 baud, shorter wires, or a different USB-to-TTL adapter?

Najczęściej ten błąd znikał po zmianie parametrów transmisji i procedury zasilania. Skuteczne poprawki to: użycie 115200 zamiast 2000000, skrócenie przewodów, pełne odłączenie zasilania i USB-TTL po każdej nieudanej próbie oraz podmiana adaptera USB-UART. Pomagało też upewnienie się, że wgrywany jest zwykły plik binarny, a nie plik OTA. Kilku użytkowników potwierdziło, że samo ustawienie 115200 natychmiast rozwiązało Fail. Error downloading file. [#20996463]

Which USB-to-UART adapters work best for LN882H flashing, and how do CH340, CP2101, FT232RL, PL2303, and NodeMCU compare in practice?

Najlepiej wypadały adaptery CH340 i CP2101, ale LN882H bywa wybredny. W wątku potwierdzono sukces na CH340, CP2101, adapterach FTDI w części konfiguracji oraz nawet na NodeMCU ESP8266 z CH340. FT232RL działał u jednych, a u innych nie; PL2303 też działał, ale częściej zgłaszano z nim problemy. Jeden użytkownik potwierdził, że LN882H można było flashować przez NodeMCU z CH340, a inny odzyskał stabilność dopiero po przejściu z FTDI na CH430/CH340. [#20958756]

What is LittleFS in OpenBeken/OpenLN882H, and what features depend on it on the LN882H platform?

LittleFS to system plików w pamięci flash, potrzebny do plików takich jak autoexec.bat, skryptów i funkcji opartych o lokalny storage. Na początku LN882H go nie miał, więc przycisk „List Filesystem” nic nie pokazywał, a tworzenie plików nie działało realnie. Po późniejszym wdrożeniu potwierdzono, że pliki przetrwały kilka aktualizacji OTA. Dodanie LittleFS zwiększało rozmiar binarki LN882H o około 42 KB, ale odblokowywało skrypty i trwałe pliki konfiguracyjne. [#21069454]

How can I flash an LN882H module without desoldering it from the PCB, and what board connections can interfere with RX, TX, or BOOT access?

Da się flashować bez wylutowania, jeśli masz fizyczny dostęp do BOOT i nic nie obciąża linii RX/TX. Problemem bywają przyciski, kondensatory debounce, ścieżki do innych układów lub trudny dostęp do samego BOOT. W takich przypadkach trzeba czasem przeciąć ścieżkę, usunąć kondensator albo bardzo precyzyjnie dolutować cienki przewód tylko na czas programowania. W wątku potwierdzono też przypadek, gdzie moduł LN-02 udało się zaprogramować in-circuit bez wylutowania i bez cięcia RX/TX. [#20924089]

What’s the difference between the regular LN882H firmware binary and the OTA file, and which one should be used for UART flashing versus Web App updates?

Do UART używa się zwykłego pliku binarnego, a do aktualizacji przez Web App używa się pliku OTA. Pomylenie ich jest częstą przyczyną błędów flashowania. Wprost zalecono: wybierz poprawny plik binarny do flashowania, nie plik OTA. Ta różnica wracała też przy Web App, gdzie użytkownicy trafiali na nie-OTA pliki i update nie przechodził. Reguła jest prosta: UART = pełny bin, Web App = OTA.bin. [#20955856]

How do I recover an LN882H device when I can no longer access the web UI, including safe mode, erase commands, and reflashing original firmware?

Najpierw spróbuj safe mode przez 5 szybkich cykli zasilania. 1. Wyłącz i włącz urządzenie 5 razy z krótką przerwą. 2. Po wejściu w safe mode połącz się z AP i popraw konfigurację. 3. Jeśli to nie pomoże, użyj LN882H_CMD_Tool.exe COM# flash erase_all albo wgraj z powrotem oryginalny firmware z backupu. W jednym przypadku dopiero reflashing oryginalnego firmware przywrócił dostęp do sieci domowej, gdy urządzenie po zmianach nie wracało do UI. [#21021640]

Why does changing the MAC address on some LN882H devices make them disappear from the network, and how can I verify the new IP afterward?

Po zmianie MAC urządzenie zwykle dostaje nowy lease DHCP, więc znika spod starego adresu IP. Samo ustawienie MAC może działać poprawnie, ale po zapisie trzeba szukać nowego IP w routerze albo skanerze sieci. Jeden użytkownik potwierdził zmianę MAC bez problemu i dodał, że trzeba upewnić się, że adres MAC jest prawidłowy, a następnie sprawdzić nowy adres w routerze. Jeśli urządzenie nadal znika, warto wrócić do dumpu i powtórzyć konfigurację od zera. [#20996463]

What is PowerSave on LN882H in OpenBeken, and how do PowerSave 0, 1, and 2 affect temperature, current draw, Wi-Fi stability, and BL0937 energy metering?

PowerSave zmniejsza pobór prądu i temperaturę LN882H, ale wpływa na sieć i pomiar energii. PowerSave 0 to tryb bez oszczędzania. PowerSave 1 obniżał temperaturę i prąd umiarkowanie. PowerSave 2 dawał największy efekt, np. spadek z 64.0°C do 36.0°C, ale podnosił ping do 56–73 ms i mógł psuć pomiary BL0937 oraz powodować reconnecty Wi‑Fi. Dla pojedynczego modułu raportowano też spadek poboru z około 90 mA do 50 mA przy trybie 1 i 35 mA przy trybie 2. [#21064064]

Why doesn’t static IP work on LN882H builds, and what is currently unimplemented in the wifi_init_sta code path?

Static IP nie działał, bo ścieżka LN882H była wtedy po prostu niezaimplementowana. Wprost wskazano funkcję wifi_init_sta(const char* oob_ssid, const char* connect_key, obkStaticIP_t *ip) jako miejsce wymagające aktualizacji w pliku hal_wifi_ln882h.c. Dlatego wpisy statycznego IP były ignorowane, a urządzenie wracało do DHCP. Dopóki ten fragment nie został uzupełniony, jedynym praktycznym obejściem było przypisanie stałego adresu po stronie routera. [#20997185]

How do I start and configure extra drivers like NTP, DHT, SSDP, or Wemo on LN882H, including backlog commands and startup command syntax?

Sterowniki uruchamiasz komendami, a kilka poleceń łączysz przez backlog. Przykład: backlog startDriver ntp; ntp_timeZoneOfs +2 albo backlog startDriver SSDP; startDriver Wemo. NTP wymaga ręcznego startu, a serwer ustawia się komendą ntp_setServer <IP>. DHT był obsługiwany per-pin, ale w części buildów LN882H nie był jeszcze aktywny. Wemo wymagał startu sterownika i sprawdzenia, czy działa endpoint /setup.xml, bo sam komunikat „OK” nie gwarantował wykrycia przez Alexę. [#21028427]

Why does OTA updating LN882H often fail in Firefox but work in Chrome or Chromium, and what was the root cause of the HTTP/OTA crash?

Problem nie leżał w samym pliku OTA, tylko w błędzie obsługi bufora HTTP/OTA po stronie LN882H. Firefox częściej wysyłał nagłówki i payload w układzie, który ujawniał błąd: kod OTA zbierał dane do bufora 4 KB, ale nie sprawdzał poprawnie sytuacji, gdy pojedynczy fragment mógł zapełnić bufor więcej niż raz. To kończyło się zapisem poza pamięcią i crashem wątku HTTP Clie. Po poprawce autorzy potwierdzili udane OTA w Firefox 132.0.2. [#21332121]

What’s the best way to remove or recover a forgotten OpenBeken web password on an LN882H device without losing control of it permanently?

Najpewniejsza metoda to wgranie przez UART builda bez wymuszania hasła albo builda recovery. Wskazano plik http_basic_auth.c i opcję kompilacji bez ALLOW_WEB_PASSWORD, co powoduje akceptację każdego połączenia. Później pojawiła się też wersja recovery: po restarcie i ponad 5 błędnych próbach logowania urządzenie mogło zaproponować pełny reset konfiguracji. To rozwiązanie było traktowane ostrożnie ze względów bezpieczeństwa, więc najbezpieczniejszy pozostaje własny build ratunkowy flashowany przez UART. [#21084206]

How can I flash LN882H from Linux or macOS instead of Windows, and which tools from the thread support that workflow?

Na Linuxie pojawiło się natywne narzędzie LN882Loader, opublikowane jako projekt do flashowania LN882H bez Windows. Wcześniej użytkownicy próbowali Wine, QEMU i VirtualBox z mieszanymi wynikami; GUI pod Windows działało w VM, ale bywało zawodne. Dla Windows później polecano też GUI flash tool, natomiast w samym wątku jedynym jasno wskazanym rozwiązaniem linuksowym był właśnie LN882Loader. Dla macOS nie podano gotowego natywnego narzędzia, więc praktyczna ścieżka z wątku to Linux tool albo Windows VM. [#21376296]
Generated by the language model.
ADVERTISEMENT