logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/CB2S/BL0937] Wifi Smart Plug with Energy Measurement (RMC021)

Raufaser 13749 47
Best answers

How can I calibrate the BL0937 current and power readings on this BK7231N smart plug accurately without unsafe live measurements?

Calibrate it by using interrupts to count CF and CF1 pulses instead of reading single pulses with `digitalRead()`, then adjust the coefficients against known reference loads or a trusted meter [#21273841] The recommended approach is to attach one interrupt to CF and one to CF1, increment a volatile counter in each ISR, and every second read/reset the counters so you can estimate pulses per second and tune the calibration values [#21273841] Do not use the blocking `digitalRead`/pulse-wait loop for metering, because it is imprecise and blocks program execution [#21273841] The OpenBK BL0937 driver and the ESP library linked in the thread show the same general approach and can be used as references for the calibration logic [#21273631]
Generated by the language model.
ADVERTISEMENT
  • Helpful post
    #1 20991558
    Raufaser
    Level 10  
    Posts: 47
    Help: 3
    Rate: 15
    [BK7231N/CB2S/BL0937] Wifi Smart Plug with Energy Measurement (RMC021)

    I bought this smart plug for very cheap in a big chinese online warehouse.

    Close-up of the back of a Wi-Fi smart plug with technical details and certifications.

    I disassembled it and figures out it has a BK7231N / CB2S chip. And a BL0937 for energy measurement.
    I tried to commuincate with the CB2S still in place. But it turned out that the switch and some stuff interfered with the RX path. I didn't want to cut any path so i desoldered the whole CB2S. Flashed it seperately. And but everything back together.
    I flashed the version 1.17.493 with Easy UART Flasher.

    CB2S module with connected wires Close-up of a blue electronic module with attached wires. View of a smart plug circuit board with electronic components. Close-up of the internal components of a smart plug with a visible integrated circuit.

    I also dumped the orignial firmware. readResult...-39-15.zip (1.06 MB)You must be logged in to download this attachment.

    Here is the extracted config from the original firmware

    {
    	"sel_pin_pin":"24",
    	"rl1_lv":"1",
    	"bt1_pin":"10",
    	"net_trig":"2",
    	"jv":"1.0.5",
    	"netled1_lv":"0",
    	"netled_reuse":"1",
    	"bt1_type":"0",
    	"ffc_select":"0",
    	"vi_pin":"6",
    	"resistor":"1",
    	"over_cur":"17000",
    	"bt1_lv":"0",
    	"reset_t":"3",
    	"netled1_pin":"8",
    	"chip_type":"0",
    	"lose_vol":"80",
    	"over_vol":"280",
    	"module":"CB2S",
    	"ele_pin":"7",
    	"ch_cddpid1":"9",
    	"ch1_stat":"2",
    	"rl1_type":"0",
    	"ch_num":"1",
    	"ele_fun_en":"1",
    	"rl1_pin":"26",
    	"vol_def":"0",
    	"ch_dpid1":"1",
    	"sel_pin_lv":"1",
    	"crc":"7",
    	"bv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.4",
    	"pk":"keyjup78v54myhan",
    	"firmk":"keyjup78v54myhan",
    	"cadv":"05",
    	"cdv":"1.0.0",
    	"dev_swv":"1.1.17",
    	"s_id":"null",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"1",
    	"mst_tp_0":"9",
    	"mst_ver_0":"1.1.17",
    	"mst_tp_1":"0",
    	"mst_ver_1":"null",
    	"mst_md5_1":"null",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"mst_md5_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"nul0abi",
    	"id":"bf847d9d9bcc6ef2ed0l2q",
    	"swv":"1.1.17",
    	"mtruer_0":"1.0.5",
    	"mst_md5_0":"febf39e119105090f91b2184eeda92cb",
    	"mst_md5_3":"null }de",
    	"property":"{min",
    	"max":"86400",
    	"scale":"0",
    	"step":"1",
    	"type":"value}"
    }


    Device configuration, as extracted from Tuya: 
    - BL0937 SEL on P24
    - Button (channel 1) on P10
    - BL0937 VI on P6
    - WiFi LED on P8
    - BL0937 ELE on P7
    - Relay (channel 1) on P26
    Device seems to be using CB2S module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424


    I already setup OpenBeken to connect to my local wifi network and i was able to load the driver for the BL0937. Calibration for Voltage was no problem. I am not sure how to calibrate current and power without electrocuting myself ;) But so far my 60W heating bulb shows 60W and my 7.5W LED bulb shows 7.5W. So i guess it is accurate enough :)

    I ordered 3 more plugs from the chinese web warehouse for a total of 10€ ... I hope they are flashable too.

    Webapp JSON
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Wifi Smart Plug with Energy Measurement",
      "model": "RMC021",
      "chip": "BK7231N",
      "board": "CB2S",
      "flags": "1024",
      "keywords": [
        "power metering",
        "smart plug",
        "bl0937"
      ],
      "pins": {
        "6": "BL0937CF1;0",
        "7": "BL0937CF;0",
        "8": "WifiLED_n;0",
        "10": "Btn;1",
        "24": "BL0937SEL;0",
        "26": "Rel;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/4143902500_1709667653.webp",
      "wiki": "https://www.elektroda.com/rtvforum/topic4040624.html"
    }
  • ADVERTISEMENT
  • #2 20991634
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Thank you for your submission. We have few sockets from RMC family on our list here:
    https://openbekeniot.github.io/webapp/devicesList.html
    but not yet the RMC021.

    Still, can you also include the OBK JSON template from the Web App?
    Helpful post? Buy me a coffee.
  • #3 20991901
    Raufaser
    Level 10  
    Posts: 47
    Help: 3
    Rate: 15
    I did. I hope that is what you meant.
  • #4 20992524
    Raufaser
    Level 10  
    Posts: 47
    Help: 3
    Rate: 15

    Are all informations included needed to add it to the device list? Or is still something missing?
  • #5 20992590
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Well, you should fill the fields of image and the topic link, but I can do it myself as well. I will add the device in a moment.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 21068306
    150219v8
    Level 2  
    Posts: 46
    Help: 1
    Rate: 3

    Here you can see an easy way to open this kind of device.




  • #7 21068364
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Opening LSPA9 plug with a door, that's a very unexpected but yet also interesting thing to see
    Helpful post? Buy me a coffee.
  • Helpful post
    #8 21092497
    12th23poiuzzz
    Level 4  
    Posts: 8
    Help: 1
    Rate: 1

    Great job Raufaser!
    Works fine with the first of my 5 devices.
    I first tried this: https://www.brunweb.de/using-a-aldi-workzone-wifi-smart-socket-without-tuya-cloud/ with these settings:
    P6 (PWM0) -> BL0937CF1
    P7 (PWM1) -> BL0937CF
    P8 (PWM2) -> BL0937SEL
    P11 (TXD1) -> WifiLED (or another LED functionality as you wish)
    P24 (PWM4) -> Rel 0
    P26 (PWM5) -> Btn 0 0
    Although PCB looks the same without success.

    Only reading the original firmware did not work.

    BTW: I use Linux Mint. BK7231Flasher works fine using Mono: https://github.com/openshwprojects/BK7231GUIFlashTool
  • #9 21092515
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Can you share the template in JSON format, so we can add it here:
    https://openbekeniot.github.io/webapp/devicesList.html
    Is this image (from linked site) a correct image for your device?
    The image shows a smart Wi-Fi switch with labels and technical specifications.
    Helpful post? Buy me a coffee.
  • #10 21092556
    12th23poiuzzz
    Level 4  
    Posts: 8
    Help: 1
    Rate: 1
    Short tut using Mint and 2104 FTDI-adapter

    - desolder the CB2S-Module
    - connect 4 pins:
    Rx-Rx
    Tx-Tx
    3V3-3V3
    GND-GND
    Find more: https://developer.tuya.com/en/docs/iot/cb2s-module-datasheet?id=Kafgfsa2aaypq

    - start BK7231Flasher.exe
    - set chiptype (BK 7231N) and firmware
    - set 921600 baud
    - find port using: sudo ls /dev/ttyUSB* in Mint terminal
    - set port
    - "Do firmware write (no backup) " with BK7231Flasher and follow the instructions. A backup of the original firmware did not work for me.

    Find and connect 7231s network and type http://192.168.4.1 in your browser (https did not work here). I did use my smartphone, Mint did not show the access.
    The OpenBK website should appear.
    Find "Execute custom command“ and enter: startDriver BL0937 to use the power monitoring feature.

    - configure Module:
    P6 - BL0937CF1
    P7 - BL0937CF
    P8 - WiFiLED
    P10- Button
    P24- BL0937SEL
    P26- Relay

    Configure WiFi, MQTT etc.
    Solder and screw and glue everything as it was.
    Then adjust your device with VoltageSet, CurrentSet, PowerSet and be happy.

    cu
  • #11 21092994
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    12th23poiuzzz wrote:

    - "Do firmware write (no backup) " with BK7231Flasher and follow the instructions

    I would still suggest doing backup (firmware read, 2MB) first
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #12 21093250
    12th23poiuzzz
    Level 4  
    Posts: 8
    Help: 1
    Rate: 1
    12th23poiuzzz wrote:
    Can you share the template in JSON format, so we can add it here:
    https://openbekeniot.github.io/webapp/devicesList.htmlIs this image (from linked site) a correct image for your device?


    Its not my site. So I can't provide the template. The author uses BK7231Flasher with its image, IMHO.

    Hinzugefügt nach 1 [Stunden] 11 [Minuten]:

    p.kaczmarek2 wrote:
    12th23poiuzzz wrote:

    - "Do firmware write (no backup) " with BK7231Flasher and follow the instructions

    I would still suggest doing backup (firmware read, 2MB) first


    A backup of the original firmware did not work for me:

    Backup name is set to aaaa.
    Starting read!
    Now is: Donnerstag, 23. Mai 2024 14:57:06.
    Flasher mode: BK7231N
    Going to open port: /dev/ttyUSB0.
    Serial port open!
    Getting bus... (now, please do reboot by CEN or by power off/on)
    Getting bus failed, will try again - 0/100!
    Getting bus success!
    Going to set baud rate setting (921600)!
    Will try to read device flash MID (for unprotect N):
    Flash MID loaded: 1560EB
    Will now search for Flash def in out database...
    Flash def found! For: 1560EB
    Flash information: mid: 1560EB, icName: TH25Q_16HB, manufacturer: TH, szMem: 1000000, szSR: 2, cwUnp: 0, cwEnp: 7, cwMsk: 407C, sb: 2, lb: 5, cwdRd: 05-35-FF-FF, cwdWr: 01-FF-FF-FF
    Entering SetProtectState(True)...
    sr: 0
    sr: 0
    final sr: 0
    msk: 407c
    cw: 0, sb: 2, lb: 5
    bfd: 0
    SetProtectState(True) success!
    Going to start reading at offset 0x00...
    Reading 0x00... failed with serial.BytesToRead 4073 (expected 4111)
    The beginning of buffer in UART contains 040EFF01E0FCF4061009000000200069 data.
    Failed! There was no result to save.
  • #13 21107616
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Backup process is using the same mechanics as the write process so it's very strange. I'd suggest just retrying. You can also play with timeout/retry settings in advanced tab.
    Helpful post? Buy me a coffee.
  • #14 21109164
    tun0
    Level 7  
    Posts: 12

    Out of curiosity: how did you manage to desolder the CB2S module? I tried to do so on 2 out of the 5 I ordered, and managed to lift at least one pad before getting any movement in the CB2S module. Tried adding flux, adding solder, solder sucker, solder wick and now running out of ideas. Even though these are darn cheap, ruining them still seems like a waste.
  • #15 21109289
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Well, I desoldered hundreds of CB2S/WB2S modules already. You can check out the process on one of our videos:


    Helpful post? Buy me a coffee.
  • #16 21109572
    tun0
    Level 7  
    Posts: 12

    The approach outlined in the video looks pretty similar to my attempts. My takeaways: lower the iron's temperature and perhaps buy a better quality solder wick. Which temperature do you tend to use?
  • #17 21126827
    tun0
    Level 7  
    Posts: 12
    Quick update: did manage to desolder a CB2S module from the socket the other day. However, I'm still struggling getting the flasher to see the device. Wondering if I either damaged the CB2S or perhaps my USB-to-UART dongle isn't suited (or broken). Guess I'll see if I can solder the CB2S back to the socket using wires safely, to see if it'd still work like that.
  • #18 21127144
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    I'm trying to keep low temperature, on my KSGER I use 350C.

    How your flashing setup looks like?
    Helpful post? Buy me a coffee.
  • Helpful post
    #19 21135558
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3
    I got a variant with a wb2s inside from aliexpress
    Electronic module of a smart plug from AliExpress on a wooden background. White smart plug with technical markings, lying on a wooden surface. Close-up of an electronic module with a JIEYING integrated circuit mounted on a green PCB, held by a metal tool. Close-up of a PCB with electronic components.

    It's a RMC-001 according to the manual
    and here is the template
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Generic smart plug ",
      "model": "RMC001",
      "chip": "BK7231T",
      "board": "WB2S",
      "flags": "1024",
      "keywords": [
        "Smart plug",
        "WB2S"
      ],
      "pins": {
        "6": "WifiLED_n;0",
        "7": "BL0937CF;0",
        "8": "BL0937CF1;0",
        "10": "Btn;1",
        "24": "BL0937SEL;0",
        "26": "Rel;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/6770753400_1719571790_thumb.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=21135558#21135558"
    }
    
    Attachments:
    • readResult_BK7231T_QIO_smart-plug-wb2s_2024-26-6-09-16-16.bin (2 MB) You must be logged in to download this attachment.
  • #20 21140313
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Helpful post? Buy me a coffee.
  • #21 21144039
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3
    >>21140313
    thanks, I just have a problem with one of the 3 plugs i bought: the power output doesn't work, i mean i can clearly hear the relay being triggered on/off but no power output at all. other than this it's working perfectly so i'd just like to know if there is a way to fix or if it's too bothersome

    just forgot to add that i damaged it a little while soldering with my little brother: Damaged electronic plug with visible soldering mark.
    would this be enough to break it?
  • #22 21144189
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    It seems that your relay is damaged. You can consider replacing it.
    Helpful post? Buy me a coffee.
  • #23 21145065
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3
    Ok thanks for the quick reply it was just to confirm.
  • ADVERTISEMENT
  • #24 21147668
    tun0
    Level 7  
    Posts: 12
    Today I gave it another try with a fresh cp2102. However, I'm getting the same results: not being able to "get bus".

    USB to TTL adapter with wires connected to a module on a laptop keyboard. USB adapter with black, red, orange, yellow, green, and blue wires. Electronic circuit with attached wires in blue, green, yellow, and orange colors.

    Guess there's not much left other than trying to see if the cb2s still functions as part of the socket. Or, do yet another attempt at desoldering using another socket.
  • #25 21147683
    divadiow
    Level 38  
    Posts: 4868
    Help: 424
    Rate: 863
    it looks like your RX on module goes to RX on USB-TTL. It needs to be RX->TX, TX->RX, swap them at usb end.
  • #26 21147726
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    What kind of LDO is used on this device? I don't think it can provide enough current. How do you reboot device? By disconnecting VDD?
    Helpful post? Buy me a coffee.
  • #27 21147776
    tun0
    Level 7  
    Posts: 12
    divadiow wrote:
    it looks like your RX on module goes to RX on USB-TTL. It needs to be RX->TX, TX->RX, swap them at usb end.


    I tried with both RX-TX/TX-RX and RX-TX/TX-RX. Do see a slight difference in behavior of the LEDs, but not really obvious enough to tell which one's correct. One of the earlier posts did mention RX-TX/TX-RX though.

    p.kaczmarek2 wrote:
    What kind of LDO is used on this device? I don't think it can provide enough current. How do you reboot device? By disconnecting VDD?


    Good question, no idea really. Do you have a recommendation for a suitable USB to UART device?
    And yes, disconnecting VDD.
  • #28 21147801
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    Ok first, can you show us the second side of your USB to UART covnverter? Is there any LDO at all?
    Helpful post? Buy me a coffee.
  • #29 21148187
    tun0
    Level 7  
    Posts: 12
    p.kaczmarek2 wrote:
    Ok first, can you show us the second side of your USB to UART covnverter? Is there any LDO at all?


    The one I tried yesterday (red) appears to be very simple with nothing on the bottom. The one I tried before (blue) is quite a bit more complex:

    Two USB adapters on a white background. The top adapter is red, the bottom one is blue. Two USB-TTL converter modules, one red and one blue, on a white background.
  • #30 21148728
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14430
    Help: 650
    Rate: 12399
    None of those look promising. Still, what are those 3 soic chips at the bottom of the blue one?
    Helpful post? Buy me a coffee.

Topic summary

✨ The discussion centers on the RMC021 WiFi smart plug featuring a BK7231N/CB2S chip and a BL0937 energy measurement IC. Users shared experiences with disassembling the device, desoldering the CB2S module to enable flashing with OpenBK firmware using BK7231Flasher on Linux Mint, and challenges related to RX/TX line interference and USB-to-UART adapter compatibility. Several contributors provided detailed pin configurations for BL0937 integration, flashing procedures, and JSON templates for device inclusion in OpenBekenIOT device lists. Alternative firmware approaches include ESPHome and Tasmota on ESP8266 modules replacing the CB2S, with calibration challenges for voltage and current measurement pulses from BL0937. Advanced users developed custom Arduino IDE code for pulse counting via interrupts to improve measurement accuracy. Additional features from the original Tuya firmware such as power data clearing, relay status modes, light modes, overcharge protection, and child lock were discussed with references to OpenBK commands, scripting, and flags to replicate these functions. The conversation also covered hardware repair advice for damaged relays and desoldering techniques, as well as suggestions for integrating the smart plug with home automation platforms like Home Assistant and Domoticz.
Generated by the language model.

FAQ

TL;DR: For cheap RMC021-style smart plugs, a 10€ for 3 plugs OpenBeken conversion is practical: one user said it flashed "smooth as butter" after removing the CB2S, setting the correct BL0937 pins, and calibrating voltage, current, and power. This FAQ helps anyone replacing Tuya firmware on BK7231N/CB2S plugs with energy metering. [#21275404]

Why it matters: This thread turns a low-cost Tuya plug into a documented OpenBeken, ESPHome, or ESP8266 conversion path with known pins, failure modes, and calibration methods.

Option Hardware path Energy metering status Main caveat
OpenBeken on CB2S/BK7231N Flash original module Working with BL0937 driver In-circuit UART often fails
ESPHome on CB2S OTA upload reported Relay/LED/button worked, BL0937 read 0 Metering config/pulse handling issue
Tasmota on ESP02S/TYWE2S Replace Tuya module Working after calibration Needs rewiring and module swap
Custom ESP8266 code Replace Tuya module Working after interrupt-based counting More firmware work required

Key insight: The plug is usable and well-mapped, but UART flashing usually becomes reliable only after desoldering the CB2S. Once flashed, the known BL0937, relay, button, and LED pins make setup straightforward.

Quick Facts

  • Confirmed RMC021 mapping for the BK7231N/CB2S version is: P6=BL0937CF1, P7=BL0937CF, P8=WiFiLED, P10=Button, P24=BL0937SEL, P26=Relay. [#20991558]
  • One user bought 3 additional plugs for a total of 10€, showing these Tuya-based energy plugs are often cheaper than branded alternatives. [#20991558]
  • A practical desoldering target temperature reported by an experienced contributor was 350°C on a KSGER station for CB2S/WB2S modules. [#21127144]
  • Reported calibration and protection values in custom ESP8266 code included 2300 W max load, 0.1207 voltage factor, and 1.3302 power factor. [#21275863]

How do I flash an RMC021 smart plug with a BK7231N/CB2S module and BL0937 power meter using OpenBeken?

Flash it by removing the CB2S, programming it externally, then restoring it to the board. 1. Desolder the CB2S and connect 3.3V, GND, RX, and TX to a USB-UART adapter. 2. Use Easy UART Flasher or BK7231Flasher for BK7231N, then boot OpenBeken and open http://192.168.4.1. 3. Assign P6=BL0937CF1, P7=BL0937CF, P8=WiFiLED, P10=Button, P24=BL0937SEL, P26=Relay, then run startDriver BL0937. [#21092556]

Why does flashing the CB2S in-circuit fail on this smart plug, and why does desoldering the module often make UART flashing work?

In-circuit flashing fails because the plug board can load or disturb the UART lines, especially RX. The first report says the switch circuitry and other parts interfered with the RX path, so the module was fully removed instead of cutting traces. After desoldering, flashing worked, the original firmware was dumped, and OpenBeken was installed successfully. That makes desoldering the cleanest path when UART access is unstable on this board. [#20991558]

What is the BL0937 chip, and how does it measure voltage, current, and power in a smart plug?

"BL0937 is a power-metering IC that outputs pulse signals for mains measurements, using one pin for power and another multiplexed pin for voltage or current." In this plug, CF carries power pulses, CF1 carries voltage or current depending on SEL, and OpenBeken uses a dedicated BL0937 driver. The thread repeatedly confirms voltage calibration is easy, while current and power need load-based calibration. [#21512528]

What is a CB2S or WB2S module, and how does it relate to BK7231N and BK7231T devices?

"CB2S or WB2S is a Tuya Wi-Fi module board that hosts a Beken SoC, exposes GPIOs to the appliance PCB, and can be replaced or reflashed for custom firmware." In this thread, the RMC021 uses CB2S with BK7231N, while a related RMC001 variant uses WB2S with BK7231T. Both modules appear across RMC-family plugs, but the pin map can differ between board variants. [#21135558]

Which GPIO pins should I assign in OpenBeken for the RMC021 smart plug with BK7231N, CB2S, and BL0937?

Use the OpenBeken template with six active assignments. Set GPIO6 to BL0937CF1, GPIO7 to BL0937CF, GPIO8 to WifiLED_n or WiFiLED, GPIO10 to Btn, GPIO24 to BL0937SEL, and GPIO26 to Rel. This exact JSON template was posted for the RMC021 and matched the extracted Tuya configuration. If you copy another RMC-family plug template, verify the LED and BL0937 pins first. [#20991558]

What’s the proper way to calibrate voltage, current, and power readings on a BL0937-based OpenBeken smart plug?

Calibrate with known loads and use the OpenBeken correction commands. One user got acceptable results when a 60 W heating bulb read 60 W and a 7.5 W LED bulb read 7.5 W, then fine-tuned with VoltageSet, CurrentSet, and PowerSet. Start with voltage, because it is easiest to verify. Then use a stable resistive load for current and power, not a vague household device. [#21092556]

How can I back up the original Tuya firmware from a BK7231N plug when BK7231Flasher fails during the read process?

Retry the backup first, because the read path should use the same mechanics as flashing. One failed read showed Reading 0x00... failed after detecting flash MID 1560EB, even though write operations had worked. The maintainer advised trying again and adjusting timeout or retry values in the advanced tab. If backup still fails, keep the extracted Tuya config, because it preserves the key pin mapping. [#21107616]

What reply delay, timeout, or retry settings help when BK7231Flasher cannot reliably read or flash a CB2S module?

A reply delay of 5 was explicitly reported to fix a stubborn CB2S flashing case. Another user wrote that flashing problems disappeared after removing the module and setting reply delay to 5. The maintainer also suggested experimenting with timeout and retry values in BK7231Flasher’s advanced settings when reads fail. Use these adjustments only after confirming wiring and power are correct. [#21275404]

Why does BK7231Flasher get stuck on "get bus" with a CB2S module, and how do RX/TX wiring and USB-to-UART power quality affect it?

“Get bus” usually fails because wiring is wrong, reboot timing is wrong, or the USB-UART adapter cannot supply clean 3.3 V current. The thread caught at least one wiring mistake where RX was connected to RX instead of crossing RX-TX and TX-RX. The maintainer also questioned the adapter’s LDO quality and whether the device was rebooted by disconnecting VDD. Weak adapters can flash inconsistently even when the module itself is fine. [#21147683]

What soldering temperature and technique work best for desoldering a CB2S or WB2S module without lifting pads?

Use a relatively low iron temperature and remove solder patiently from all pads before lifting the module. An experienced contributor said, “I’m trying to keep low temperature, on my KSGER I use 350C.” The thread also mentions flux, braid, and careful wick work. If pads start lifting, stop pulling and clear more solder first. Mechanical force damages these cheap plug PCBs faster than heat does. [#21127144]

How do OpenBeken, ESPHome, and Tasmota compare for converting Tuya smart plugs with BL0937 energy monitoring?

OpenBeken is the most complete path shown here for the original CB2S hardware, because the posted pin map and BL0937 driver worked on the RMC021. ESPHome booted on CB2S by OTA, but one report had relay, LED, and button working while BL0937 stayed at zero. Tasmota worked after replacing CB2S with an ESP02S and recalibrating voltage from 298 V down to 228 V. Choose OpenBeken for least hardware change, or Tasmota if you already prefer ESP8266. [#21297547]

Which ESP8266 replacement modules can take the place of a CB2S or WB2S board in these RMC-family smart plugs, and what extra wiring is needed?

TYWE2S and ESP02S were explicitly named as compatible replacement modules. For a full ESP8266 conversion, one user mapped button to GPIO0, SEL to GPIO12, relay to GPIO15, CF1 to GPIO4, CF to GPIO5, and LED to GPIO2, with 3.3 V and GND carried over. Another report noted that an ESP8266MOD also worked, with EN pulled up by 10 kΩ and GPIO15 pulled down by 10 kΩ. [#21148742]

Why does the BL0937 sensor in ESPHome show all zeros on a CB2S-based plug even when the relay, LED, and button work?

The most likely cause is metering configuration, not the basic GPIO setup. In the posted ESPHome config, relay, LED, and button all worked, but the hlw8012 sensor for model BL0937 returned zeros. The thread’s follow-up points to calibration and correct CF, CF1, and SEL handling as the critical part. If your pin map is right, confirm SEL polarity, pulse activity on CF/CF1, and whether your firmware actually toggles the measurement mode correctly. [#21275404]

How should I measure BL0937 CF and CF1 pulses on ESP8266 for accurate readings, and why are interrupts better than digitalRead polling?

Use interrupts and count pulses over time instead of polling with digitalRead. The maintainer called polling “bad, imprecise and blocks program execution” and recommended attaching GPIO interrupts once to CF and CF1, incrementing counters in the ISR, then reading counts every second and calibrating pulses per second. That method stabilized a custom ESP8266 build and avoided single-pulse timing noise. It also leaves enough CPU time for Wi-Fi, web UI, and relay control. [#21273841]

How can I expose OpenBeken features like clear power data, relay startup state, LED mode, overcharge auto-off, and child lock to Home Assistant as buttons or controls?

Expose them through OpenBeken commands, startup settings, pin roles, and scripts, then surface those actions in Home Assistant. The maintainer confirmed there is a command for clearing power data, a startup GUI and command for relay state, LED modes such as AlwaysHigh, AlwaysLow, LED, LED_n, and WiFiLED, script examples for threshold-triggered energy actions, and a flag for child lock. The thread stops short of a finished HA dashboard, but the control primitives already exist in OpenBeken. [#21512528]
Generated by the language model.
ADVERTISEMENT