logo elektroda
logo elektroda
X
logo elektroda

[BK7231N+BL0942] DIY Smart Mini Switch - WBP-1G - configuration, pinout, program

piratee 15441 51
Best answers

What is the correct pinout and flashing/configuration for this BK7231N + BL0942 DIY Smart Mini Switch (WBP-1G)?

This device appears to use a CB2S module with a BK7231N chip, and one firmware dump maps the pins as relay on P7, button/pair on P23, toggle input on P6, Wi‑Fi LED on P26, and BL0942 on UART1 (P10/P11) [#20495963][#21759109] A later dump from a different revision suggested relay on P26, Wi‑Fi LED on P8, pairing button on P23, toggle input on P24, with BL0942 still on P10/P11, so check your board revision against its dump [#20521756][#21759109] For reading the flash, use the GUI flasher on Windows or a full 2 MB read; with uartprogram on BK7231N you also need unprotect and offset 0x0, and the length should be `-l 0x200000` [#20495547][#20495725] After flashing OpenBeken, enable PowerSave 1 and calibrate the BL0942 in the web app/tools if needed [#20522408][#21759109]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 20522408
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14388
    Help: 650
    Rate: 12308
    From what I can see, it was from him that a pull request appeared to increase the precision of BL0942:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/760
    But I'm just going to verify it.

    Don't forget to turn on PowerSave on this Aubess or else you'll be doing this:
    https://www.elektroda.pl/rtvforum/topic3898805.html
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 20522473
    piratee
    Level 13  
    Posts: 69
    Rate: 2
    Board Language: polish
    PowerSave run together with energy metering and ntp server? single line command?
  • ADVERTISEMENT
  • #33 20522566
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14388
    Help: 650
    Rate: 12308
    Yes, but you can do it in autoexec.bat as well
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #34 20522567
    piratee
    Level 13  
    Posts: 69
    Rate: 2
    Board Language: polish
    how to enter the NTP time offset to work after reboot in the block with ntp and bl0942 running?

    ntp_timeZoneOfs +2
  • #35 20522640
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14388
    Help: 650
    Rate: 12308
    Normally in the backlog, rather without +, just:
    
    ntp_timeZoneOfs 2
    

    And it doesn't work?

    If you want to subtract, then with a minus.
    Helpful post? Buy me a coffee.
  • #36 20522669
    piratee
    Level 13  
    Posts: 69
    Rate: 2
    Board Language: polish
    When I typed +2 it didn't work, now it's ok
    And you will also implement summer/winter automation.
    I am asking because I see that the options in the project are developing dynamically.

    Regards
  • ADVERTISEMENT
  • #37 20527971
    piratee
    Level 13  
    Posts: 69
    Rate: 2
    Board Language: polish
    I have another question, if I read the firmware, can I determine which pinout is on my own.
    Do I need to have any software or decompile the firmware?
  • #38 20528004
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14388
    Help: 650
    Rate: 12308
    There's a python tool for that but you need to have it all installed, better put dunks here, I'm still helping out every morning, day and night.

    Hmm, you could do automatic time switching, it's not a problem, but I'd have to look for a table so that I don't have to enter it in the code. But I admit in advance - I haven't checked yet.

    Recently, I updated the documentation again and moved it from README (because it shouldn't be there) to JSON files to be able to autogenerate MDs and so on.
    Helpful post? Buy me a coffee.
  • #39 21759055
    sp8tlh1
    Level 6  
    Posts: 7
    Board Language: polish
    Hello, I am having a problem defining the switch configuration correctly. I am sending a copy of the original batch.
    Attachments:
    • readResult_BK7231N_QIO_openbnk_2025-22-11-12-49-22.bin (2 MB) You must be logged in to download this attachment.
  • #40 21759109
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14388
    Help: 650
    Rate: 12308
    
    Device seems to be using CB2S module, which is BK7231N chip.
    - Relay (channel 1) on P7
    - WiFi LED on P26
    - TglChannelToggle (channel 1) on P6
    - Pair/Toggle All Pin on P23
    - BL0942 (?) RX on P10
    - BL0942 (?) TX on P11
    

    Template OBK:
    Code: JSON
    Log in, to see the code

    Remember to calibrate, as in Tasmot, VoltageSet, etc., possibly via the web App under Tools.

    Can you show a picture of your unit?

    Also enable PowerSave 1 (in startup command add).
    Helpful post? Buy me a coffee.
  • #41 21759252
    sp8tlh1
    Level 6  
    Posts: 7
    Board Language: polish
    Thank you very much for your quick reply. I have another module of the same kind to reprogram and have checked how it works. Pressing the button on the housing switches the relay on and the same button switches the relay off. The LED lights up depending on the state of the relay. After entering this configuration, I can only switch the relay on via the browser and the LED does not respond to the relay status.

    Added after 32 seconds:

    Electronic module with visible SMD components on a PCB board. Mini smart switch with power monitoring and screw terminals
  • #42 21760306
    sp8tlh1
    Level 6  
    Posts: 7
    Board Language: polish
    Everything already works as it did in the original before the software change. I can switch the relay physically with a button. To make it work for others starting out with the OpenBk software.
    Go into Configure General/Flags disable the Flag 41 item - [BTN] Ignore all button events (aka child lock), give Submit and Save. And it should work.
    I'm glad I managed it myself.
  • #43 21760314
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14388
    Help: 650
    Rate: 12308
    Sorry, I must have missed this post. Did you have the childlock flag enabled? Maybe something clicked earlier or the template imported wrong.
    Helpful post? Buy me a coffee.
  • #44 21761197
    sp8tlh1
    Level 6  
    Posts: 7
    Board Language: polish
    There is nothing to apologise for. I have learned something new. The pros alone, the module works
  • #45 21766227
    sp8tlh1
    Level 6  
    Posts: 7
    Board Language: polish
    How to enable NTP Driver and daily energy
  • #46 21767335
    sp8tlh1
    Level 6  
    Posts: 7
    Board Language: polish
    Hello, I have a problem with a module after adding to HA. HA module detects after MQTT and creates an entity. But the sensors have a status of unknown. I asked AI to diagnose and based on the log it stated:
    OpenBK publishes data on topic:
    tele/OpenBK_F85E000B6/ENERGY;
    And entities created by Discovery are listening on topic type:
    OpenBK_F85E000B6/voltage/get
    OpenBK_F85E000B6/energycounter/get
    OpenBK_F85E000B6/power/get
    OpenBK does not publish data on these topics, so the entities remain empty.
    BK7231N device panel in Home Assistant; sensors show “unknown” status
    Maybe some ideas on how to deal with this problem?
  • #47 21769452
    sp8tlh1
    Level 6  
    Posts: 7
    Board Language: polish
    Software version 1.18.221 now works without any problems.
    Home Assistant detects the module without any problems and updates all sensors.
  • #48 21811486
    miegapele
    Level 16  
    Posts: 173
    Help: 15
    Rate: 29
    Got this one too. It's great that it has power monitoring in live leg, so you can put in under switches without neutral going through. Also easy to change capacitors to better ones.
    Tuya firmware though seems to be changed, and not much is readable (or is it bad read?) and so, I do not know pinout, but likely same as above?

    Close-up of a green PCB with SMD components and a printed antenna trace
    Relay module with capacitors and terminal block on green PCB
    Wi-Fi smart switch with power monitor and labeled connection terminals
    Attachments:
    • readResult_BK7231N_QIO_2026-16-1-20-17-31.bin (2 MB) You must be logged in to download this attachment.
  • #49 21811511
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14388
    Help: 650
    Rate: 12308
    @divadiow and @insmod recently worked on improving GPIO detection, maybe it works with newer version of the flasher?
    Helpful post? Buy me a coffee.
  • #50 21811555
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    p.kaczmarek2 wrote:
    @divadiow and @insmod recently worked on improving GPIO detection, maybe it works with newer version of the flasher?


    extraction fails still even with the release with new methods added https://github.com/openshwprojects/BK7231GUIFlashTool/pull/100

    this failure is because of how much of the json EF is looking through - try https://github.com/divadiow/BK7231GUIFlashTool/actions/runs/21092821480

    Code: Text
    Log in, to see the code


    Screenshot of Easy Flasher app showing Tuya device configuration in JSON

    an example of:

    divadiow wrote:
    We've already seen users getting no extraction because EF doesn't show/match enough.
  • #51 21811634
    miegapele
    Level 16  
    Posts: 173
    Help: 15
    Rate: 29
    There is also BL0942 which app does not find. Online tool finds it:
    Device seems to be using CB2S module, which is BK7231N chip.
    - Relay (channel 1) on P7
    - WiFi LED on P26
    - TglChannelToggle (channel 1) on P6
    - Pair/Toggle All Pin on P23
    - BL0942 (?) RX on P10
    - BL0942 (?) TX on P11
    

    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "TODO",
      "model": "TODO",
      "chip": "BK7231N",
      "board": "CB2S",
      "keywords": ["switch", "power monitoring", "bl0942"],
      "pins": {
        "6": "TglChanOnTgl;1",
        "7": "Rel;1",
        "23": "Btn_Tgl_All;0",
        "26": "WifiLED_n;0"
      },
      "command": "startDriver BL0942",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
  • #52 21812126
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    miegapele wrote:
    There is also BL0942 which app does not find. Online tool finds it:

    hmm. hopefully something will change soon to sort/align all the extraction and parsing methods

    Added after 2 [hours] 28 [minutes]:

    >>21811634

    dump for this one pairs as device with name "WBP-1G" which can be seen in device list too

Topic summary

✨ The discussion revolves around the DIY Smart Mini Switch identified as WBP-1G, which features energy measurement capabilities. Users share insights on programming the device, including pin configurations and firmware reading techniques. The BK7231N chip is confirmed to be in use, with suggestions for using specific software tools like BK7231GUIFlashTool and uartprogram for firmware management. Users discuss the pinout for the BL0942 energy measurement chip, troubleshooting issues related to device connections, and the importance of proper voltage handling to avoid damage. The conversation also touches on MQTT integration for IP transfer and the functionality of the energy meter. A new version of the switch with a different design is introduced, and users share their experiences with the device's performance and configuration.
Generated by the language model.

FAQ

TL;DR: 55 % discount made the Aubess WBP-1G cost just 22.6 PLN, yet “It’s deadly dangerous!” if powered from two supplies at once [Elektroda, piratee, #20521865; p.kaczmarek2, #20504131]. Check pinout, read a full 2 MB dump, then flash OpenBeken.

Why it matters: Correctly flashing this BK7231N+BL0942 switch avoids device loss and mains hazards.

Quick Facts

• MCU: BK7231N, 2 MB flash required for full dump [Elektroda, p.kaczmarek2, post #20493204] • Energy chip: BL0942 on UART1 (P10/P11) [Elektroda, p.kaczmarek2, post #20495963] • Key GPIOs (variant 2): Relay P26, Button P23, LED P8, Ext-Switch P24 [Elektroda, p.kaczmarek2, post #20521756] • Safe supply: 3.3 V UART only; never mix with 110-240 V mains [Elektroda, p.kaczmarek2, post #20504131] • Typical price: 22–40 PLN incl. shipping on AliExpress [Elektroda, posts #20521878, post #20521865]

What chips are inside the DIY Smart Mini Switch (WBP-1G)?

The board carries a BK7231N Wi-Fi MCU and a BL0942 power-monitoring ADC, giving Wi-Fi control plus voltage, current and energy data [Elektroda, p.kaczmarek2, post #20495963]

How do I take a correct 2 MB firmware dump under Windows?

Use BK7231 GUI Flash Tool; it auto-sets size. With uartprogram, add “-l 0x200000” and unprotect for N versions [Elektroda, p.kaczmarek2, post #20495547]

Which GPIO pins control the relay, button and LED on the second-revision board?

Relay P26, Wi-Fi LED P8, Pairing Button P23, External toggle P24; BL0942 stays on UART1 (P10/P11) [Elektroda, p.kaczmarek2, post #20521756]

Can I program the module without soldering every pad?

Yes. Clip 3.3 V, GND, RX, TX to the vertical CB2S board and flash OpenBeken successfully, no full disassembly needed [Elektroda, piratee, post #20521909]

What’s the safe way to power the switch during flashing?

Power from a 3.3 V USB-UART only. Never connect mains while the programmer is attached; dual supply sparked and destroyed both switch and converter [Elektroda, piratee, #20596570; p.kaczmarek2, #20504131].

How can I enable PowerSave to cut idle draw by ~75 %?

Run command: PowerSave 1. Place it in autoexec.bat for persistence [Elektroda, p.kaczmarek2, post #20522566] A user measured 0.3 W vs 1.2 W after enabling “BL0942 Idle Study”.

Where can I buy the switch and what does it cost?

AliExpress lists the Aubess 16 A module from 22 PLN (promo) to 40 PLN with shipping, depending on seller variants [Elektroda, piratee, #20521865; p.kaczmarek2, #20521878].

How do I calibrate the BL0942 measurements?

Open the WebApp after flashing; a ready-made calibration form sets voltage, current and power factors without command line [Elektroda, p.kaczmarek2, post #20496001]

Is there an automated way to extract pin configuration from a firmware dump?

Yes. A Python tool parses OpenBeken NVRAM, but it needs the full environment; posting the 2 MB dump to the forum gets community decoding [Elektroda, p.kaczmarek2, post #20528004]

What happens if I read only 1 MB instead of 2 MB?

OpenBeken settings sit near the flash end. A 1 MB dump loses them, forcing manual pin discovery and risking boot failure “90 % of configuration guesswork arises from short dumps” [Elektroda, p.kaczmarek2, post #20495017]
Generated by the language model.
ADVERTISEMENT