logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 44835 297
ADVERTISEMENT
  • #121 21028703
    p.kaczmarek2
    Moderator Smart Home
    LittleFS is not currently implemented on the LN882H. If anyone has some time and wants to help, please contact me. Here is an example implementation of LittleFS for BL602, you can use it as a reference:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1159/files
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #122 21028749
    max4elektroda
    Level 20  
    As far as I know, actually there is no LittleFS in the LN882H images, so you can't store files there.
  • #123 21029981
    max4elektroda
    Level 20  
    I might try, but only after some progress on the project to do some work on the device time (PR #1152).
    ATM I'm stuck with my limited git knowledge, how to add changes to the different platforms Makefiles.
    And it would be good to have someone willing to test on other platforms, for I only have some LN882H devices...
  • #124 21030726
    p.kaczmarek2
    Moderator Smart Home
    How may I help you @max4elektroda ?
    To update Makefiles of individual SDKs, you need to open PRs for those SDKs and wait for me to accept it.
    Then you need to run github submodules update to pull those SDKs into your main repo PR.
    I can try to test more or less with other platforms, I guess @DeDaMrAz or @divadiow can help too.
    Helpful post? Buy me a coffee.
  • #126 21030953
    max4elektroda
    Level 20  
    Any help would be great! I would open a new topic for this, so I can explain my idea and how you could help me with some testing.
    So: What would be the correct place to open a "discussion about OpenBeken ideas or changes"?
    Then I can delete this part of my posts to keep this thread "clean" ;-)
  • ADVERTISEMENT
  • #127 21030959
    p.kaczmarek2
    Moderator Smart Home
    No need to delete, just open a new topic and I will do my best to help. Just keep in mind, if you have separate ideas, then open separate topics per each idea.
    Helpful post? Buy me a coffee.
  • #129 21048148
    Piorun2002
    Level 15  
    >>20956716
    Were you able to upload the firmware to LN882 with this USB2TTL converter?
    I'm asking because this model does not have a voltage selection, so it may damage the chip..
    USB to TTL converter with visible pin labels and D-SUN logo.
    Is additional 3.3v power supply needed?
  • ADVERTISEMENT
  • #130 21048197
    divadiow
    Level 35  
    It may not have a selector but it does have separate 3.3 and 5v fixed outputs?

    Assuming it can feed a module enough current, the 3.3 should do.

    I only ever use external PSU now after too long wondering if flash failures were because of power.
  • #131 21048223
    p.kaczmarek2
    Moderator Smart Home
    @divadiow wasn't this PR deemed unstable?

    @Piorun2002 I never recommend using this type of USB to UART converter without good external 3.3V LDO (unless you have LDO on the board with the device and you can solder 5V from USB to LDO input). Of course, never flash devices connected to mains! Disconnect all mains voltage first.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #132 21048226
    Piorun2002
    Level 15  
    I managed to upload the firmware to switch LN882H connected directly to the above USB2TTL converter, without additional voltage stabilizer and capacitors.
    Transfer speed 115200 (around two minutes)

    MINI Smart Switch label with technical information about the device.
  • #133 21048268
    divadiow
    Level 35  
    p.kaczmarek2 wrote:
    wasn't this PR deemed unstable


    Yes. This is true. I do remember thinking/ hoping it was worth a shot though when I didn't have any other power options. @Piorun2002 got lucky I guess. Best to invest a small amount in an external power supply still though.
  • #134 21048274
    Advian1
    Level 6  
    divadiow wrote:
    @Piorun2002 got lucky I guess. Best to invest a small amount in an external power supply still though.

    I've flashed 2 LN devices and 3 beken devices with ch340 adapter.
    Didn't need external power for any of those.
  • #136 21048395
    p.kaczmarek2
    Moderator Smart Home
    Well, on the other hand, we already had reports on forum saying "flashing stops at 75%" or "I flashed but AP does not show up" and using 3.3V directly from USB to UART converter was the culprit.. so it depends
    Helpful post? Buy me a coffee.
  • #137 21050021
    Advian1
    Level 6  
    p.kaczmarek2 wrote:
    Well, on the other hand, we already had reports on forum saying "flashing stops at 75%" or "I flashed but AP does not show up" and using 3.3V directly from USB to UART converter was the culprit.. so it depends


    may be the adapter I'm using, is capable of providing more power than usual.
    It can turn on wifi, but it can't turn on relay while powered through the adapter only.

    Offtopic: can you help me figure out how I can show the internal temp in home assistant?

    offtopic 2: do you accept btc? would like to do a small donation.
  • #138 21050987
    ElektroTechnikus
    Level 8  
    @Advian1

    I have also experienced erratic behaviour when flashing or testing afterwards when relying on my CH340 adapter as a power supply. But there are very different ones out in the wild...

    My solution is an old wall-wart with 9 to 12 V and a typical breadbord power supply that makes 3.3 and 5 volts out of it. It also has its own switch, which is useful for resetting the SoC without any fiddling.

    Image of a breadboard with a connected power supply and circuit.

    The fact that the relays do not work in this way may also be due to them not being operated with 3.3 volts but with 5 volts or more. Then besides a SPS normally there is an analoguous voltage regulator on the board and some driver IC, FET or BJT.
  • #139 21051074
    divadiow
    Level 35  
    p.kaczmarek2 wrote:
    @divadiow wasn't this PR deemed unstable?


    I somehow didn't link this reply to my post about the powersave PR! (yes, I know you said "PR"!!)

    anyway, I don't recall any instability on my part. https://www.elektroda.com/rtvforum/topic4028087-90.html#21022196

    Can we extract the powersave related posts from this one thread to make a new single-focussed thread?

    @max4elektroda @rufus4 what are your latest thoughts? could you rerun this PR https://github.com/openshwprojects/OpenBK7231T_App/pull/1143 @p.kaczmarek2 please so we have this fix included? https://github.com/openshwprojects/OpenBK7231T_App/pull/1180

    I'd happily retest it all.
  • #140 21051215
    rufus4
    Level 10  
    @divadiow
    Sorry, I was focused to some other things the last days. So I didn`t see that there where changes done.
    For shure I like to test this. But which version shall we flash, 1.17.545 or the latest 1.17.551?
  • #142 21051307
    rufus4
    Level 10  
    For me it didn`t change much. Refreshing gui page takes still quiet a while and I cant say if this is better or same as before.
    But there are still a few things to do. Like PowerSave is not starting through startup command text.

    ups... flashed the wrong device! I will have a other try.

    Added after 3 [hours] 16 [minutes]:

    Trying to ota flash my LSPA9 with WL2S board from 1.17.530 to 1.17.545 without any success. OTA does not work anymore. ...very strange....

    Added after 50 [minutes]:

    Found the problem. Web-App does download the non OTA files!
  • #144 21051639
    rufus4
    Level 10  
    All right... finally I can give valuable feedback. ;)
    -updated LSPA9 with WL2S board from 1.17.530 to 1.17.545
    -the web gui reacts much faster in both modes PowerSave 0 and PowerSave 1
    (only for information: powersave 1 auto start and DHT22 does not work yet)


    Added after 3 [minutes]:

    @divadiow
    thanks for caring about these things! :thumbs_up
  • #145 21051663
    divadiow
    Level 35  
    rufus4 wrote:
    thanks for caring about these things! :thumbs_up


    aw! I do, not that I'm capable of anything particularly deep.
  • #146 21051684
    rufus4
    Level 10  
    I don't know where to post, so I do it right here.

    If it would help to a software developer wished to have a LSP9A WL2S LN882HKI BL0937 flashed already to OBK to test his invented changes. I would spend one of those devices for free within Europe. (England may be difficult because taxes)

    Added after 2 [minutes]:

    divadiow wrote:
    aw! I do, not that I'm capable of anything particularly deep.

    anyway, thanks :)
  • #147 21051948
    max4elektroda
    Level 20  
    divadiow wrote:
    @max4elektroda @rufus4 what are your latest thoughts?

    Thanks for reminding me about PR https://github.com/openshwprojects/OpenBK7231T_App/pull/1143

    Starting the device with "PowerSave 1" leads to WiFi not connecting in my case (it's o.k. to start "PowerSave 1" later).
    Current drawn on a sole module drops to ~40 mA (from ~ 55 mA as measured #101.
    Up to now I didn't flash my plug to see if power measurement with BL0937

    Added after 23 [minutes]:

    It doesn't seem to work with the interrupts and BL0937 - the values reported are "rubbish" - displaying 125 - 145 V instead of ~230 ...
  • #148 21052007
    rufus4
    Level 10  
    max4elektroda wrote:
    It doesn't seem to work with the interrupts and BL0937 - the values reported are "rubbish" - displaying 125 - 145 V instead of ~230 ...

    strange... On my device with WL2S PowerSave1 is working together with BL0937, values are correct, but it does not start at all after boot with autostart. (FW 1.17.545)
  • #149 21052031
    max4elektroda
    Level 20  
    Its also working for me with the release image.

    The tests above are made with the pull request mentioned, this one is using a more rigid powersave mode, if I got it right...

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.
Summary generated by the language model.
ADVERTISEMENT