logo elektroda
logo elektroda
X
logo elektroda

Flashing Tuya-based smart socket with OpenBeken firmware on CB2S (BK7231N) module

Hamalaon 2004 5
ADVERTISEMENT
  • Helpful post
    #1 21103585
    Hamalaon
    Level 3  
    Today we will flash another Tuya-based smart plug.
    ATMT Smart Socket EU Mini plug on a white background. White smart plug with a power button on the top.

    I bought it on famous russian marketplace for 4 EUR. However I've also seen similar on international chinese store.
    At the time of purchase there was no informaiton about vendor and model name. But according to the text on case this is ATMT Smart Socket EU Mini.
    Generally it looks like this one but using completely different pinout.

    Pinout details:
    Device configuration, as extracted from Tuya:
    - BL0937 SEL on P26
    - Button (channel 1) on P24
    - BL0937 VI on P7
    - WiFi LED on P23
    - BL0937 ELE on P6
    - Relay (channel 1) on P8
    Device seems to be using CB2S module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424

    Some photos of internal PCB:
    Top view of a PCB with a YONGNENG YX201T-S-105DM relay. Interior view of the PCB of a smart socket with mounted components. Interior of ATMT Smart Socket EU Mini with visible electronic components on the PCB.
    I flashed two devices and in both cases that green capacitor was soldered in very inclined way.

    For flashing I removed CB2S module from main PCB
    CB2S module with visible pins and labels. CB2S module with an integrated circuit on a white background. Close-up of a PCB with an electronic component and soldered connections.


    and connected it to CH340 USB-TTL adapter.
    Close-up of CB2S module with wires connected to various pins. USB-TTL adapter with pins and casing. CB2S module connected to USB-TTL adapter on a breadboard.
    Spoiler:
    (yes, it is not a well soldering, but enough for flashing)

    VCC->3v3
    TXD->RX
    RXD->TX
    GND->GND

    It is recommended to use a stable 3v power source, but I was too lazy so I connected chip directly to USB-TTL and everything flashed well.

    Flashed successfully as in manual here
    Firmware version 1.17.592. Flashed with GUI Tool.

    Extracted config:
    {
       "sel_pin_pin":"26",
       "rl1_lv":"1",
       "bt1_pin":"24",
       "net_trig":"2",
       "jv":"1.0.5",
       "netled1_lv":"0",
       "netled_reuse":"0",
       "bt1_type":"0",
       "ffc_select":"0",
       "nety_led":"1",
       "vi_pin":"7",
       "resistor":"1",
       "over_cur":"16000",
       "bt1_lv":"0",
       "reset_t":"5",
       "netled1_pin":"23",
       "chip_type":"0",
       "lose_vol":"85",
       "over_vol":"265",
       "module":"CB2S",
       "ele_pin":"6",
       "ch_cddpid1":"9",
       "ch1_stat":"2",
       "rl1_type":"0",
       "ch_num":"1",
       "ele_fun_en":"1",
       "rl1_pin":"8",
       "netn_led":"0",
       "vol_def":"0",
       "ch_dpid1":"1",
       "sel_pin_lv":"1",
       "crc":"75"
    }


    And template:
    {
      "vendor": "ATMT",
      "bDetailed": "0",
      "name": "Smart Socket EU Mini",
      "model": "smartplug",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "0",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "6": "BL0937CF;0",
        "7": "BL0937CF1;0",
        "8": "Rel;1",
        "23": "WifiLED_n;0",
        "24": "Btn;1",
        "26": "BL0937SEL;0"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/9965663600_1717265759.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic4057500.html"
    }



    Now I have a fully featured smart socket. Many thanks to firmware developer.
  • ADVERTISEMENT
  • #2 21104700
    p.kaczmarek2
    Moderator Smart Home
    I'm glad to hear it's working. Just take care with that soldering, doing solder joints without flux may end with a hard to debug flashing issue (loose connection, etc).

    This plug looks like yet another LSPA9 clone, but I will still happily add it to our list. We can check if the templates are matching.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21153065
    Hamalaon
    Level 3  
    Once I decided to measure my water boiler power using this plug.
    After connecting all the things and turning on relay there was a little explosure sound inside a plug and boiler turned off.

    When I disassembled plug, anything looked right, except the fuse.
    This little black component is a fuse. But instead of 16A or 20A there was one rated 2A, which obviously burned under a higher load.
    Image of the inside of a plug with a fuse highlighted in red.

    Finally I replaced the fuse and everything is working now.
    I decided to check another plug, and exploded another 2A fuse. So actually I think that our chineese friends just put 2A instead of 20 by mistake.
  • ADVERTISEMENT
  • #4 21153134
    p.kaczmarek2
    Moderator Smart Home
    Isn't it just a fuse for powering relay and WiFi module?

    I don't think this fuse is used for powering plugged device...
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21159351
    Hamalaon
    Level 3  
    I didn't check board wiring, but according to the tests on two plugs it seems to be fuse for powered device.
    After fuse is broken WiFi is still connected, but relay and outlet are not working.
  • #6 21305530
    WCHPikus
    Level 14  
    Hello.
    Does anyone have a spreadsheet for the roller shutter module?

    Flashing has worked nicely, relay and led are working, only problem is with the keys.... Smart Curtain Controller module with technical specifications. .

    Generally it is worth soldering out the module for flashing.
    Regards
ADVERTISEMENT