logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant

p.kaczmarek2 5577 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    Here is a short teardown and flashing instruction (and how-to-free-from-cloud guide) for another popular Tuya wall switch, the WiFi DS-101JL, although you can also do the same with its 2gang and 3gang version. This switch is based on BK7231N, so you can upload OpenBeken . There is a module inside CB3S which directly controls the relays, as well as touch buttons and additional LEDs (WiFi status LED and relay status LEDs). Both LEDs are on separate GPIO, which is very good, because it gives us the ability to freely configure their behavior (some people prefer the LED to be on when the light is off, and others to have the LED turn on together with the light).

    Purchase of DS-101JL
    The product was bought on a Polish auction site for less than PLN 55 (12$ or so) with free shipping, it was bought by a reader so that I could change the firmware for him:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    The specification reveals that it may be something on the BK7231, because Bluetooth is mentioned in it, the ESP8266 itself does not support BT:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    Product Parameters:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    Installation:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    The above switch can work without the N cable! Connection details in the diagram.
    The seller does not display the model of the product, but one of the graphics from the auction shows that it is DS-101:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant

    Parcel received
    Let's see what do we get in the package?
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    The set also includes a capacitor to be mounted in parallel:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    Description of the assembly in Polish (a plus for the seller for writing "capacitor" and not an adapter):
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    By the way, this capacitor also has a built-in resistor, does anyone know, maybe for what purpose it is? Is this just against holding a load longer or does it have another role?
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    And the switch itself:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant

    DS-101JL teardown/b]
    We pry the front cover with a screwdriver:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    We pry the board, which is held only by a pin connector:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    The switch uses the CB3S WiFi module. The chip in the SOIC is not a TuyaMCU, it's just a touch button controller.
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    PCB designation: A-1011WL3B2-REV A0 2022-08-18
    I haven't analyzed the power section yet, but here are some pics:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    On the board you can see S7142S:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    As usual, we have a small flyback converter here. You can also see elements that look like triacs or MOSFETs, NP3095. The small A63A chip is probably the LM321, but I have not analyzed its role in this system, and I have not deciphered the meaning of the LPS A60T1.

    [b] Firmware change

    The purpose of the topic is to change the product firmware, so I will focus on the WiFi module board. I will use BK7231 gui flasher as per:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    First, some flux and time to whiten the pads, ground and 3.3V, as well as RX1 and TX1:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    You can find CB3S pins on the web.
    Then we solder the wires:
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    Ready layout (see BK7231 gui flasher manual):
    [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant [BK7231N/CB3S] DS-101JL WiFi Single Light Switch Teardown and Flashing Guide for Home Assistant
    BK7231 gui flasher in the latest version can extract the Tuya GPIO configuration The full template is below:
    Code: JSON
    Log in, to see the code

    Description in words:
    Quote:

    - Relay (channel 1) on P6
    - WiFi LED on P22
    - LED (channel 1) on P26
    - Button (channel 1) on P20



    Summary
    The firmware change went smoothly. Now you can use Home Assistant Discovery in OBK to pair the switch with Home Assistant. The double and triple gang versions can also be handled in the same way. Fortunately, there was no additional MCU inside handling anything but communication, it is not a TuyaMCU based switch, so there are no complications or difficulties to set up.
    By the way, this switch may be better to buy in some cases, because it is able to run without N, and also because there are two LEDs on separate GPIOs.
    PS: Btw, I also recommend reading the related topic posted by a reader from the USA, which discusses a different version of this switch and also shows how it can be programmed via WiFi, without soldering wires:
    https://www.elektroda.com/rtvforum/topic3978184.html[/b]

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 12004 posts with rating 10026, helped 574 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 20694644
    jkwim
    Level 12  
    Oh!
    I had missed this new post about DS-101JL.

    I purchased my DS-101JL in last year and was struggling with them and just left them aside.

    The PCB version was A-1011WL3B2-B123-V2.0 and it had a WB3S module which was based on BK7213T.

    This was my story:

    https://www.elektroda.com/rtvforum/topic3978184.html#20581762

    After all the struggle, couldcutter helped me and the switches are in operation for few months now.
  • ADVERTISEMENT
  • #3 20748402
    jkwim
    Level 12  
    I recently bought a 4-Gang DS-101JL which has a [BK7231N/CB3S] so I decided to post here.

    It came with Tuya FW V1.3.5.

    According to this page, this FW is a patched version hence tuya-cloudcutter is not an option to flash new firmware.
    Known Patched Firmware


    Here are some pics:
    Green product box with text SWITCH Smart life goes now and logos of Amazon Alexa and Google Assistant.

    Wall switch module DS-101JL with specification description on its casing

    Close-up of DS-101JL-4A-1 circuit board in a white frame.
    PCB: DS-101JL-4A-1 REV A0 20221026

    Close-up of a PCB with a CB3S module.
    PCB: A-1011CW4B3 REV A0 2022-11-05

    View of a printed panel with four white buttons on a PCB.

    Here are the possible connection points for flashing:
    PCB of DS-101JL-4A-1 modem with labeled connection points.

    Since I had a 2mm (not standard 2.54mm) pin header, I decided to use that for solderless power connection and soldered jumper cables for TXD/RXD.
    Close-up of a PCB with connected wires.
    RST was momentarily grounded to initiate flashing.

    I could not use the higher baud rates offered by the tool. Ended up using 19200.

    Following is the Tuya config:

    {
    	"rl1_lv":"1",
    	"netled_lv":"0",
    	"bt_type":"0",
    	"bt1_pin":"24",
    	"net_trig":"4",
    	"cd_flag2":"1",
    	"backlit_select":"1",
    	"nety_led":"0",
    	"backlit_io_pin":"23",
    	"netled_pin":"22",
    	"total_stat":"2",
    	"bt1_lv":"0",
    	"module":"CB3S",
    	"rl2_pin":"8",
    	"light_status_select":"0",
    	"cyc_dpid":"17",
    	"bt2_lv":"0",
    	"rl1_pin":"6",
    	"rl4_lv":"1",
    	"rl3_pin":"9",
    	"rl3_lv":"1",
    	"rand_dpid":"18",
    	"led_dp":"15",
    	"rl4_pin":"26",
    	"jv":"1.0.0",
    	"backlit_io_lv":"1",
    	"bt3_lv":"0",
    	"reset_t":"9",
    	"rl2_lv":"1",
    	"ch_flag1":"1",
    	"ch_flag3":"1",
    	"bt4_pin":"14",
    	"ch_flag4":"1",
    	"inch_dp":"19",
    	"bt3_pin":"7",
    	"ch_cddpid1":"7",
    	"init_conf":"14",
    	"bt4_lv":"0",
    	"bt2_pin":"20",
    	"ch_cddpid4":"10",
    	"ch_cddpid2":"8",
    	"ch_cddpid3":"9",
    	"backlit_dp":"16",
    	"ch_num":"4",
    	"ch_dpid3":"3",
    	"ch_dpid4":"4",
    	"netn_led":"1",
    	"ch_dpid1":"1",
    	"ch_dpid2":"2",
    	"crc":"40",
    	"}Agw_di{abi":"0",
    	"id":"null",
    	"swv":"1.3.5",
    	"bv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.4",
    	"pk":"key5ckdnys3pqgec",
    	"firmk":"key5ckdnys3pqgec",
    	"cadv":"1.0.5",
    	"cdv":"1.0.0",
    	"dev_swv":"1.3.5",
    	"s_id":"null",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"1",
    	"mst_tp_0":"9",
    	"mst_ver_0":"1.3.5",
    	"mst_md5_0":"null",
    	"mst_tp_1":"0",
    	"mst_ver_1":"null",
    	"mst_md5_1":"null",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"mst_md5_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"null",
    	"EVIAastro_timer0Atls_ca_cnt0{timestamp":"1695233606",
    	"index":"0}IKAastro_timer{timestamp",
    	"passwd":"cHJvMTIzNDUxMjM0NQ==",
    	"md":"1",
    	"random":"0",
    	"wfb64":"1",
    	"stat":"2",
    	"token":"PyQgk{nc_tp",
    	"ssid":"S2FsaW1hbmt1IDRHIFNMVA==",
    	"region":"EU",
    	"reg_key":"B0Fo",
    	"dns_prio":"0 }wd",
    	"cnt":"0}"
    }


    And the suggested config:

    Device configuration, as extracted from Tuya: 
    - Button (channel 1) on P24
    - WiFi LED on P22
    - Relay (channel 2) on P8
    - Relay (channel 1) on P6
    - Relay (channel 3) on P9
    - Relay (channel 4) on P26
    - Button (channel 4) on P14
    - Button (channel 3) on P7
    - Button (channel 2) on P20
    Device seems to be using CB3S module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424


    However there was a problem. The Blue LEDs of the switches get lit when active, but the Red LEDs when switched off did not get lit.

    Looking at the Tuya configuration, interesting finding was made:
    
    "backlit_dp":"16",
    "backlit_io_lv":"1",
    "backlit_io_pin":"23",
    "backlit_select":"1",


    So I set PIN 23 to "Always High" and then all the RED LEDs got lit up.

    Then I set PIN23 to LED and a new toggle button appeared.

    So you can either leave it permanently HIGH or configure a toggle button on webGUI to toggle it. First option is preferred I suppose.

    Added after 7 [minutes]:

    Here is the backup image
  • ADVERTISEMENT
  • #4 20748417
    jkwim
    Level 12  
    There was one more issue with the tool.

    I used the option in the tool to configure automatically.

    However the device name did not match the standard default device naming convention of using the last 4 octets of the MAC address

    Screenshot showing device information and network settings.
  • ADVERTISEMENT
  • #5 21394793
    rainerrmn
    Level 4  
    There is an alternate option for this wall-switch. With the brand "athom", you can buy the DS-101JL with 1, 2 or 3 relays. The touchboard is similar to the board p.kaczmarek2 has in his DS-101JL, but with an controller JS-03-8285. This is a athom ESP12-module with an ESP8285 (ESP8266 with internal 1MBit).
    You can order this version of the the DS-101JL preflashed with tasmota.
  • #6 21395956
    p.kaczmarek2
    Moderator Smart Home
    But is it still produced with ESP?

    jkwim wrote:

    However the device name did not match the standard default device naming convention of using the last 4 octets of the MAC address

    Name can be changed in Configure names to anything you want:
    Interface for changing device names for BK7231T_WB3S_WhiteStripWindows with fields for entering short and full names.
    Helpful post? Buy me a coffee.
ADVERTISEMENT