logo elektroda
logo elektroda
X
logo elektroda

Exploring Cozylife DS-1321AL Smart Switch with Bouffalo Labs BL602 Module DT-BL02

divadiow 1482 3
ADVERTISEMENT
  • Helpful post
    #1 21157327
    divadiow
    Level 35  
    In my never ending pursuit to collect everything I have obtained one of these neutral/no neutral Bouffalo Labs BL602-based smart switches. It's a single channel Cozylife DS-1321AL.
    Photo of the Cozylife DS-1321AL smart switch with technical information.

    https://www.aliexpress.com/item/1005006150931509.html

    Model: WiFi Switch Module
    Input: AC100-240V 50/60Hz
    Current: 10A
    LED: Max 400W/Gang
    Operation temp: -10℃-+40℃
    Case temp:Tc: +80℃ (Max)
    Dims (LxWxH):47.3x20x47.3 mm

    Inside is a module I have not had or seen before. It has 1 mention on Elektroda in a post from @Zain00 and one from @Zhekos555 here.

    The DT-BL02 looks to have something to do with Cozylife but the XT-BL02, which is referenced on the RF shield, is by Shenzhen Xiaoteng Technology Co. Datasheet attached.

    https://cozylife.app/product/zh/hardware/wifi/dt-bl02.html

    DT-BL02 module with pin markings at the bottom of the board. Module with pin headers labeled 3V3, GND, IO7, IO16, IO8, IO14.
    Table of module pins and their functions.

    Some general pics first.

    Cozylife DS-1321AL WiFi switch module with visible connection terminals. Technical specifications of a WiFi switch on a white box. Close-up of the switch module box specifications. Yellow DGCX capacitor next to Cozylife Switch manual on a blue background. WiFi switch module with user manual and capacitor User manual of the Cozylife DS-1321AL WiFi switch with wiring diagrams and a QR code for the app. CozyLife smart switch user manual with wiring diagrams. Cozylife DS-1321AL WiFi switch module on a blue background. Close-up of connector terminals on the switch module. Close-up of the Cozylife DS-1321AL WiFi switch module with visible electronic components. Close-up of an electronic switch module with capacitors and a coil. Close-up of the DS-1321AL WiFi switch module. Image of a Cozylife DS-1321AL WiFi switch module with integrated circuits on a green printed circuit board. Main module of the Cozylife DS-1321AL switch with visible electronic components. Printed circuit board of the DS-163A REV 1.0 WiFi switch module. DT-BL02 module on a blue surface. DT-BL02 WiFi module with visible model and frequency band markings. DT-BL02 module with WiFi and Bluetooth label on a blue background. Image of the DT-BL02 WiFi module with visible pins and markings. WiFi Module XT-BL02 on a Blue Background WiFi module with soldered wires on a wooden background Switch module with soldered wires on a blue background. Cozylife DS-1321AL WiFi switch module with soldered USB-TTL adapter.

    and with the module soldered up to the USB-TTL adaptor, the log out was captured:

    Code: Text
    Log in, to see the code


    and with D8 pulled high with a 10k resistor in circuit the factory firmware was dumped using BLDevCube 1.8.9, attached.

    OpenBeken was flashed and booted as expected. The GPIO doctor led to the discovery the below assignment. Made even easier with the limited number of GPIOs exposed on the module.

    "14": "Btn;1",
    "20": "Rel;1",
    "21": "WifiLED;0"

    However! There is not continuity from P14 to the button contacts and the button does not work as expected. Using Btn_n we get this constantly in the logs

    Code: Text
    Log in, to see the code


    So maybe this is an ADC_Btn? Perhaps IO14 having ADC_2 function gives credence to this. This has no effect though and there is no adcbutton driver present in BL602 release.

    OBK template

    Code: JSON
    Log in, to see the code


    https://github.com/OpenBekenIOT/webapp/pull/133
  • ADVERTISEMENT
  • #2 21158529
    p.kaczmarek2
    Moderator Smart Home
    Thank you for another interesting research. Regarding IO 14, how does it work in GPIO doctor or with dInput? Does it recognize both high and low state? Do you have to set just dInput, or maybe dInput_pullDown (or whatever it was called)?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21158628
    divadiow
    Level 35  
    well, with the bulb off (connected to output of relay) setting P14 to dinput closes the relay and the bulb comes on. Reverse that by changing P14 to dinput_n and the bulb will go off again.

    I've tried dInput_NoPullUp and dInputNoPullUp_n also, but these have no effect on the relay

    pushing the physical button does not toggle the relay open/closed with any assignment
  • Helpful post
    #4 21177521
    p.kaczmarek2
    Moderator Smart Home
    Those no-neutral switches are indeed constructed in a very interesting manner. I wonder what is the purpose of those two NP3095 on the board?
    NP3095G transistor datasheet with diagrams, specifications, and features.
    I've been drawing a schematic of no-neutral wall light switch once. It was interesting:
    https://www.elektroda.pl/rtvforum/topic3793509.html
    Helpful post? Buy me a coffee.
ADVERTISEMENT