logo elektroda
logo elektroda
X
logo elektroda

Generic Tuya WIFI Smart Socket for different countries (LSPA8)

merni99 5583 22
ADVERTISEMENT
  • WIFI Smart Socket
    Model: LSPA8
    Max.load 16A

    Contains a WB2S module and a BL0937 to measure power consumption.

    Available on AliExpress (e.g. https://www.aliexpress.com/wholesale?catId=0&...+FR+I&spm=a2g0o.productlist.1000002.0&dida=y)

    Generic Tuya WIFI Smart Socket for different countries (LSPA8)

    Programming the WB2S with bk_writer1.60.exe is easily possible with UART.
    Just connect 3.3V to VBAT, GND, 1RX and 1TX to a USB to UART programmer.

    RX and TX have to be crossed between programmer and WB2S (RX on programmer has to be connected to TX on WB2S).

    To program the device, the switch on pin 1RX has to be disconnected because the switch has a pullup resistor which prevents from programming via UART.

    Connect CEN (Reset of WB2S) to GND at the beginning of programming.

    After successful programming, the following configuration has to be defined:

    Generic Tuya WIFI Smart Socket for different countries (LSPA8)

    Generic Tuya WIFI Smart Socket for different countries (LSPA8)

    Photos of the opened device will follow.

    Cool? Ranking DIY
    About Author
    merni99
    Level 4  
    Offline 
    merni99 wrote 7 posts with rating 4. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20283652
    p.kaczmarek2
    Moderator Smart Home
    Thank you for providing configuration template. From what I see, the device seems to be using BL0937 power metering chip.

    Are you also able to provide some photos from the inside?
    Helpful post? Buy me a coffee.
  • #3 20284124
    merni99
    Level 4  
    Photos of the inside of the Smart WIFI Switch

    Generic Tuya WIFI Smart Socket for different countries (LSPA8) Generic Tuya WIFI Smart Socket for different countries (LSPA8) Generic Tuya WIFI Smart Socket for different countries (LSPA8) Generic Tuya WIFI Smart Socket for different countries (LSPA8)


    The next photo shows how to program the WB2S.
    3.3V, GND, RX and 1RX have to be connected to the UART programmer.
    Program a new firmware with the BkWrite tool.
    At beginning of programming, connect CEN to GND for 1 sec to reset the BK7231T.

    Important: To program the WB2S, the switch on the PCB connected to the 1RX pin of the WB2S module needs to be disconnected (because it has a pull up resistor which disturbs the programming). This can be done easily: Just "remove" the solder from the 1RX pin which connects the two PCBs so that the two PCBs are no longer connected on the 1RX pin.

    Generic Tuya WIFI Smart Socket for different countries (LSPA8)
  • #4 20284282
    p.kaczmarek2
    Moderator Smart Home
    Thanks, this will certainly be useful for beginners and new OBK users.

    As per CEN - I usually don't do CEN, just reboot with power off/on cycle. I also usually desolder whole WB2S for that and power it from 3.3V LDO.

    Regarding pull up resistor - it happens from time to time, for example, in case of that Relay, we had to remove both pull up resistor and a capacitor (used to debounce button by Tuya):
    [youtube]https://wwwa.youtube.com/watch?v=0V0kaRVnk18[/youtube]
    Helpful post? Buy me a coffee.
  • #5 20300613
    beniamino38
    Level 5  
    Thanks for this post! I am new to this, and used this info to get OpenBK on a similar but smaller plug. Mine is a generic 16A UK LSPA7, but the internals are similar -- WB2S and BL0937. It opened easily with a craft knife, and I had to desolder the AC power pins to remove the main board. The WB2S would not accept programming when attached to the main board, so I desoldered it altogether. I also found that 'uartprogram' failed, first with an error 'cannot set baud rate', and then (at a lower baud rate) a write error. I tried bk7231tools with an offset of 0x11000, which worked fine. The OpenBK configuration settings seem to work correctly for this device -- the LEDs, relay and power measurement all seem to be working. Thanks again!

    Generic Tuya WIFI Smart Socket for different countries (LSPA8) Generic Tuya WIFI Smart Socket for different countries (LSPA8) Generic Tuya WIFI Smart Socket for different countries (LSPA8) Generic Tuya WIFI Smart Socket for different countries (LSPA8) Generic Tuya WIFI Smart Socket for different countries (LSPA8)

    Edit: The chip was reported as a "BK7231S_1.0.6" but I used the BK7231T firmware.
  • #6 20300619
    p.kaczmarek2
    Moderator Smart Home
    It's good that it worked out. Tell me if you need any special features, I can add them for you.

    LSPA7 is not yet on our devices list, so thank you for photos, I will add them here:
    https://openbekeniot.github.io/webapp/devicesList.html
    If you have any other IoT devices not listed, feel free to post a separate teardown in this forum section.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20300679
    beniamino38
    Level 5  
    OK, I will -- thanks for producing this awesome software
  • #8 20422032
    itzikR
    Level 1  
    Hi.
    Thank you very much for this post.
    I have a similar plug, looks completely identical, also using CB2S.
    See attached p
    Generic Tuya WIFI Smart Socket for different countries (LSPA8)
    hoto.
    T tried flashing OpenBK using bk_writer1.6 and also the BK7231 Easy UART Flasher.
    I can download the firmware successfully, (see attached) but the device will not come up and I am not able to find it with WiFi scanner.
    Generic Tuya WIFI Smart Socket for different countries (LSPA8)


    Any ideas?
    Thank
  • ADVERTISEMENT
  • #9 21087931
    geni0815
    Level 5  
    Hello, I have this LBP8 (Link) which has the CB2S chip
    I have flashed the version 1.17.588 Chipset BK7231N and configured the same as the version with the WB2S.
    Now the relay works but the power monitor shows all values as 0.
    What do I have to change in the configuration?
  • #10 21087938
    p.kaczmarek2
    Moderator Smart Home
    Have you tried to do Tuya Config Extraction?




    Added after 1 [minutes]:

    @itzikR the WiFi will not work if you are powering device from low quality/low power power supply. Try desoldering flashing wires and run it with original circuit
    Helpful post? Buy me a coffee.
  • #12 21089426
    p.kaczmarek2
    Moderator Smart Home
    That's good to hear. Can you post your complete template (JSON format, copy text from Web App) so we can add this device to supported devices list?
    Helpful post? Buy me a coffee.
  • #14 21090883
    p.kaczmarek2
    Moderator Smart Home
    Here is corrected template:
    Code: JSON
    Log in, to see the code


    Added after 5 [minutes]:

    https://github.com/OpenBekenIOT/webapp/commit/5601eca445bcbe74ef197a8995af5d77fb9dc802
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #16 21091701
    geni0815
    Level 5  
    I have tried to modify the OBK template
    Code: JSON
    Log in, to see the code


    Now I no longer have power monitoring, and I can no longer import the data that previously worked.
    OpenBK7231N user interface with debug information

    Always the same bad only switch works!
    The modification is not displayed in the “Export Current Template”?
  • #17 21091894
    p.kaczmarek2
    Moderator Smart Home
    Excuse me, so what is the correct template? I am a bit confused now. Shall I change the one I uploaded?

    Judging from your script, the BL0937 driver may be not running. Maybe you need to reboot your device or manually start the mentioned driver.
    Helpful post? Buy me a coffee.
  • #18 21091957
    geni0815
    Level 5  
    Yes, change because the current entry is for LSPA2 and not for LSPA8 (CB2S).
    How can I start the BL0937 driver manually if reboot does not help?

    This is displayed in the “Export Current Template”
    Code: JSON
    Log in, to see the code
  • #19 21092353
    merni99
    Level 4  
    Hey geni0815

    This is my current configuration:

    
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "BK7231T",
      "board": "TODO",
      "flags": "0",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "7": "BL0937CF;0",
        "8": "BL0937CF1;0",
        "10": "Btn;1",
        "24": "BL0937SEL;1",
        "26": "Rel;1"
      },
      "command": "backlog startDriver NTP",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
    


    --> BL0937 pins are 7 and 8 (and not 6 and 7)

    Power meter functionality is working fine.

    Cheers
    Maurus
  • #20 21092897
    geni0815
    Level 5  
    Do you have the chip WB2S? I have the CB2S!
    My switch works (power meter functionality) with my specifications if I import according to the video.
    With the template import it does not work because probably the BL0937 driver does not start. So how do you start it manually?
    A reboot did not help.
  • #21 21102544
    merni99
    Level 4  
    >>21092897
    I have a WB2S. As far as I remember I didn't have to start the driver manually.
  • #22 21207739
    selekttroda
    Level 1  
    Hi,
    I have the same socket, and I replaced the board with ESP-02S module, and flashed it tasmota, but I'm struggling with configuring the pins. At the moment I can only toggle the relay via the web UI, but the device button is not working, as well as the power monitoring. I tried to map the pins from the old board (CB2S) to the new board (ESP-02S), but tasmota don't have the same names for the pins, like BL0937SEL.

    Does anyone have a working template for tasmota?
  • #23 21209145
    p.kaczmarek2
    Moderator Smart Home
    I have configured BL0937 for tasmota once in this topic:
    https://www.elektroda.pl/rtvforum/topic3941251.html#gallery-27
    Please check link above, it shows which pin roles I used for BL0937 communication. Keep in mind that used pin indexes may be different in case of your device.
    Long story short - Tasmota has HLWBL_Sel and HLWBL_Sel_i instead of BL0937SEL.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the LSPA8 model of the Generic Tuya WIFI Smart Socket, which features a WB2S module and a BL0937 power metering chip. Users share insights on programming the device using bk_writer1.60.exe and UART connections, emphasizing the need to disconnect specific pins for successful firmware updates. Several users provide internal photos and configuration templates, while others discuss issues with power monitoring and driver activation. The conversation also touches on similar models like the LSPA7 and LBP8, with users seeking and sharing Tasmota configurations for different chipsets. The importance of proper power supply and pin mapping for functionality is highlighted throughout the discussion.
Summary generated by the language model.
ADVERTISEMENT