logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB

AgranBox 2433 11
ADVERTISEMENT

  • [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB
    [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB
    A new version of a similar BSD31 smart socket. It differs in that both USB ports are controlled independently and the BK7231N chip is used, not T.

    When buying, the firmware version 1.1.8 is installed on the smart socket.

    I installed the OpenBK7231N firmware using tuya-cloudcutter installed on Raspberry 3 with Raspberry PI OS.

    I chose hack "By firmware version and name": "1.1.8 - BK7231N / oem_bk7231n_plug"

    or download last firmware file OpenBK7231N_UG_1.17.135.bin to /tuya-cloudcutter/custom-firmware and run:
    sudo ./tuya-cloudcutter.sh -r -p "mirabella-genio-i004527-double-plug" -f "OpenBK7231N_UG_1.17.135.bin"


    Hacking occurs according to the instructions, from the second pass. After that, the device gives the impression of being broken, the indicators are not lit, the buttons are not pressed, but it is working. You can connect to the OpenBK7231N_MAC Wi-Fi network and configure the device by URL http://192.168.4.1/.

    
    ClearIO // clear old GPIO/channels
    lfs_format // clear LFS
    StartupCommand ""  // clear STARTUP
    stopDriver *  // kill drivers
    backlog setPinRole 6 Rel; setPinChannel 6 1
    backlog setPinRole 7 Rel; setPinChannel 7 2
    backlog setPinRole 10 Btn_Tgl_All; setPinChannel 10 0
    backlog setPinRole 24 Rel; setPinChannel 24 0
    backlog setPinRole 26 WifiLED_n; setPinChannel 26 1
    setChannelLabel 0 Plug
    setChannelLabel 1 USB1
    setChannelLabel 2 USB2
    Flags 1024
    


    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Wi-Fi Smart Plug 16A ЕС AU UK BRA + 2.1A Dual USB",
      "model": "LSPA2",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "6": "Rel;1",
        "7": "Rel;2",
        "10": "Btn_Tgl_All;0",
        "24": "Rel;0",
        "26": "WifiLED_n;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/1114790300_1686685394.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic3983684.html"
    }


    [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB

    Cool? Ranking DIY
    About Author
    AgranBox
    Level 4  
    Offline 
    AgranBox wrote 5 posts with rating 2. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 20616527
    p.kaczmarek2
    Moderator Smart Home

    That's the first device with independent USB port control that I've ever seen. Have you considered using:
    
    setChannelLabel 1 USB1
    

    to give them some better display names on UI? See our docs:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md

    Also, have you checked USB current capability of the port?


    Can you attach Tuya config partition binary, extracted as shown here:
    https://www.youtube.com/watch?v=WunlqIMAdgw&ab_channel=Elektrodacom
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 20616594
    p.kaczmarek2
    Moderator Smart Home

    Here's what I extracted:
    
    Device configuration, as extracted from Tuya: 
    - Relay (channel 3) on P7
    - Pair/Toggle All Button on P10
    - WiFi LED on P26
    - Relay (channel 2) on P6
    - Relay (channel 1) on P24
    Device seems to be using CB2S module, which is using BK7231N.
    And the Tuya section starts at UNCOMMON POSITION 0
    

    so it's CB2S module! Good to know.
    Helpful post? Buy me a coffee.
  • #5 20616609
    AgranBox
    Level 4  

    https://aliexpress.ru/item/1005002741792619.html
    [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB
    By the way, I bought here, but I came across similar models under other brands in local stores.

    Added after 41 [minutes]:

    First I installed the firmware ESPHome-Kickstart-v23.04.28_bk7231n_app.ota.ug.bin and there were problems with switching to OpenBK7231N.
    No OpenBK7231N firmware was installed via the web interface. Then I converted the firmware with the ltchiptool utility
    python -m ltchiptool uf2 write -b cb2s -o openbkt.uf2 OpenBK7231N_1.17.135.rbl=device:download

    The resulting file is openbkt.uf2 https://disk.yandex.ru/d/f0mC-pO2o4wSow
    It worked!

    Added after 9 [minutes]:

    I also prepared an autoexec.bat file so that the device reboots every day at 7 am. And also when you press the button, it turns off the ports for 3 seconds and turns on again. This is necessary to reboot connected devices, which sometimes freeze.

    autoexec.bat
    startDriver NTP
    ntp_timeZoneOfs 3:00
    
    addClockEvent 07:00 0xff 1 reboot
    
    addChangeHandler Channel0 == 0 addRepeatingEvent 3 1 setChannel 0 1
    addChangeHandler Channel1 == 0 addRepeatingEvent 3 1 setChannel 1 1
    addChangeHandler Channel2 == 0 addRepeatingEvent 3 1 setChannel 2 1
    
    setChannel 0 0 
    setChannel 1 0
    setChannel 2 0
    delay_s 3
    setChannel 0 1
    setChannel 1 1
    setChannel 2 1
    
  • ADVERTISEMENT
  • #6 20618796
    AgranBox
    Level 4  
    >>20616594
    [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB
    @pkaczmarek262 can you analyze this file for a very similar outlet, but it looks a little different?
    I ordered this model from this link: https://aliexpress.ru/item/1005002741792619.html
    BK7231N_TuyaConfig_obk5533F290.bin https://disk.yandex.ru/d/y33Z7WXCGRuwTg

    I have another socket, this time on a different chip BK7231T. It had firmware 1.0.7.
    [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB
    For the firmware I used this command:
    sudo ./tuya-cloudcutter.sh -r -p "tuya-generic-bsd31-16a-smart-plug"

    BK7231T_TuyaConfig_obk76B4542B.bin https://disk.yandex.ru/d/_m2-j_fxf9qeug

    All these devices have independent control of each USB port. But the channel settings are slightly different, different from the first socket.

    ClearIO // clear old GPIO/channels
    lfs_format // clear LFS
    StartupCommand ""  // clear STARTUP
    stopDriver *  // kill drivers
    backlog setPinRole 7 Rel; setPinChannel 7 2
    backlog setPinRole 8 WifiLED_n; setPinChannel 8 1
    backlog setPinRole 10 Btn_Tgl_All; setPinChannel 10 0
    backlog setPinRole 24 Rel; setPinChannel 24 1
    backlog setPinRole 26 Rel; setPinChannel 26 0
    setChannelLabel 0 Plug
    setChannelLabel 1 USB1
    setChannelLabel 2 USB2
    Flags 1024

    [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB
    These two smart sockets do not have LEDs showing the operation of each USB port, as in the socket from the first post.
  • #7 21006754
    divadiow
    Level 35  
    I got one too. It matches the second variant.

    Code: Text
    Log in, to see the code


    Boot output
    Code: Text
    Log in, to see the code


    JSON
    Code: JSON
    Log in, to see the code


    Tuya API return

    Code: JSON
    Log in, to see the code


    factory fw attached. UK version hardware. Firmware v1.1.15 is no good for Cloudcutter. Some piccies:
    [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB [BK7231N/BK7231T/CB2S] Tuya LSPA2 Wi-Fi Smart Plug 16A ЕС AU UK + 2.1A Dual independent USB

    and I am using this in autoexec to label switches

    Code: Text
    Log in, to see the code


    I propose two OBK templates are added to the device list.

    Code: JSON
    Log in, to see the code


    Code: JSON
    Log in, to see the code
  • ADVERTISEMENT
  • #8 21006763
    divadiow
    Level 35  
    https://github.com/OpenBekenIOT/webapp/pull/85

    Added after 3 [minutes]:

    AgranBox wrote:
    I have another socket, this time on a different chip BK7231T. It had firmware 1.0.7


    sure it's a T @AgranBox ? CB2S should be N

    AgranBox wrote:
    can you analyze this file for a very similar outlet, but it looks a little different?
    I ordered this model from this link: https://aliexpress.ru/item/1005002741792619.html
    BK7231N_TuyaConfig_obk5533F290.bin https://disk.yandex.ru/d/y33Z7WXCGRuwTg


    Code: Text
    Log in, to see the code
  • #9 21006786
    p.kaczmarek2
    Moderator Smart Home
    That's a lot of useful information. I have merged the PR, device should be soon live at:
    https://openbekeniot.github.io/webapp/devicesList.html
    Helpful post? Buy me a coffee.
  • #10 21252057
    oelkanne
    Level 1  
    Is there a solution for CloudCutter for firmware 1.1.15 in the meantime?
  • #11 21252141
    divadiow
    Level 35  
    >>21252057

    No. UART flashing is the only known option if the firmware is patched for Cloudcutter exploit.
  • #12 21252225
    p.kaczmarek2
    Moderator Smart Home
    Flashing device with CB2S module is very easy via UART:


    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the Tuya LSPA2 Wi-Fi Smart Plug, which features independent control for its dual USB ports and utilizes the BK7231N chip. Users share their experiences with firmware installation, specifically OpenBK7231N, and provide insights on device configuration and capabilities. Key commands for setting channel labels for USB ports are discussed, along with the extraction of device configuration data from Tuya. Users also mention issues encountered when switching firmware and provide solutions, including the use of UART for flashing devices with the CB2S module. The conversation highlights the importance of firmware versions and the potential for device automation through scripts.
Summary generated by the language model.
ADVERTISEMENT