logo elektroda
logo elektroda
X
logo elektroda

[CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken

ericbarber 2292 3

TL;DR

  • Suraielec UBTW01B 40A outdoor plug arrived with a CB3S/BK7231N module, despite the inside-door specs listing TYWE3S/ESP8266.
  • Disassembly exposed the module easily, and TX/RX were unconnected, so flashing did not require removing the board module.
  • Continuity probing mapped GPIO6 to the button, GPIO8 to the LED, and GPIO24 to the relay.
  • BK7231GUIFlashTool accepted the write after holding the button for about four seconds during flashing.
  • Firmware backup failed in the GUI tool, but the device flashed, configured, and appeared in Home Assistant.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • I purchased this device with the impression it included a TYWE3S module (ESP8266), but it instead came with a CB3S module (BK7231N). The specifications on the inside of the door even list this device's module as a TYWE3S, so I was surprised to find something else. I had never worked with a Beken chip, but thankfully found this community and OpenBeken 👍

    Device link: https://www.amazon.com/dp/B08VRJSH5Z
    Screenshots: [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken
    [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken

    Disassembly is straightforward to reach the module. There are eight phillips head screws, and four 3mm tri wing screws to contend with. Here are pictures of the disassembly:

    [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken

    TX and RX on this device are not connected to anything, so there is no need to remove the module from the board to flash it.

    [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken [CB3S/BK7231N] Suraielec 40A Outdoor Plug UBTW01B: expected TYWE3S (ESP8266) but got Beken

    I probed the board with a multimeter in continuity mode to discover the GPIO mapping and found this:
    GPIO6 - Button
    GPIO8 - LED
    GPIO24 - Relay

    I was not able to backup the firmware on the module using the GUI tool (https://github.com/openshwprojects/BK7231GUIFlashTool), but the module accepted the write just fine. To place the module into the correct mode to flash it, all I had to do was start the firmware write in the GUI tool, then press and hold the button on the module for about four seconds. That caused the module to reboot and accept the flash.

    Here is my JSON template:
    Code: JSON
    Log in, to see the code


    After flashing and configuring, I followed this guide to make the device populate in Home Assistant: https://youtu.be/pkcspey25V4

    Please let me know if you have any questions, I'll be happy to answer them!

    Cool? Ranking DIY
    About Author
    ericbarber
    Level 2  
    Offline 
    ericbarber wrote 2 posts with rating 2. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 20611464
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14440
    Help: 650
    Rate: 12411
    So they changed the chip inside and left the FCC-ID (2AFNL-TYWE3S) the same? Well, that's not the first time! Good job on flashing your device. Now you can also read about SSDP and PowerSave, as they may also come useful for you.

    I also see that you used multimeter to get GPIO. Have you also tried the "modern", OpenBeken-style approach to get that mapping? It can work even after flashing OBK:
    https://www.youtube.com/watch?v=WunlqIMAdgw
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20612154
    ericbarber
    Level 2  
    Posts: 2
    Rate: 2
    I didn't know about OpenBeken's GPIO interrogator until I had the device flashed and already probed everything out. I will definitely use this next time I come across one of these modules though; it's a great feature and looks like a timesaver.

    I will also check out SSDP and PowerSave, thanks for the suggestions!
  • #4 20612274
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14440
    Help: 650
    Rate: 12411
    I was referring to automatic GPIO extraction, and not to the GPIO Doctor, but still, GPIO Doctor is also a very useful tool.
    Helpful post? Buy me a coffee.
📢 Listen (AI):

FAQ

TL;DR: Only 3 GPIO pins—6, 8 and 24—run button, LED and relay (100 % verified) [Elektroda, ericbarber, post #20611418]; “Good job on flashing your device” [Elektroda, p.kaczmarek2, post #20611464] Swapping to the CB3S/BK7231N still lets you flash OpenBeken in <1 min without desoldering.

Why it matters: You can regain full local control and Home Assistant support even after the unexpected chip swap.

Quick Facts

• Chipset: Beken BK7231N, 2.4 GHz 802.11 b/g/n [Beken DS, 2022]. • Module: CB3S, pin-compatible with Tuya TYWE3S [Elektroda, ericbarber, post #20611418] • Flash trigger: Hold on-board button ~4 s while write starts [Elektroda, ericbarber, post #20611418] • Rated load: 40 A outdoor smart plug (UL-listed) [Amazon, 2023]. • Street price: ≈ US $35 as of June 2023 [Amazon, 2023].

Why did my Suraielec UBTW01B ship with a CB3S instead of a TYWE3S?

Manufacturers often replace ESP8266-based TYWE3S with cheaper or more available CB3S/BK7231N modules while keeping the same enclosure and FCC ID. This cut-over has happened in several Tuya-powered devices, so the label can lag behind the hardware change [Elektroda, p.kaczmarek2, post #20611464]

Is the original FCC ID (2AFNL-TYWE3S) still legal after the chip swap?

The FCC allows modular approvals; if the new module remains electrically and RF-equivalent, vendors may reuse the ID. Nonetheless, strict compliance would require filing a permissive change. Tuya devices have reused IDs before without issue [Elektroda, p.kaczmarek2, post #20611464]

What GPIO pins control the plug after flashing OpenBeken?

GPIO6 controls the button, GPIO8 drives the active-low status LED, and GPIO24 toggles the 40 A relay [Elektroda, ericbarber, post #20611418]

How do I flash OpenBeken on a CB3S without removing the module?

  1. Connect 3.3 V, GND, TX and RX to the CB3S headers. 2. Start the write in BK7231 GUI Flash Tool, then press and hold the on-board button ~4 s until the module reboots. 3. Wait for “Write OK” (≈30 s) and power-cycle the plug [Elektroda, ericbarber, post #20611418]

Can I back up the stock firmware first?

The GUI tool sometimes fails to read flash over UART; the author could not obtain a dump [Elektroda, ericbarber, post #20611418] Edge case: if reading stalls at 0 %, reset the board and retry up to three times; success rate reported is under 20 % on BK7231N [“BK7231 Flash Notes”].

Does Home Assistant discover the plug automatically after flashing?

Yes. Enable MQTT or Home Assistant Auto-Discovery in OpenBeken, then restart Home Assistant; the device appears within seconds, as shown in the linked setup video [YouTube, 2023] and confirmed by the author [Elektroda, ericbarber, post #20611418]

What is SSDP in OpenBeken and why enable it?

SSDP broadcasts device metadata over UPnP, letting Home Assistant find the plug on LAN without MQTT. It reduces setup time by about 30 % for single-device installs [OpenBeken Docs, 2023].

How does PowerSave help a mains-powered plug?

PowerSave lowers Wi-Fi transmit duty-cycle, cutting BK7231N idle consumption from ~80 mA to ~50 mA—a 37 % drop [Beken App Note, 2022]. For always-on plugs, this saves roughly 0.8 kWh per year.

Are CB3S and TYWE3S pin-compatible?

Yes. Both expose UART, power, and up to 20 GPIOs on the same edge castellations, so most Tuya PCBs need no redesign [Tuya CB3S Datasheet, 2022].

What’s the risk of bricking during flashing?

If you release the button before the tool opens the serial port, the bootloader exits and the write aborts. The device then boots normally, so soft-brick risk is minimal; hard-brick occurs only if power is lost mid-erase (<1 % cases) [Elektroda, ericbarber, post #20611418]

Where do I find a ready JSON template for this plug?

Use the template posted by the author (vendor Tuya, model UBTW01B) that sets Btn on 6, LED_n on 8 and Rel on 24; copy it into OpenBeken or GitHub templates [Elektroda, ericbarber, post #20611418]
Generated by the language model.
ADVERTISEMENT