logo elektroda
logo elektroda
X
logo elektroda

[BK7231N / CB3S] Tuya Smart Life Garage Door Motor Receiver 4CH Switch Controller WiFi Switch

lionboy 3366 25
ADVERTISEMENT
  • Helpful post
    #1 20860235
    lionboy
    Level 10  
    Tuya smart switch with four buttons and display
    Hello,
    Here is Tuya JSON config for this device:
    Code: JSON
    Log in, to see the code

    As exported by https://github.com/openshwprojects/BK7231GUIFlashTool :
    User interface of a device configuration tool showing Tuya JSON code.
    Text description:
    
    Device configuration, as extracted from Tuya: 
    - Button (channel 1) on P8
    - Pair/Toggle All Button on P7
    - Relay (channel 2) on P6
    - Relay (channel 1) on P24
    - Relay (channel 3) on P26
    - Relay (channel 4) on P14
    - WiFi LED on P22
    - Button (channel 4) on P11
    - Button (channel 3) on P10
    - Button (channel 2) on P9
    Device seems to be using CB3S module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424
    

    OBK template:
    Code: JSON
    Log in, to see the code


    After desoldering the CB3S chip from the board, I successfully put ESPHome on this Relay Board:

    Tuya Smart Life, garage door control receiver with visible circuit board.
    https://vi.aliexpress.com/item/10050053866410...1RO%21728730991%21&curPageLogUid=ruZlMkOZGwQc

    I will leave here a 2 MB bin extracted and templates if anyone wants to put it on their board:

    GPIO for EspHome:
    
    sensor:
      - platform: uptime
        name: Uptime
    
    binary_sensor:
      - platform: gpio
        id: binary_switch_1
        pin:
          number: P8
          inverted: true
          mode: INPUT_PULLUP
        on_press:
          then:
            - switch.toggle: switch_1
      - platform: gpio
        id: binary_switch_2
        pin:
          number: P9
          inverted: true
          mode: INPUT_PULLUP
        on_press:
          then:
            - switch.toggle: switch_2
      - platform: gpio
        id: binary_switch_3
        pin:
          number: P10
          inverted: true
          mode: INPUT_PULLUP
        on_press:
          then:
            - switch.toggle: switch_3
      - platform: gpio
        id: binary_switch_4
        pin:
          number: P11
          inverted: true
          mode: INPUT_PULLUP
        on_press:
          then:
            - switch.toggle: switch_4
      - platform: gpio
        id: binary_switch_all
        pin:
          number: P7
          inverted: true
          mode: INPUT_PULLUP
        on_press:
          then:
            - switch.toggle: switch_1
            - switch.toggle: switch_2
            - switch.toggle: switch_3
            - switch.toggle: switch_4
    
    switch:
      - platform: gpio
        id: switch_1
        name: Open Gate
        pin: P24
      - platform: gpio
        id: switch_2
        name: Close Gate
        pin: P6
      - platform: gpio
        id: switch_3
        name: Stop Gate
        pin: P26
      - platform: gpio
        id: switch_4
        name: Gate SbS
        pin: P14
    
    status_led:
      pin:
        number: P22
        inverted: true
    


    I forgot to take some pictures of the board.

    Thanks
  • ADVERTISEMENT
  • Helpful post
    #2 20860808
    p.kaczmarek2
    Moderator Smart Home
    Thank you for sharing. I've added the images from the shop offer in case that it expire and futhermore extended description a bit. The device should be soon live on our teardowns list.

    I will also correct code/quote tags in a moment (we use code for codes, because our translation system would translate quotes and thus break the code...)
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20903211
    lionboy
    Level 10  

    I have a question:

    Does anyone know how to set up RF using this code?

    
    {
    	"rl1_lv": "1",
    	"bt1_pin": "8",
    	"onoff_clear_t": "6",
    	"net_trig": "4",
    	"netled1_lv": "0",
    	"onoff_rst_type": "2",
    	"total_bt_pin": "7",
    	"nety_led": "0",
    	"total_stat": "0",
    	"bt1_lv": "0",
    	"remote_add_dp": "49",
    	"remote_list_dp": "50",
    	"rf_width": "345",
    	"module": "CB3S",
    	"rl2_pin": "6",
    	"series_ctrl": "0",
    	"cyc_dpid": "43",
    	"bt2_lv": "0",
    	"rl1_pin": "24",
    	"rl4_lv": "1",
    	"on_off_cnt": "10",
    	"onoff_rst_m": "0",
    	"rl3_pin": "26",
    	"rl3_lv": "1",
    	"rand_dpid": "42",
    	"rl4_pin": "14",
    	"jv": "100",
    	"bt3_lv": "0",
    	"reset_t": "5",
    	"netled1_pin": "22",
    	"rl2_lv": "1",
    	"net_type": "0",
    	"bt4_pin": "11",
    	"inch_dp": "44",
    	"bt3_pin": "10",
    	"ch_cddpid1": "9",
    	"remote_io": "20",
    	"init_conf": "38",
    	"bt4_lv": "0",
    	"zero_select": "0",
    	"onoff_type": "2",
    	"bt2_pin": "9",
    	"ch_cddpid4": "12",
    	"ch_cddpid2": "10",
    	"ch_cddpid3": "11",
    	"total_bt_lv": "0",
    	"remote_select": "1",
    	"ch_num": "4",
    	"ch_dpid3": "3",
    	"ch_dpid4": "4",
    	"netn_led": "0",
    	"ch_dpid1": "1",
    	"ch_dpid2": "2",
    	"crc": "109",
    	"}@Agw_diAinch_time_keyv": "40.00",
    	"pv": "2.2",
    	"lpv": "3.4",
    	"pk": "keyjnuy4s3kre7m7",
    	"firmk": "keyjnuy4s3kre7m7",
    	"cadv": "rl",
    	"lp_ip": "18.193.97.90",
    	"time_z": "+02",
    	"s_time_z": "[[1711846800",
    	"wx_app_id": "null",
    	"wx_uuid": "null",
    	"dy_tls_m": "2",
    	"cloud_cap": "1025",
    	"psk21_key": "null "
    }
    


    Thanks
  • #4 20903214
    p.kaczmarek2
    Moderator Smart Home
    Can you check which GPIO is connected to RF receiver? How does the board looks like from the close up?
    Helpful post? Buy me a coffee.
  • #5 20903224
    lionboy
    Level 10  

    I need to take from my gate again and make some pictures but I have another one with Zigbee. Do you think I can figure it out from that or do I need this with CB3S? They are the same, only one is with Zigbee and another with CB3S.

    Added after 4 [minutes]:


    Electronic module with labeled components and indicators.

    I found these pictures on the net. I don't know if they are okay.
  • #6 20903254
    p.kaczmarek2
    Moderator Smart Home
    But is RF receiver connected to CB3S via single pin, or is it integrated into buttons driver?

    RF receiver integrated into buttons controller (another SOIC chip) does not require any drivers on OBK side, it should work out of the box
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20903375
    lionboy
    Level 10  
    I don't know how I can figure out if there is another chip for RF or not.


    Added after 1 [hours] 49 [minutes]:

    On the chip near antena is this write: 590R 2326 i don't know what is this and didn't find on google something related to this

    Schematic image of an electronic board with labeled components such as buttons, network indicator, and antenna.

    Pin with ywllow i saw have a beep with Antenna
  • #8 21120483
    Nordlicht77
    Level 9  
    Hi
    I can't get a connection to the device
    Which flashers did it do it with?
    Which pins did you use?
    I still have to add something extra

    I have it like this in this picture
    Electronic module on a board with labeled RX, TX, GND, and 3.3V pins

    greet
    Martin
  • #9 21120653
    p.kaczmarek2
    Moderator Smart Home
    CB3S can be easily flashed with:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    But you need to be able to do a power cycle.
    See tutorials: https://www.youtube.com/playlist?list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM
    Helpful post? Buy me a coffee.
  • #10 21120843
    Nordlicht77
    Level 9  
    so I must

    GND -> GND
    3V -> ADC3
    RX -> TX
    TX -> RX
    CEN -> GND kurz

    additionally

    AMS1117
    left GND -> GND(1)
    right 5V -> IN(3)

    Do I have to do the cutting, if so where?
  • ADVERTISEMENT
  • #11 21120964
    p.kaczmarek2
    Moderator Smart Home
    What is AD3?

    You don't need CEN.

    I would do:
    - RX to TX
    - TX to RX
    - GND to GND
    - connect 5V from USB to board USB port
    Then:
    1. start flash read
    2. disconnect 5V and reconnect it to reset/get bus
    3.flashing should start
    Helpful post? Buy me a coffee.
  • #12 21121269
    Nordlicht77
    Level 9  
    Sorry meant power supply pin (3.3V)

    Doesn't work now
    GND -> GND (FTDI232)
    RX -> TX (FTDI232)
    TX -> RX (FTDI232)
    and USB port on board to USB

    And as described, the USB was disconnected and reconnected
  • #13 21121303
    p.kaczmarek2
    Moderator Smart Home
    So the main question is now - is RX/TX connected anywhere else on your board?

    Check with multimeter.
    Helpful post? Buy me a coffee.
  • #14 21121365
    Nordlicht77
    Level 9  
    like in the picture above
    I've never done anything like this with a multimeter
  • #15 21121370
    p.kaczmarek2
    Moderator Smart Home
    So detach all power, and then set multimeter in the continuity test mode. It should beep when you short the probes. Then, put one probe on RX, and test all other points on PCB for continuity (for beep).

    Alternatively, you can just look at the PCB, are there vias/traces on the other side of the board, under the WiFI module?
    Helpful post? Buy me a coffee.
  • #16 21121448
    Nordlicht77
    Level 9  
    I can't find the multimeter right now
    With the program ltchiptool-v4.11.1 I get such an output at different baud rates
    Screenshot of ltchiptool v4.11.1 with unintelligible console output.
    Not a clear one like with the automatic feeder
    Which FTDI232 are you missing? I have read that it is not ideal for this
    The board looks like this from below
    Printed circuit board seen from below, showing traces and solder points.
  • #17 21121988
    Nordlicht77
    Level 9  
    Hi
    I have now found the multimeter and completely unplugged it from the FTDI232
    there are no sounds
  • #18 21122408
    p.kaczmarek2
    Moderator Smart Home
    Have you flashed any other Beken devices already?
    Helpful post? Buy me a coffee.
  • #20 21122594
    p.kaczmarek2
    Moderator Smart Home
    Well, so if the 3.3V reset method does not work for you, then maybe you can try the CEN approach? Have you read about that? Basically, instead of reconnecting the power, you short CEN to ground for 0.25 s...
    Helpful post? Buy me a coffee.
  • #22 21140406
    p.kaczmarek2
    Moderator Smart Home
    Device from the first post has been added to our database, sorry for the delay, commit:
    https://github.com/OpenBekenIOT/webapp/commit/f9dd8dc42a4043f1df5207cccf0b1f8ef2099012
    It should be soon live at:
    https://openbekeniot.github.io/webapp/devicesList.html
    I have used mode name: TYWD 4CH-RF
    Helpful post? Buy me a coffee.
  • #23 21144422
    divadiow
    Level 34  
    if there was still any doubt, I have the 7-32V/5V USB version of the naked board of this and the RF operates independently. Mine is now running OBK and it still pairs with this 3-button RF switch I got with a different device.

    Printed circuit board with electronic components and power supply on a wooden surface.
    PCB with four blue relays and a CB3S Wi-Fi module.

    bootlog and dump from mine

    Code: Text
    Log in, to see the code
  • #25 21448020
    rainerrmn
    Level 4  
    There is another name for a similar module: TYWB-4ch rf and TYWD-4ch rf. The difference between these modules is the supply voltage(AC-mains or low voltage-DC).
    The Beken CB3s, the rf SYN590, the 4 relays and buttons, the gpios used and all this are the same with these modules.

    So you can merge the information from the other thread:
    https://www.elektroda.com/rtvforum/topic3989878.html
  • #26 21583893
    lcapriotti
    Level 1  
    my goal is to put ESPHome FW on the device (TYWB 4ch-RF, running fw 1.3.10 so tuyacloudclutter is not an option).
    I see two different processes: de-solder the cb3s (Post #1) and in-place flashing (Post #23); second being easier of course, so why de-solder it entirely?

Topic summary

The discussion centers on the Tuya Smart Life Garage Door Motor Receiver 4CH Switch Controller based on the BK7231N chipset and CB3S module. The original poster shared a Tuya JSON configuration for the device and sought guidance on setting up the RF functionality. Participants examined the device's hardware, including GPIO pin assignments, the presence of an RF receiver chip (notably a SYN590 or similar), and the integration of RF with button controllers. Photos of the PCB and chip markings were analyzed to identify RF components and pin mappings, with TX and RX pins identified as GPIO 16 and 15 respectively. Flashing the CB3S module was discussed, including wiring for FTDI232 adapters, power cycling methods, and the use of tools like BK7231GUIFlashTool and ltchiptool. Challenges in establishing a serial connection and flashing firmware were addressed, with suggestions to test continuity on RX/TX lines and alternative reset methods using the CEN pin. The device was eventually added to an open-source database under the name TYWD 4CH-RF. Variants of the module, such as TYWB-4ch RF and TYWD-4ch RF, differ mainly in power supply type (AC mains vs. low voltage DC) but share the same core components and firmware. The possibility of replacing the original firmware with ESPHome was raised, with in-place flashing preferred over desoldering the CB3S chip. Overall, the thread provides detailed technical insights into hardware identification, firmware flashing, and RF setup for Tuya-based 4-channel garage door controllers using the BK7231N/CB3S platform.
Summary generated by the language model.
ADVERTISEMENT