logo elektroda
logo elektroda
X
logo elektroda

Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile

baukje 3417 17
Best answers

How can I recover an OpenBeken WB2S Tuya plug after flashing a generic profile so the button and LEDs work but the relay no longer responds?

Recover it by restoring the Tuya GPIO config read from flash, because that config shows the relay on P24 and the button/LEDs on P6, P8, and P7 [#20596753] Set GPIO 24 to REL and test it with "Set Output low/high"; the channel number does not matter here [#20596910][#20597016] If needed, try `PowerSave 1` and put it in the short startup command, but that only helps if the relay is being blocked by power-save behavior [#20597016] The LED polarity can be inverted by changing the LED role to `LED_n` [#20597016] If P24 still never clicks after trying all WB2S pins, the thread’s conclusion is that it is probably a hardware fault rather than a wrong OpenBeken config, because the extracted Tuya config clearly says `rl1_pin=24` and the relay had worked in Tuya before [#20597268][#20596948] Also, make sure the physical button and relay are assigned to the same channel if you want the button to toggle the relay [#20597344]
Generated by the language model.
ADVERTISEMENT
  • #1 20596589
    baukje
    Level 6  
    Posts: 27
    I only knew tuya MCU version (v1.0.7) and chip type (WB2S BK7231T) and tuya-cloudcut the device using the nearest sounding device for the same version.
    button still worked and led flashing was all correct while going through flashing process.
    When the device came back up, the button and LEDs were no longer working so been trying to use the profile from t-cc and the new GPIO doctor tool. I can find the red (switch on) LED, but can't find anything that outputs to the wifiLED (green) or the relay.
    The t-cc saved json gave me 2 relays and a button and wifi LED.
    What have I done wrong? how can I recover from here?

    Added after 15 [minutes]:

    Ok, I just saw video and realized I was supposed to extract the config from the flash.
    Done that and all the lights and button work, but the relay doesn't. Have I blown something by overdoing tests in GPIO doctor?
  • ADVERTISEMENT
  • #2 20596732
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Please provide more information. Everything should work. Are you really saying that none of the GPIOs are connected to the button? Have you checked them all? Can you post your tuya config so I can check it myself?

    If automatic GPIO extraction fails, try checking pins one by one.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20596753
    baukje
    Level 6  
    Posts: 27
    I later followed the guide to read the config from flash (flash tab) and imported. This looks correct because the button on the device reacts again, the WiFi LED looked like WiFi activity when I powered it back on, and the red LED reacts to pressing the physical button on the device and the toggle button in UI. The relay does not change at all.

    Which config do you want to see?
    This is the config extracted from the tuya-cloudcutter flash:
    ClearIO // clear old GPIO/channels
    lfs_format // clear LFS
    StartupCommand "" // clear STARTUP
    stopDriver * // kill drivers
    backlog setPinRole 24 Rel; setPinChannel 24 1
    setPinRole 7 WifiLED_n
    backlog setPinRole 8 LED; setPinChannel 8 1
    backlog setPinRole 6 Btn; setPinChannel 6 1
  • #4 20596758
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Go to Web App, flash tab, click "Download tuya config", attach binary here....
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20596764
    baukje
    Level 6  
    Posts: 27
    p.kaczmarek2 wrote:
    try checking pins one by one

    in the GPIO doctor page, does it matter what the "channel" shows as?
    Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile
    I went through every PIN on GPIO Finder page (28) and the relay did not react on any.

    Added after 5 [minutes]:

    p.kaczmarek2 wrote:
    Go to Web App, flash tab, click "Download tuya config", attach binary here....

    You mean the bin from "Download Tuya GPIO Config from 0x1EE000"?
    This contains my ssid and password, is the JSON extracted from this enough?
  • #6 20596876
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Channel doesn't matter in this case. Clicking "SEt Output low" or "high" should click relay if relay is on given GPIO.

    Tuya Config contains your SSID and password? Are you sure? OR do you mean OBK config? Or maybe you are right... so you paired device with Tuya before flashing?

    I am asking for Tuya Config. Still, if it contains your SSID/Password, you can edit it out in hex editor.

    Or just drag it drop over the flasher:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    and copy JSON from here:
    Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile
    paste it into your post, use syntax tag.
    Helpful post? Buy me a coffee.
  • #7 20596900
    baukje
    Level 6  
    Posts: 27
    p.kaczmarek2 wrote:
    Tuya Config contains your SSID and password? Are you sure? OR do you mean OBK config? Or maybe you are right... so you paired device with Tuya before flashing?

    I am asking for Tuya Config. Still, if it contains your SSID/Password, you can edit it out in hex editor.

    Yes, I connected it to the tuya app to get the version info, I should have unpaired and wiped before flashing, but got too excited :)
    Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile

    {
    	"rl1_lv":"1",
    	"netled_lv":"0",
    	"bt_type":"0",
    	"bt1_pin":"6",
    	"mxcl_led_m":"0",
    	"led1_pin":"8",
    	"rand_dpid":"43",
    	"net_trig":"4",
    	"led_dp":"40",
    	"jv":"1.0.9",
    	"lock_dp":"41",
    	"nety_led-Bgw_wsm{nc_tp":"4",
    	"ssid":"base64ofSSID",
    	"passwd":"base64ofPW",
    	"md":"2",
    	"random":"0",
    	"wfb64":"1",
    	"stat":"2",
    	"token":"AAAAAA",
    	"region":"AA",
    	"reg_key":"null }uyaeu.com",
    	"ai_sp":"null",
    	"mq_psk":"m2.tuyaeu.com",
    	"time_z":"+00",
    	"s_tim{uuid":"ECEHVRXeVaB2",
    	"psk_key":"null",
    	"auth_key":"43NKd0Qylu3UeSiI",
    	"ap_ssid":"A",
    	"ap_passwd":"null",
    	"country_code":"null",
    	"prod_tes":"1",
    	"netled_pin":"7",
    	"total_stat":"2",
    	"rl_type":"0",
    	"bt1_lv":"0",
    	"reset_t":"3",
    	"ch_flag1":"1",
    	"inch_dp":"44",
    	"module":"WB2S",
    	"ch_cddpid1":"9",
    	"init_conf":"38",
    	"led1_lv":"0",
    	"cyc_dpid":"42",
    	"ch_num":"1",
    	"reuse_led_m":"0",
    	"rl1_pin":"24",
    	"netn_led":"0",
    	"ch_dpid1":"1",
    	"crc":"112",
    	"}vAgw_dit":"false }",
    	"reg_ke{lastFetchTime":"0",
    	"cnt":"0}mljb....cGF0b3J....M=",
    	"t{nc_tp":"4",
    	"t4jbCgw_aioken":"AAAAAA"
    }

    [/code]
  • #8 20596910
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Hmm I wasn't even sure that SSID/PASS is stored in this config, thank you for proving that they indeed are there! That's good to know.

    Okay, so rl1_pin looks like P24...
    It really looks like so.
    Are you 100% sure that it doesn't click if you set P24 to REL and toggle it from GUI?
    Was it working with Tuya?

    It's the first time ever I see such a strange case.

    I would be guessing that this device is using a bridge relay driver, but it looks like a normal relay.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 20596948
    baukje
    Level 6  
    Posts: 27
    Never plugged anything into it until now, but the relay was clicking with the tuya app and when pushing the physical button. It wouldn't pair at first and wasn't able to tell what version it was until suddenly after pairing timed out but the pairing light stayed on, I restarted the tuya app and it was there.
    Is there an esp version of the config extract from firmware? As mentioned in another post, I have an identical plug but with TYWE2S. I imagine the GPIO config would be the same.??
    Checked the fuse, and the relay is the one pictured
    Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile

    When I did tuya-cloudcutter cut, I chose "1.0.7 - BK7231T / oem_bk7231s_rnd_switch" which was the closest 1.0.7 thing I could find. Used the same when I did tuya-cloudcutter flash. I had no way to connect to the thing after it had been cut, so I don't know if the relay was working at that point, but the button and LEDs behaved correctly.

    Added after 23 [minutes]:

    Another weird thing is that the red LED comes on when the toggle is OFF and goes off when the TOGGLE is on. Didn't notice before flashing.
  • #10 20597016
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    LED behaviour is not a problem, change LED role to LED_n to inverse it.

    Then try to run command PowerSave 1 (from Execute Command or from Web App->Log console), and check if relay works again (on P24).

    If you wan to always run PowerSave 1 at startup, enter it into the "Short startup command" and reboot
    Helpful post? Buy me a coffee.
  • #11 20597219
    baukje
    Level 6  
    Posts: 27
    I guess PowerSave was 0 by default, because it wasn't mentioned in console log until I used that command, now POWERSAVE appears at the end of each line, but did not change the relay state. Tried the other free "PWM" pins too. Is it even worth trying pins marked N/A in the GPIOfinder?
  • #12 20597268
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    N/A means it has no secondary function, but it's still a valid pin.
    Your device is WB2S-based (I can see that in JSON), so you should try all WB2S pins:
    Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile
    All those at the bottom of the picture (the test pads on the back of module are not used in production).

    But I'd say it is almost impossible that P24 doesn't work for you, it can be seen clearly in Tuya config that rl1_pin is P24. Maybe there is a hardware issue?
    Helpful post? Buy me a coffee.
  • #13 20597342
    baukje
    Level 6  
    Posts: 27
    Yes, I guess it's a hardware issue, might have to desolder the plug pins the remove the pcb and maybe test.
    The same plug used to be listed on tasmota before the chip was changed (twice), how do the 18 GPIO pins relate to the 28 listed in openbeken interface? Just wondered if it gave any clues, but might have been different design
    {"NAME":"UltraBrite Smart Plug","GPIO":[1,1,1,1,288,289,1,1,224,32,1,1,1,1],"FLAG":0,"BASE":18}
  • #14 20597344
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    You would need to look up TYWE2S and WB2S pinouts to compare that.

    Btw, just to be sure - you are setting button and relay to the same channel, right? If you set physical button to channel 1 and relay to channel 2 then the button won't toggle the relay.
    Helpful post? Buy me a coffee.
  • #15 20597423
    baukje
    Level 6  
    Posts: 27
    Looks like the TYWE2S and WB2S are pin for pin the same, just labeled differently.
    This plug looks the same general design as the Tesco Calex plug, which also uses the same 6, 7, 8 and 24 pins.
    https://www.elektroda.com/rtvforum/topic3925190.html
    Really looks like hardware problem that should be switching the relay on pin 24.

    Thanks for all your help and responses, openbeken_app is a great set of tools. I only wish I could say the same for my hardware :)

    Added after 15 [minutes]:

    btw, any idea what this is soldered under the relay?
    Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile

    Added after 4 [minutes]:

    Oh and yes, the button and relay are same channel

    Added after 3 hours 46 minutes:

    Had a go at desoldering the enormous blobs of solder keeping the pcb firmly welded to the molded case. My iron only goes up to 450C and didn't even soften the solder.
    Cutting the case is the only option to get at the pins but not an option to try to test the relay so I'll just cut into the TYWE2S and will give up on the beken at least for now...

    Added after 48 minutes:

    p.kaczmarek2 wrote:
    N/A means it has no secondary function, but it's still a valid pin.
    Your device is WB2S-based (I can see that in JSON), so you should try all WB2S pins:
    Openbeken Generic tuya WB2S BK7231T Plug unable to identify relay after cutting with generic profile
    All those at the bottom of the picture (the test pads on the back of module are not used in production).

    But I'd say it is almost impossible that P24 doesn't work for you, it can be seen clearly in Tuya config that rl1_pin is P24. Maybe there is a hardware issue?


    Just found another with MAC of D4:A6:51 (Tuya Smart Inc.)
    So should I confirm the MCU version by pairing with Tuya app, or just got straight for flashing? And what version should I choose then from the flashing tool?
    I thought I bought more than 2 when they were being sold of cheap :D
  • #16 20599016
    baukje
    Level 6  
    Posts: 27
    Cut a hole in the bottom of the TYWE2S but ended up using the hole just to look through while I fed in some bent pins to make contact with the 3v3, GND, TX and RX. Its the same 4 pins on the WB2S so I will try reading the flash on this too.

    WB2S doesn't have IO0 to ground, is there another pin I need to ground to read WB2S flash?
  • #17 20599043
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    I don't know what is under the relay. It's a bit hard to guess with that photo. Maybe it's a free-wheeling protection diode or a transistor.

    While flashing, always choose correctly BK7231T or BK7231N platform and get latest OBK version. Our tool, BK7231GUIFlashTool, can automatically downloaded OBK from github, so there is no risk you'll get wrong file. Just make sure to choose correctly T or N.

    WB2S requires only RX/TX, 3.3V and GND connections to flash. There is no IO0. Bootloader is active for a short moment after doing power cycle (off and on). Please consult our flasher page:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    And our flashing guides:
    https://www.youtube.com/playlist?list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM
    Doing full firmware backup is always recommended. We can extract GPIO config from that.
    Helpful post? Buy me a coffee.
  • #18 20599087
    baukje
    Level 6  
    Posts: 27
    p.kaczmarek2 wrote:
    I don't know what is under the relay. It's a bit hard to guess with that photo. Maybe it's a free-wheeling protection diode or a transistor.


    This thing just looks like a metal bar, maybe a just a "bridged" connection? It's the same on all versions of this plug, some have more obvious blobs of red. I was just looking to see if there was something I might have damaged while trying to pry the case open.

    While flashing the TYWE2S, and powered only from the usb serial, I pressed the button to see if it would ground IO0, but at the same time noticed that the relay didn't click. The LEDs reacted as usual. Just made me wonder if somehow the relay on this none working WB2S is somehow not getting enough power to activate. Are there any other settings that could affect power that are configurable?

    I will see if I can get a dump from the new unconfigured WB2S.

    Added after 21 [minutes]:

    Needed CEN shorted to gnd or power off/on or wouldn't read flash, need to make some kind of switch on the 3v3...

Topic summary

✨ The discussion revolves around a user experiencing issues with a Tuya-based smart plug (model WB2S BK7231T) after attempting to flash it using a generic profile. Initially, the button and LEDs functioned correctly post-flashing, but the relay did not respond. The user followed various troubleshooting steps, including extracting the configuration from the flash and using GPIO doctor tools, but could not get the relay to activate. Responses from other users suggested checking GPIO connections, ensuring correct channel assignments, and verifying hardware functionality. The user suspected a hardware issue after confirming that the relay had previously worked with the Tuya app. Further discussions included comparisons with another model (TYWE2S) and the need for proper flashing procedures. The user ultimately considered desoldering components to investigate potential hardware failures.
Generated by the language model.

FAQ

TL;DR: 3.3 V UART flashing and "WB2S requires only RX/TX, 3.3V and GND"—import the Tuya GPIO config, set the relay to P24, use GPIO Doctor to toggle outputs, and power‑cycle for bootloader; if no click, suspect hardware. [Elektroda, p.kaczmarek2, post #20599043]

Why it matters: For OpenBeken users flashing Tuya WB2S/BK7231T plugs, this FAQ speeds relay/LED recovery and avoids dead‑ends.

Quick Facts

How do I restore GPIO mapping after flashing a generic profile?

Extract and import the original Tuya GPIO config, then verify roles. 1) In OpenBeken Web App > Flash tab, click “Download Tuya config.” 2) Import that config into OpenBeken. 3) Confirm button, Wi‑Fi LED, and relay roles match the dump. This brought back button and LEDs for the user after a generic cut. [Elektroda, baukje, post #20596753]

Does the Tuya config dump include my Wi‑Fi credentials?

Yes. The Tuya GPIO config block can contain SSID and password fields (often base64‑encoded). Redact credentials before sharing dumps publicly or in forums. This was confirmed by a user who posted an excerpt showing ssid and passwd in the JSON. [Elektroda, baukje, post #20596900]

Which pin drives the relay on this WB2S plug?

The Tuya JSON maps the relay to P24 (rl1_pin). Assign P24 the Relay role in OpenBeken and test from the GUI. As one expert noted, “rl1_pin looks like P24,” so start there before trying other pins. [Elektroda, p.kaczmarek2, post #20596910]

How do I use GPIO Doctor to find a missing relay output?

Open GPIO Doctor, select a candidate pin, and use Set Output High/Low. Channel selection doesn’t matter for this test. A working relay on the correct GPIO will audibly click when toggled. Methodically iterate pins until you find the correct one. “Clicking ‘Set Output low’ or ‘high’ should click relay if relay is on given GPIO.” [Elektroda, p.kaczmarek2, post #20596876]

Should I try pins marked N/A in GPIO Finder?

Yes. N/A only means no secondary function; the pin is still usable. On WB2S, test all available module edge pins. Ignore the back test pads, as they aren’t used in production designs. This broadens coverage when a relay line isn’t obvious. [Elektroda, p.kaczmarek2, post #20597268]

How do I fix an LED that’s on when the plug is OFF?

Invert that LED by setting its role to LED_n on the same channel. This flips the logic so the indicator aligns with the relay state. “LED behaviour is not a problem, change LED role to LED_n to inverse it.” [Elektroda, p.kaczmarek2, post #20597016]

Should I enable PowerSave to restore relay drive?

Try running PowerSave 1 from the console or Web App. If you want it persistent, add PowerSave 1 to the short startup command and reboot. This can resolve certain drive issues. “If you want to always run PowerSave 1 at startup, enter it into the ‘Short startup command.’” [Elektroda, p.kaczmarek2, post #20597016]

PowerSave didn’t fix my relay—what next?

One user saw POWERSAVE in logs after enabling PowerSave 1, yet the relay stayed inactive. Continue with GPIO Doctor testing on all valid pins and review wiring. If outputs never click, move toward hardware inspection. This is a known edge case outcome. [Elektroda, baukje, post #20597219]

Are TYWE2S and WB2S pinouts compatible on this plug?

In this specific plug, they appeared pin‑for‑pin compatible, using pins 6, 7, 8, and 24 similarly. Still verify each board’s pinout before applying settings across modules, as layouts can vary between batches. [Elektroda, baukje, post #20597423]

How do I safely flash or back up a WB2S (BK7231T) module?

Connect RX, TX, 3.3 V, and GND. Power‑cycle to reach the bootloader. Use BK7231GUIFlashTool, select the correct BK7231T or BK7231N, and let it auto‑download the latest OBK. Always do a full firmware backup before changes. “Bootloader is active for a short moment after doing power cycle.” [Elektroda, p.kaczmarek2, post #20599043]

UART won’t read WB2S flash—what can I try?

Power‑cycle the module to catch the bootloader window. If that fails, briefly short CEN to GND, then try again. Adding a 3.3 V inline switch can make repeated attempts easier during readout. This method restored read access for a user. [Elektroda, baukje, post #20599087]

Why doesn’t my button toggle the relay in OpenBeken?

Ensure the physical button and the relay share the same channel number. If the button is on channel 1 and the relay on channel 2, they act independently. Set both to channel 1 for a single‑gang plug. [Elektroda, p.kaczmarek2, post #20597344]

Could a non‑clicking relay be a hardware fault?

Yes. If Tuya JSON shows RL1 on P24 and GPIO Doctor toggles never click, hardware may be at fault. Confirm wiring, inspect the relay driver, and consider component testing. The maintainer flagged this possibility after extensive pin testing. [Elektroda, p.kaczmarek2, post #20597268]

What’s the small component under the relay?

From photos, it’s unclear. It may be a free‑wheeling protection diode or a transistor used in the relay driver path. Either helps switch or protect the relay coil during operation. “Maybe it’s a free‑wheeling protection diode or a transistor.” [Elektroda, p.kaczmarek2, post #20599043]

Is this plug single‑channel or multi‑channel?

The Tuya JSON shows ch_num set to 1, indicating a single‑channel device. Configure one relay and ensure the button maps to the same channel for correct toggling behavior. [Elektroda, baukje, post #20596900]
Generated by the language model.
ADVERTISEMENT