logo elektroda
logo elektroda
X
logo elektroda

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

baukje 2262 17
ADVERTISEMENT
  • #1 20596589
    baukje
    Level 5  
    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
    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.
  • #3 20596753
    baukje
    Level 5  
    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
    Go to Web App, flash tab, click "Download tuya config", attach binary here....
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20596764
    baukje
    Level 5  
    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
    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 5  
    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]
  • ADVERTISEMENT
  • #8 20596910
    p.kaczmarek2
    Moderator Smart Home
    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.
  • #9 20596948
    baukje
    Level 5  
    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
    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.
  • ADVERTISEMENT
  • #11 20597219
    baukje
    Level 5  
    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
    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 5  
    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
    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 5  
    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 5  
    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
    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 5  
    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.
Summary generated by the language model.
ADVERTISEMENT