logo elektroda
logo elektroda
X
logo elektroda

Teardown Action LSC SmartPlug 3202087 BK7231N/CB2S, PCB: WP02GE-F 2023-08-04, with Energy Meter

alvinx 3207 5
ADVERTISEMENT
📢 Listen (AI):
  • White Action LSC smart plug on a wooden surface.
    Action sells these in Germany, there are several versions of them, they started with ESP826x-based plugs and switched to Beken-chips at some point.
    The early ones had screws to open, the cases of the later ones like this here are just clicked together. Here is a detailed teardown and OpenBeken flashing guide. Device information:

    PCB-Label: WP02GE-F 2023-08-04
    BKN-Chip: BKN7231N
    BKN-Board: CB2S

    It looks like this:

    White smart plug with a button on the front side.
    White Action LSC smart plug on a wooden surface. Back view of a white smart plug. White electrical plug with certification markings on a wooden surface.

    To open it use a slim blade and put it about 5mm inside to pry it open:
    A smartplug on a wooden desk with a tool for opening it. A person opens the casing of a smart plug using a narrow blade.

    This is how it looks inside:
    Close-up view of a CB2S PCB with pin type labels on the Beken chip. Interior of a smart plug showing the PCB and components. Interior of a smartplug with components on a PCB Interior of a smart plug featuring BKN7231N chip on PCB WP02GE-F. Interior of a smart plug with a PCB labeled WP02GE-F 2023-08-04. Interior of a smart plug with exposed PCB and electronic components. Opened smart plug showing electronic components on the PCB. Interior view of a smart plug with connected wires.

    Here's the pinout of the CB2S-Board:
    Diagram showing the pin layout on the CB2S board. Diagram of CB2S board with pin labels and dimensions.

    To flash it we need to connect our FTDI-USB-Programmer to the pins 3,3V, GND, RX, TX and a Cable to CEN (so that we can connect that to GND to get into program mode).
    I soldered some Dupont-Cables to these pins, like this:
    Close-up of a circuit board with cables connected to a programmer. FTDI-USB module with attached Dupont cables. Close-up of the interior of a smart plug with several wires soldered to the pins on the PCB. CB2S motherboard with connected Dupont cables.
    It's not pretty but it works and it's just temporary, I desolder these after flashing anyway.


    My FTDI-USB-Programmer is set to 3,3V via Jumper and I connected it like this:
    FTDI CB2S
    VCC 3,3V
    GND GND
    RX TX
    TX RX

    and a loose cable to CEN of the CB2S... we need to short it to GND later to start flashing.

    I used the GUI BKN-Flashtool from here: https://github.com/openshwprojects/BK7231GUIFlashTool

    Connect your FTDI-USB-Programmer to your PC and start the flash-Tool:
    BK7231N flasher tool interface with open log window.
    select the following:
    - the correct COM-Port, here it is COM4
    - the chip type, CB2S uses BK7231N
    - the firmware you want to flash, you can download the latest Firmware with the Button "Download latest from Web", which I did ... you can get Firmwares from here too: https://github.com/openshwprojects/OpenBK7231T_App/releases and put them in the firmwares-folder of the flash-Tool
    I did not change anything else.

    Now you can do a backup of the firmware which I highly recommend because you get the GPIO-pins the plug is using, which need to be configured later for it to work properly !
    So click "Do firmware backup (read) only"... it looks like in the above screenshot... now touch very briefly the loose cable from CEN to the GND pin and the backup should start, it looks like that:
    Screenshot of BK7231 Easy UART Flasher showing successful reading.

    after that is finished successfully you get this window showing the extracted GPIO-config:
    Screenshot of Tuya device GPIO configuration.
    Copy and paste this information into a text editor, we need that later !

    Now we flash the OpenBeken-Firmware, click "Do firmware write (no backup)" ...
    now again touch very briefly the loose cable from CEN to the GND pin and it should start flashing:
    Screenshot of the BK7231 Easy UART Flasher application during firmware flashing.
    Screenshot of BK7231 Easy UART Flasher tool with Write success! message.

    Congrats, we have successfully flashed OpenBeken !

    We still power it from th FTDI-Programmer via USB.

    Now connect to the AccessPoint that is created:
    Smartphone screen displaying the OpenBK7231N_5055331E Wi-Fi network.

    and open 192.168.4.1 in your webrowser to get to the OpenBeken-WebUI:
    Screenshot of the OpenBK7231N interface on the configuration page.
    There is no ON/OFF-Button yet, because we have to configure the correct pins for the relay, butten and led first.

    click on "Config" and you get to this page:
    OpenBeken configuration panel on a mobile device

    Then click on "Configure WiFi & Web" to connect it to your Wifi-network, should be self explanatory, I won't go into detail here.

    After that the chip will connect to your Wifi and get an IP-address via DHCP, so look in your router's WebUI which IP it uses now.
    Then connect to your Wifi and open the new IP in your webbrowser.

    Now it's time to remove the soldered cables by desoldering them, after that check if your solder connections to the CB2S-board are still good and not shorted or so !
    Put everything back into the plug-case and close it correctly by pushing the two halves together again.
    You can plug it into mains now and power it from there... reconnect via webbrowser again to finish the configuration...

    I switch to my PC now, so the screenshots are bigger from here on...
    click on "Configure Module" to setup GPIO pins, we got the following info extracted before after doing the backup:
    -----------------------
    Device configuration, as extracted from Tuya:
    - BL0937 SEL on P11
    - Button (channel 1) on P7
    - LED (channel 1) on P6
    - BL0937 VI on P24
    - WiFi LED on P10
    - BL0937 ELE on P26
    - 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
    -----------------------
    That translates to this:
    Screenshot of OpenBK7231N interface showing the pin configuration for CB2S.

    I gave my plug a better name in "Config" -> "Configure Names", especially to use it in Home Assistant later under that name, I choose f.e. "bkn_lsc_plug1".

    After that you can go back to "home" and you should see a ON/OFF-toggle to switch the plug, hope it works !
    OpenBeken user interface screen displaying information about the bkn_lsc_plug1 plug.

    Additional information:
    You should see energy metering information too, but that needs to be calibrated first, go to http://<your-ip-address>/app and then "Tools" for that.
    See here for more on that: https://www.elektroda.com/rtvforum/topic4030107.html

    To get energy statistics you need to add NTP time sync by adding "startDriver NTP" to your autoexec.bat, needs to be created via http://<your-ip-address>/app under "Filesystem".
    Do your research how to setup an autoexec.bat-file which gets executed at boottime of the plug, video here: https://www.youtube.com/watch?v=kXi8S12tmC8

    Here is my autoexec.bat:

    //start NTP driver
    startDriver NTP
    
    //timezone +1 (add one hour to UTC time)
    ntp_timeZoneOfs 1
    
    // Setting the devices location will allow for calculating sunrise and sunset times
    // put your GPS latitude and longitude here with 6 digits after the comma, not sure if more digits work
    //ntp_setLatlong <latitude>, <longitude>
    
    //enable powersaving
    //PowerSave 1
    //EDIT: I disabled PowerSave after this comment from p.kaczmarek2:
    //- I advise you to be careful with "PowerSave" with the BL0937, 
    //  because the BL0937 requires precise pulse/interrupt counting and potentially "PowerSave" can reduce the precision. 
    //  With the BL0942 this problem does not occur.
    
    
    //wait for NTP to connect
    waitFor NTPState 1



    Do your research on how to add your Openbeken-device to Home Assistant, here's a video: https://www.youtube.com/watch?v=pkcspey25V4


    I hope you enjoy this Teardown and HowTo and that it help some people... have a great day !

    btw. I really like OpenBeken, very well done with sooo many options, thank you to the OpenBeken-developers !


    EDIT:
    Here's my template from the /app-WebUI + some information added:
    {
      "vendor": "Action LSC",
      "bDetailed": "0",
      "name": "Action LSC Smartplug",
      "model": "3202087 2023-08-04",
      "chip": "BK7231N",
      "board": "CB2S",
      "flags": "1024",
      "keywords": [
        "lsc",
        "smartplug",
       "energymeter",
       "CB2S",
        "BK7231N"
      ],
      "pins": {
        "6": "LED;0",
        "7": "Btn;0",
        "8": "Rel;0",
        "10": "WifiLED;0",
        "11": "BL0937SEL;0",
        "24": "BL0937CF1;0",
        "26": "BL0937CF;0"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/7456543000_1731711564.jpg",
      "wiki": "hhttps://www.elektroda.com/rtvforum/viewtopic.php?p=21305004#21305004"
    }

    Cool? Ranking DIY
    About Author
    alvinx
    Level 2  
    Offline 
    alvinx wrote 2 posts with rating 8, helped 1 times. Been with us since 2024 year.
  • ADVERTISEMENT
  • #2 21305208
    p.kaczmarek2
    Moderator Smart Home
    Thank you for the detailed description! I will only add my comments:
    - I advise you to be careful with "PowerSave" with the BL0937, because the BL0937 requires precise pulse/interrupt counting and potentially "PowerSave" can reduce the precision. With the BL0942 this problem does not occur
    - I personally prefer to desolder the CB2S and flash it off-chip: https://www.youtube.com/watch?v=YQdR7r6lXRY . RESET via CEN can sometimes be problematic.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21305617
    alvinx
    Level 2  
    Thank you very much for your knowledge.

    I will delete PowerSave in my autoexec.bat then.
  • ADVERTISEMENT
  • #4 21330471
    irekhq
    Level 13  
    Device as per topic.
    Firmware uploaded:
    Build: Built on Dec 1 2024 12:26:58 version 1.17.782
    Everything works correctly, only I can not change the version via OTA, it always starts with version 782
    
    Info:OTA:init OTA, startaddr 0x12a000
    Info:OTA:12a000
    Info:OTA:12b000
    ...
    Info:OTA:close OTA, additional 0xb00 FF added 
    Info:OTA:1a5000
    Info:OTA:close OTA, addr 0x1a5400
    Info:MAIN:Module reboot in 2...
    Info:MAIN:Module reboot in 1...
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 48 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 10 changes count.
    Error:CMD:no file early.bat err -2
    Info:EnergyMeter:Read ENERGYMETER status values. sizeof(ENERGY_METERING_DATA)=32
    Info:MAIN:Started BL0937.
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    ...
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    
    .
    What am I doing wrong ?
  • ADVERTISEMENT
  • #5 21330478
    p.kaczmarek2
    Moderator Smart Home
    Just to be sure - what file are you giving to the OTA and where?
    Helpful post? Buy me a coffee.
  • #6 21330487
    irekhq
    Level 13  
    I enter via /app? , I select the OTA tab.
    From the list "Select remote OTA file to download to PC:", I select for example the latest firmware OpenBK7231N_1.17.788.rbl.
    In "Select OTA file from disk:", I select the previously downloaded firmware.
    I click "Start OTA"
📢 Listen (AI):
ADVERTISEMENT