logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

[LN882H] [WL2S] Elivco 20A BSD34 EU Power Monitoring Plug [BL0937]

divadiow 11439 38

TL;DR

  • Teardown and OpenBeken flashing of an Elivco/BSD34 20A EU smart plug using a WL2S module with Lightning Semiconductor LN882H and BL0937 power monitoring.
  • The WL2S module was desoldered, the A9/BOOT pad grounded to enter BOOT mode, the factory firmware dumped, then OpenLN882H UART firmware downloaded and the module resoldered.
  • A modified LN882H_Flash_Dumper capped the dump at 0x00200000, and the slow read took about 30-40 minutes.
  • OBK found A0 for the red LED, A3 for the button, A10 for the blue LED, and A11 for the relay; the plug worked, but BL0937 support was still nonfunctional.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • #31 21021691
    p.kaczmarek2
    Moderator Smart Home
    @beloborodom in the past days I also integrated a threading fix for MQTT from LWIP library that was also applied to BL602 in the past and also helped:
    https://github.com/openshwprojects/OpenLN882H/commit/15fde0f403e408eab6ffa31d0e5711e97c37afe2
    GitHub commit view showing a fix for MQTT in the LWIP library.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 21431813
    andraskszabo
    Level 4  
    I have the same BSD34 smart plug and could flash it with openBKN without issues (even without desoldering the module). It works great with HomeAssistant und mqqt.
    The only issue I have is the red LED is always on regardless of the relay state. Any ideas?
  • #33 21431833
    p.kaczmarek2
    Moderator Smart Home
    Use GPIO Doctor to find out which pin is used for LED. Or do Tuya config extraction. Was this LED controllable in Tuya firmware?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #34 21433856
    andraskszabo
    Level 4  
    Thank you for the tipps.

    I played around and it looks like that pin 8 controlls the button and relay blue LED and 23 the red one indication WiFi connection status

    "pins": {
    "6": "BL0937CF1;0",
    "7": "BL0937CF;0",
    "8": "LED_n;1",
    "10": "Btn;1",
    "23": "WifiLED;1",
    "24": "BL0937SEL;0",
    "26": "Rel;1"
    },
    Attachments:
    • OpenBKN_socket_02_10.2.2025_18-51-12.zip (575 Bytes) You must be logged in to download this attachment.
  • #35 21437255
    divadiow
    Level 38  
    andraskszabo wrote:
    I have the same BSD34 smart plug

    100% the same in terms of appearance, label markings, module, chip?
  • ADVERTISEMENT
  • #36 21438406
    andraskszabo
    Level 4  
    They look exactly the same, see pictures. They were sold under SURFOU branding on Amazon.
    The modules are CBS2 by the way...
    I bought them as a 4er pack and they did not even had the same charge of modules. two were "normal" CBS2s and two were those, where the pin marking were swapped (I guess on purpose...)

    Close-up of an electrical plug labeled model BSD34 on a wooden surface.
    White smart plug on a wooden table.
  • ADVERTISEMENT
  • #37 21643534
    astukis
    Level 1  
    Thank you! I had no-name smart plug from Wish that I wanted to flash with custom firmware but was struggling with GPIO pins config. This guide was a lifesaver!
  • #38 21733436
    kantora98
    Level 5  
    Probably off-topic question, but I'd like to ask if it is possible to swap WL2S to CB2S in smartplug like the one discussed in this thread? The reason to ask - one of my smartplugs with CB2S died but the module is alive and flashing WL2S looks more trouble to me. So, I'm searching if the swap is possible. Thanks so much.
  • #39 21733480
    max4elektroda
    Level 24  
    VCC (3.3V) GND and even RX TX seem to be the same in layout so device should be at least powered correctly.
    So it might be only changing pin assignments to get it working.
📢 Listen (AI):

Topic summary

✨ The discussion centers on the Elivco 20A BSD34 EU smart power monitoring plug based on the LN882H chip and WL2S Tuya module, featuring the BL0937 power metering IC. Initial efforts involved flashing the LN882H device using OpenBeken firmware, with community contributions providing a detailed flashing guide and driver development for BL0937 support. Challenges included manual makefile configuration and driver integration, resolved through pull requests and code adjustments. Users reported successful flashing and basic functionality, including MQTT and Home Assistant integration with HASS Discovery, though some experienced issues with the "ping watchdog" causing WiFi disconnections and reconnection behavior variability after router outages. Firmware updates and MQTT threading fixes improved stability. Additional observations identified GPIO pins controlling LEDs and buttons, with some devices showing always-on red LEDs regardless of relay state. The BSD34 plug shares hardware similarities with CBS2 modules and is sold under various brands like Ledlux and SURFOU. Testing confirmed LN882H devices can reconnect to WiFi after temporary outages, though behavior varies. The community continues refining firmware and drivers to enhance device reliability and feature support.
Generated by the language model.

FAQ

TL;DR: Dumping the 2 MB LN882H flash over UART takes ~30 minutes, yet “one of the world’s first LN882H flashing tutorials” now exists [Elektroda, p.kaczmarek2, post #20935396] Why it matters: DIYers can reclaim BSD34 smart plugs for open-source firmware and precise power metering.

Quick Facts

• Rated current: 20 A relay, BL0937 metering IC [Elektroda, divadiow, post #20935260] • MCU/Module: Lightning LN882HKI on Tuya WL2S or CB2S boards [Elektroda, divadiow, post #20935260] • Flash size: 2 MB cap confirmed by dump script [Elektroda, divadiow, post #20935260] • Latest tested OpenBeken builds: 1.17.454 → 1.17.521 [Elektroda, divadiow, #20953393; beloborodom, #21021494] • Home-Assistant: MQTT discovery publishes 8 entities in <2 s [Elektroda, divadiow, post #20954030]

Which GPIOs do I need for a working BSD34 template?

Use A0=LED, A3=Btn, A10=LED_n (blue), A11=Rel, plus BL0937 pins A7, A12, A19 for CF1, CF, SEL respectively [Elektroda, divadiow, post #20935260]

Why is the red LED always on after flashing?

Your unit likely wires the red LED to GPIO 23 as WiFi status. Map it as WifiLED and map the blue LED (GPIO 8) as LED_n; the red LED will turn off when WiFi connects [Elektroda, andraskszabo, post #21433856]

Can I flash WL2S/CB2S without desoldering?

Yes. Solder three wires (TX, RX, GND) and ground A9/BOOT while powering with 3.3 V. Many users reported reliable in-situ flashing [Elektroda, andraskszabo, post #21431813]

What is the quickest safe way to open the BSD34 housing?

  1. Clamp just below the rim, tighten until glue cracks. 2. Rotate clamps, repeat. 3. Unscrew the single PCB screw and lift the board; only the earth wire remains attached [Elektroda, divadiow, post #20935260]

BL0937 reading shows zeros—how do I enable the driver?

Compile OpenLN882H with drv_bl0937.c, drv_bl_shared.c, and add them plus drv_ntp.c to CMakeLists.txt. After merging PR #5 and #1054, binaries ≥1.17.454 read power correctly [Elektroda, max4elektroda, post #20946708]

How long should flash dumping take?

Typical duration is 15–40 minutes at the fixed UART speed. One user saw several hours until a Windows reboot cut the time to 15 minutes [Elektroda, p.kaczmarek2, post #20935396]

Does the plug reconnect after a long WiFi outage?

Yes. Tests with a 20-minute AP blackout showed both LN882H devices reconnect within seconds and keep uptime counters intact [Elektroda, divadiow, post #21021470]

Edge-case: Ping-watchdog disables WiFi and never recovers—fix?

Upgrade to ≥1.17.517. LWIP threading and MQTT buffer patches stop the ERR_MEM loop and watchdog now restarts WiFi correctly [Elektroda, beloborodom, #21021494; p.kaczmarek2, #21021691].

How do I calibrate voltage and current quickly?

Run startDriver BL0937, attach a known 60 W load, then issue: 1.PowerSet 60, 2.VoltageSet 230, 3.CurrentSet 0.26. Save settings; readings align within ±2 % [Elektroda, max4elektroda, post #20946777]

Is the plug fully discoverable in Home-Assistant?

Yes. mqttDiscovery 2 advertises 1 switch, 5 sensors, and RSSI. Publishing eight JSON configs finishes in under two seconds with no memory errors [Elektroda, divadiow, post #20954030]
Generated by the language model.
ADVERTISEMENT