logo elektroda
logo elektroda
X
logo elektroda

[BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP

viny182 4881 1
ADVERTISEMENT
  • #1 20436717
    viny182
    Level 2  
    Hello,

    I am adding a teardown for a cheap Tuya Brazilian standard Smart Plug bought on Aliexpress with the BK7231N / CB2S chip.
    [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP
    [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP

    It can be converted using tuya-cloudcutter, but if you are flashing more than one device, you need to re-download the firmware image for each sub sequential device. The flash process will work for the first one, but it will not work for the second and onwards if you do not re-download the OpenBeken image and put it on custom-firmware folder every time. Not sure if this is a bug. Important: Always use the "UG" image when using tuya-cloudcutter.

    It has 1 power switch button and uses the BL0937 IC for power measurements.

    Info Summary:
    Model/SKU from Box: TY-BRP
    Model from Manual: RMC001
    Model/Revision from the Board: RM-TY017-MAD2HG (perhaps it can be a B instead D, due to print fail, see photos below)
    Chip: BK7231N / CB2S
    Rated Voltage: 100V-240V
    Current: 16A (not tested)
    Power IC: BL0937
    Relays Qty: 1
    Buttons: 1
    MCU/Firmware Version (from Smart Life App, before Flashing): 1.1.8

    When on Tuya-CloudCutter interactive mode, select "2) Flash 3rd Party Firmware" on the first prompt and select your UG downloaded image, and on the next prompt, select "> By firmware version and name". Scroll down to "1.1.8 - BK7231N / oem_bk7231n_plug", select the "Tuya Generic" brand and then the "LSPA7 Plug". Other devices from Aubess and Nous also worked.

    After those selections, tuya-cloudcutter will start the process and will ask you to put the device in the "AP Mode"

    To get into the "AP Mode", you need to push and hold the button for 5-8 seconds and then the led will start flashing quickly. After that, you need to do it once again (push and hold the button for another 5-8 seconds) then the led will flash slower and it will be on the "AP Mode".

    Tuya Cloud-Cutter will detect automatically the device when on this status. After the 1st phase of the tuya cloudcutter process, the device will freeze and you will be asked to turn the device off and enter on "Ap Mode" once again. Just repeat the steps above.

    After the process is finished, you will be able to connect to the "Open_BenkenXxxxx" SSID Netowork, and access the device trough the IP 192.168.4.1 and do all the required setup.

    After Connected to the OpenBK device page, go to "config" -> "Configure Module" and set the pinout as below:
    P6 (PWM0) = BL0937CF1
    P7 (PWM1) = BL0937CF
    P8 (PWM2) = LED_n
    P10 (RXD1) = Btn
    P24 (PWM4) = BL0937SEL
    P26 (PWM5) = Rel
    *Leave all Channels as 0

    Click on the Save Button, then go to "Return to Cfg" and then click on the Button "Configure General/Flags"
    * the flags are optional, but recommended to keep current status updated on HA after a power outage for example
    Check all the flags below:
    Flag 2 - [MQTT] Broadcast self state every N
    Flag 10 - [MQTT] Broadcast self state on MQTT connect
    Flag 19 - [MQTT] Always publish channels used by TuyaMCU

    Click on the "Submit" button and After that you can go back to the Config menu to config the device name, your wifi and MQTT to connect to your home assistant instance or whatever MQTT server you are running. HA Pro tip: After all this is configured and MQTT is successfully connected, you can go on the Config Menu -> Home Assistant Configuration and click on the button "Start Home Assistant Discovery" and then your device will show up on Home Assistant automagically.

    The BL0937 was almost 100% perfect calibrated, but with help from a multimeter and a 25w light bulb, I have increased the power measurements precision by using VoltageSet 12X.X and PowerSet 25.0 commands on the Config -> "Execute Custom Command Menu"

    Here all the pictures:
    [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP

    [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP
    [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP
  • ADVERTISEMENT
  • #2 20436959
    p.kaczmarek2
    Moderator Smart Home
    Thanks, very nice review!
    I can just add few things:
    - this flag:
    Flag 19 - [MQTT] Always publish channels used by TuyaMCU
    is not needed, it does nothing here
    - you can enable Tasmota TELE in flags and then this plug will be also useable in ecosystems like ioBroker, etc, just like Tasmota device
    - consider adding "startDriver SSDP" startup command so Windows can see your OBK devices:
    [BK7231N / CB2S] Teardown Tuya Wifi Smart Brazil Switch Plug TY-BRP
    Helpful post? Buy me a coffee.
ADVERTISEMENT