logo elektroda
logo elektroda
X
logo elektroda

[Solved] BK7231 T34 Chip 1-Gang Light Switch Not Controlling Relay After OpenBeken Flash

uid1123444 627 16
ADVERTISEMENT
  • #1 21569766
    uid1123444
    Level 3  
    Hello everyone! Had some issues with 1-gang light switch, bought here, (not AD's), which based on T34 chip.

    When I used BK7231 GUI Flash Tool for backup original FW - got an error that flasher cannot get configuration from FW, then i checked lastRawDecryptedStrings.bin via Notepad , got this list

    Spoiler:


    {
    "device_configuration": {
    "rl1_lv": "1",
    "bt1_pin": "23",
    "on_off_cnt": "10",
    "onoff_rst_m": "1",
    "onoff_clear_t": "10",
    "rand_dpid": "42",
    "net_trig": "4",
    "onoff_n": "10",
    "netled1_lv": "0",
    "jv": "110.0.0",
    "onoff_rst_type": "2",
    "ffc_select": "0",
    "total_bt_pin": "10",
    "key_rst_en": "1",
    "nety_led": "0",
    "total_stat": "2",
    "bt1_lv": "0",
    "reset_t": "5",
    "netled1_pin": "8",
    "remote_add_dp": "49",
    "remote_list_dp": "50",
    "net_type": "0",
    "inch_dp": "44",
    "rf_width": "345",
    "module": "T34",
    "ch_cddpid1": "9",
    "remote_io": "6",
    "clean_t": "5",
    "init_conf": "38",
    "zero_select": "0",
    "onoff_type": "2",
    "series_ctrl": "0",
    "bt_self_type": "1",
    "total_bt_lv": "0",
    "cyc_dpid": "43",
    "remote_select": "1",
    "ch_num": "1",
    "rl1_pin": "26",
    "netn_led": "1",
    "ch_dpid1": "1",
    "crc": "100"
    }
    }



    Right after flashing Openbeken i tried to configure switch via template which is posted under spoiler - we have the issue when we touch button - state of it changes successfully, but relay didnt react at all. Maybe i had some errors in configuring of this one? Will be really appreciate if somebody can help me to figure out whats going on there.

    Photos of this board under next spoiler (on photos relay and T34 are desoldered just in case):

    Spoiler:



    Blue PCB with mounted integrated circuits, connectors, and a quartz crystal.
    A blue printed circuit board (PCB) with visible tracks and mounting holes lies on a wooden surface.
    Round printed circuit board with electronic components on a wooden surface.
    Blue PCB with visible traces and solder points, lying on a wooden surface.



    Please LMK if you need additional info (photos/files/etc)

    Thanks and have a great day!
    AI: Could you please share the exact template or configuration settings you used in OpenBeken for this switch? A screenshot or copy-paste of your current setup would be really helpful.
    ClearIO // clear old GPIO/channels
    lfs_format // clear LFS
    StartupCommand "" // clear STARTUP
    stopDriver * // kill drivers
    backlog setPinRole 26 Rel; setPinChannel 26 1
    setPinRole 8 WifiLED
    backlog setPinRole 23 Btn; setPinChannel 23 1
    setPinRole 10 Btn_Tgl_All
  • ADVERTISEMENT
  • #2 21569886
    divadiow
    Level 36  
    what if you change p23 to

    Code: JSON
    Log in, to see the code
  • ADVERTISEMENT
  • #3 21569902
    uid1123444
    Level 3  
    >>21569886 If we use physical button on switch - it changes status to On for a while, right after - automatically changes to Off by itself. If we're changing state via webapp - it switches and nothing more happened.

    P.S: You need to tap a lot of times in a row, randomly it can be changed to On, but right after it changes itself to Off.

    If we're using P23 as a Button - nothing similar happens, button works perfectly.
  • Helpful post
    #5 21570005
    p.kaczmarek2
    Moderator Smart Home
    Can you please post your current device configuration? It's very hard to follow without it. If this is a touch button device, as it looks like, then you should use Btn role. Maybe also set instant touch reaction flag.

    It's hard to understand what's going on now. Which problem do you have:
    - touch button does not work correctly (so relay can be controlled correctly from web panel, especially if you disable button)
    - relay does not work at all (toggling in the web panel does not switch relay)
    Helpful post? Buy me a coffee.
  • #6 21570012
    uid1123444
    Level 3  
    >>21570005

    Spoiler:
    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Full Device Name Here",
    "model": "enter short model name here",
    "chip": "BK7231N",
    "board": "TODO",
    "flags": "1024",
    "keywords": [
    "TODO",
    "TODO",
    "TODO"
    ],
    "pins": {
    "8": "WifiLED;0",
    "10": "Btn_Tgl_All;0",
    "23": "Btn;1",
    "26": "Rel;1"
    },
    "command": "",
    "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }


    That's current template which is using right now.

    If we trace to a transistor pin and solder a wire there and if we will take it in hand - relay is working with 50Hz freq. But relay didn't switch to On if we're using sensor button.
  • #7 21570019
    p.kaczmarek2
    Moderator Smart Home
    On OBK main panel, there is a button, right?
    This button:
    Screenshot of a web page showing a large green button labeled “Toggle 0” with “ON” above it, circled in red.
    1. Do you have that Web Page button visible? Yes/No
    2. If you touch and release touch button on switch (physical one), does Web Page button state change (green to red, red to green)? Yes/No
    3. If you click Web Page button, does Relay state change?
    Helpful post? Buy me a coffee.
  • #8 21570022
    uid1123444
    Level 3  
    >>21570019
    OpenBK7231N device control panel with OFF status and red Toggle 1 button.
    OpenBK7231N web panel with a green Toggle 1 button and ON status displayed.

    1. Yes
    2. State changes thru physical button and via button in web page as well
    3. Relay is completely silent, nothing happened.
  • ADVERTISEMENT
  • #9 21570028
    p.kaczmarek2
    Moderator Smart Home
    There are two options.
    1. Relay pin is incorrect - use GPIO doctor from web app to find which pin toggles relay. Backup your template from web app first!
    2. Did you desolder T34? Maybe there is a cold solder joint for relay and signal does not go out.
    Helpful post? Buy me a coffee.
  • #10 21570032
    uid1123444
    Level 3  
    >>21570028

    1. To be honest, I tried to use GPIO Doctor, tried every combination of pin/assignment/channel type, don't even understand, but nothing, maybe there is some mistake from my side.
    2. Yes, cause there is no such other option in my case for flashing of T34 without desoldering :(
  • Helpful post
    #11 21570043
    divadiow
    Level 36  
    just to add that the Tuya dump the user sent me has the same schema as my T34 here https://www.elektroda.com/rtvforum/topic4036975-60.html#21117908

    It seems to be physically similar with longer PCB

    Code: Text
    Log in, to see the code


    I have dug out that device and this is my working template

    Code: JSON
    Log in, to see the code


    Screenshot of a device configuration interface with pin settings and dropdown menus.





    I've not had it toggle itself off/on yet
  • #12 21570051
    uid1123444
    Level 3  
    divadiow wrote:
    "pins": {
    "8": "WifiLED_n;0",
    "10": "Btn;1",
    "23": "TglChanOnTgl;1",
    "26": "Rel;1"
    }

    If we're using this code - when we touch physical button - it changes for a while, right after - changes to Off by itself.

    But relay is still silent anyway.
  • #13 21570110
    p.kaczmarek2
    Moderator Smart Home
    uid1123444 wrote:
    divadiow wrote:
    "pins": {
        "8": "WifiLED_n;0",
        "10": "Btn;1",
        "23": "TglChanOnTgl;1",
        "26": "Rel;1"
      }

    If we're using this code - when we touch physical button - it changes for a while, right after - changes to Off by itself.

    But relay is still silent anyway.

    TglChanOnTgl will change on each state change, so it won't work good for touch button. It will toggle first when you begin to touch, and then it will toggle when you lift finger. It's 100% normal. Do not use TglChanOnTgl for touch buttons. It's for old-style bistable switches where they have two states.
    Helpful post? Buy me a coffee.
  • #14 21570113
    uid1123444
    Level 3  
    >>21570110

    Tomorrow will try to resolder T34. Will keep you updated, guys
  • #15 21570117
    divadiow
    Level 36  
    >>21570110

    oh! so

    Code: Text
    Log in, to see the code


    instead?

    Added after 1 [minutes]:

    which does work for me..
  • #16 21570995
    uid1123444
    Level 3  
    Update: looks like was an issue with soldering of T34. Now - when we touch physical button - relay is working, but switch is going to reboot :) Will continue investigation.

    @divadiow @p.kaczmarek2 sorry for taking your time guys, looks like its my fault, but i appreciate your time and help! Thanks a lot!
  • ADVERTISEMENT
  • #17 21573749
    uid1123444
    Level 3  
    Soldering issues, PIN #15 wasn`t soldered as needed.

Topic summary

A 1-gang light switch based on the BK7231 T34 chip was reflashed with OpenBeken firmware but failed to control the relay despite the button state toggling correctly. The original firmware backup process reported errors retrieving configuration. The relay and T34 chip were desoldered for flashing. Attempts to configure the device using various pin assignments and templates, including "TglChanOnTgl" and "Btn" roles, showed that the physical button state changed but the relay did not activate. The relay produced a 50Hz signal when manually triggered via a transistor pin, indicating hardware functionality. Suggestions included verifying relay GPIO pin assignments using the GPIO Doctor tool and ensuring proper soldering of the T34 chip and relay connections. A working template from a similar T34 device used pins 8 (WifiLED_n), 10 (Btn), 23 (TglChanOnTgl), and 26 (Rel). It was noted that "TglChanOnTgl" is unsuitable for touch buttons due to toggling on both press and release events; "Btn_Tgl_All" was recommended instead. The root cause was identified as a soldering fault on pin #15 of the T34 chip, which once corrected, restored relay operation though the device rebooted on button press, requiring further investigation. The issue was resolved by resoldering the T34 chip properly.
Summary generated by the language model.
ADVERTISEMENT