Elektroda.com
Elektroda.com
X

Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942

p.kaczmarek2 27654 169
This content has been translated flag-pl » flag-en View the original version here.
  • #151
    Dark Man
    Level 13  
    Have you noticed that in the screenshot from extracting the configuration from the batch, the "BL0937 SEL" pin is not pulled out on the left?
    I doubt he was needed :)

    Yesterday I downloaded the latest Flasher release but these options were not there yet.
  • #152
    p.kaczmarek2
    Moderator Smart Home
    Good point! I haven't seen it myself. It's hard to test everything thoroughly as a larger project develops, which is why your feedback/testing is very valuable.

    @piratee @Dark Man soon I'm uploading a flasher with an IP scanner capable of making a mass backup of device configuration on the network. i.e. automatically takes a snapshot to the folder of all CFG obk sectors on the span. Will you be able to test? How many devices do you have?
    It's just that it will require an OBK update (to what is now on Github)
  • #153
    Dark Man
    Level 13  
    I currently have about 7 devices connected to the network on the Beken chip. Apart from them, a few unused light bulbs and 2 unprogrammed LSPA9 sockets (unfortunately, there is no possibility to use Cloudcutter, because the lack of an appropriate profile means that I don't have time to deal with them now - unless you could make a Cloudcutter profile from the uploaded dunks 😁 ).
    P.S
    I have 37 devices on ESP with Tasmota in Tasmota integration, and 35 devices on MQTT integration :)

    Let me know when Flasher and the appropriate firmware will be ready so that I can start the process of updating for testing.

    Have you thought about trying to stabilize the results from the BL0937 chip?
  • #154
    p.kaczmarek2
    Moderator Smart Home
    Programmatic filtering of results is waiting in the queue, I have to think about how to do it at all, there are probably ready-made ways for it. This is a bit less of a priority as I have quite a few BL0937 users including contributor Valek (author of the LWIP update, MQTT throughput and OBK power stats improvements) and no one has reported it significantly distorting the measurements.

    So far, yesterday with an assistant we did a tutorial of extracting GPIO from any device via Web App, thanks to which you don't have to manually guess which pin the Relay is on, etc. It will be uploaded to YT in a few days.

    We also started working on infographics, the assistant made a template.

    Flasher also detects Tasmota devices and also allows you to more or less control them (just for testing and fun), but I have trouble with making a backup of the Tasmota template because something doesn't want to return the correct template.
    @Dark Man, since you have so many devices with Tasmota, tell me, what about you returns such a request from the browser to Tasmota?
    
    http://192.168.0.159/cm?cmnd=Template
    

    Change your IP of course...
    For me, Tasmots keep returning:
    
    {"NAME":"Generic","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18}
    

    which is quite unexpected for me, I was hoping that they would return their actual template to me, but I probably don't know about something.

    Ultimately, I would like my mini tool in Flasher to be able to backup both OBK and Tasmot from our LAN.

    Added after 58 [seconds]:

    Oh, give me these 2MB batches and I'll arrange a profile for remote flashing, just please sign it specifically (I don't know, in zip?) and attach photos so that we know what these batches are for.
  • #155
    Dark Man
    Level 13  
    p.kaczmarek2 wrote:
    @Dark Man, since you have so many devices with Tasmota, tell me, what about you returns such a request from the browser to Tasmota?
    Code: text Expand Select all Copy to clipboard
    http://192.168.0.159/cm?cmnd=Template

    Tasmot 12.4
    {"NAME":"Sonoff T1","GPIO":[32,1,1,0,0,0,0,0,225,256,0,0,0,0],"FLAG":0,"BASE": 28}
    Tasmot 10.1
    {"NAME":"LSC E14 RGBCW","GPIO":[0,0,0,0,32,0,0,0,4064,0,4032,0,0,0],"FLAG":0 "BASE":18}
    Tasmot 10.1
    {"NAME":"Minitiger1Gang","GPIO":[32,0,0,1312,0,0,0,0,224,544,0,0,0,0],"FLAG":0,"BASE":18 }
    Tasmot 11.1
    {"NAME":"GB155 no meter","GPIO":[0,1312,0,0,576,224,0,0,0,32,0,0,0,5729,0],"FLAG":0,"BASE" :18}

    I have authorization on all devices from Tasmot (it would also be useful in OpenBeken) and calling the link without logging in first, spits out this:
    {"WARNING":"Need user=&password="}

    It has never happened to me that any of the tested ones returned what you showed (Generic 1 1 1 1 ...)
    p.kaczmarek2 wrote:
    Added after 58 [seconds]:
    Oh, give me these 2MB batches and I'll arrange a profile for remote flashing, just please sign it specifically (I don't know, in zip?) and attach photos so that we know what these batches are for.

    I have already attached the batches earlier as I wrote that Flasher is not able to extract PINs from one batch.
    Both inputs are made of clones of LSPA9 sockets without any prints, so you can't even tell them apart. There was no model on the package.
    The photo will be up shortly.

    Added after 3 [minutes]:

    Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942 Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942 Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942 Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942 Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942 Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942

    Such a curiosity that the Chinese sell these sockets also supposedly with a 20A relay, and in fact there is a 16A relay, except that they burned the print on the relay housing itself so that its power could not be seen 😂
  • #156
    p.kaczmarek2
    Moderator Smart Home
    Dark Man wrote:

    
    http://192.168.0.159/cm?cmnd=Template
    Tasmota 12.4
    {"NAME":"Sonoff T1","GPIO":[32,1,1,0,0,0,0,0,225,256,0,0,0,0],"FLAG":0,"BASE":28}
    Tasmota 10.1
    {"NAME":"LSC E14 RGBCW","GPIO":[0,0,0,0,32,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18}
    Tasmota 10.1
    {"NAME":"Minitiger1Gang","GPIO":[32,0,0,1312,0,0,0,0,224,544,0,0,0,0],"FLAG":0,"BASE":18}
    Tasmota 11.1
    {"NAME":"GB155 no meter","GPIO":[0,1312,0,0,576,224,0,0,0,32,0,0,5729,0],"FLAG":0,"BASE":18}
    


    Very helpful, thanks, so I know that I have to look for a reason at home, maybe I'm setting the configuration differently.

    Dark Man wrote:

    I have authorization on all devices from Tasmot (it would also be useful in OpenBeken) and calling the link without logging in first, spits out this:
    {"WARNING":"Need user=&password="}

    Very good point, I didn't remember about it, I'll add it to the scanner and also think about the OBK.



    Dark Man wrote:

    earlier, as I wrote that Flasher is not able to extract PINs from one batch.

    I don't understand one thing here - we just found out that he pulls PINS from both batches, only in one he loses the SELECT pin from BL0937, and that's something else. It's with losing SELECT that I know why it is, it will be fixed soon. That's what you mean? Does yours seriously not read one of the dunks at all?


    Dark Man wrote:

    Both inputs are made of clones of LSPA9 sockets without any prints, so you can't even tell them apart. There was no model on the package.

    Someone, possibly from you, provided a link to Aliexpress for LSPA9 for $3 and when I ordered it, I got it from ESP. I will probably also post something about it on YT electrodes soon, but we'll see.
  • #157
    Dark Man
    Level 13  
    p.kaczmarek2 wrote:
    Dark Man wrote:
    earlier, as I wrote that Flasher is not able to extract PINs from one batch.

    I don't understand one thing here - we just found out that he pulls PINS from both batches, only in one he loses the SELECT pin from BL0937, and that's something else. It's with losing SELECT that I know why it is, it will be fixed soon. That's what you mean? Does yours seriously not read one of the dunks at all?

    In post #149
    https://www.elektroda.pl/rtvforum/viewtopic.php?p=20581708#20581708
    I loaded dunks from two noname sockets - LSPA9 clones.
    I wrote earlier that it would be nice to make profiles for Cloudcutter from these batches.
    It was me who gave these links to Aliexpress Choice, because then I also bought this socket from CB2S.
    Then I also found the same cheap sockets again in Aliexpress Choice and ordered 1pc. (the same as the previous ones, although I had to desolder the flashing system) and 2 more pcs. (I haven't opened these yet)
  • #158
    p.kaczmarek2
    Moderator Smart Home
    Dark Man wrote:
    I loaded dunks from two noname sockets - LSPA9 clones.

    Ok that's all clear, I just pointed out that basically pulling out the pins works on them, only in the case of one it loses the SEL and I will correct it.

    Cloudcutter profiles will be, I'll let you know.

    Hmm, so we ordered LSPA9 from the same auction and you got CB2S and I got the ESP8285 version.

    The devices page has been updated:
    https://openbekeniot.github.io/webapp/devicesList.html
    We added a list of Cloudcutter profiles:
    Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942
    After selecting the list mode, press "Apply filtering" to refresh the page.
  • #159
    p.kaczmarek2
    Moderator Smart Home
    @dark Man, I have bad news . Both of your 2MB screenshots of newer LSPA9 are already patched, they are versions 1.1.12 and 1.1.15 respectively. It is not possible to flash them over WiFi.

    For the sake of clarity, here is a list of patched versions of Tuya that are not susceptible to firmware over the network:
    BK7231T - none
    BK7231N:
    - 1.1.2 oem_bk7231n_garage_door (Tuya Generic QS-WIFI-C03 Gate Opener Switch)
    - 1.1.12 oem_bk7231n_plug (Nous A1, Tuya Generic LSPA9 Smart Plugs)
    - 1.1.15 oem_bk7231n_plug (various smart plugs)
    - 1.3.3 oem_bk7231n_dctrl_switch (HomeMate 4 Node Smart Switch)
    - 1.3.8 oem_bk7231n_control_switch (ColoRock CR-MINI-V2 Mini Smart Relay)
    - 1.3.10 oem_bk7231n_control_switch (OXT_SWT10 240V 150W 5A Dry Contact Relay)
    - 1.5.10 oem_bk7231n_light_ty (Tuya Generic Light, TuyaOS 3.3.2)
    - 2.0.15 oem_bk7231n_strip_ty (Anko Sunset Light)
    Nothing can be done about it. You have to open the case and solder.
  • #160
    piratee
    Level 12  
    Hello
    What does such an entry read from the configuration (mini Smart Switch) mean?

    Device configuration, as extracted from Tuya:
    - Pair/Toggle All Pin on P11
  • #161
    p.kaczmarek2
    Moderator Smart Home
    Looks like I used the wrong word. This is what happens when you write a project as fast as possible... of course it's about:
    
    - Pair/Toggle All Button on P11
    

    I've added a fix to the code and will release it later.

    For clarity - this is the pairing button, the small one from the housing, it also serves as a toggle all (switch of all channels).
  • #163
    p.kaczmarek2
    Moderator Smart Home
    Btn or even better Btn_Tgl_All. Why are you asking how we define it? After all, after the copy paste of this JSON from the first field to the Web App in OpenBEken, the Import tab, everything will set itself.

    Or you can paste here:
    https://openbekeniot.github.io/webapp/templateImporter.html
    It will also work in most situations and will create a template by itself. You probably don't need to manually translate this into pin role names.
  • #164
    xenonscrinium
    Level 3  
    I have problem with tuya smart socket 16. When power consumption goes above ~1.5KW the socket turns off/on randomly, I don't hear relay click sound.
    Any body has problem with smart sockets at max power consumption?

    openbk version 1.17.54
    Code: json
    Log in, to see the code



  • #165
    p.kaczmarek2
    Moderator Smart Home
    That's quite a lot of power, are you sure that this device is rated for such a high power?
    Anyway, try using PowerSave 1 in OBK short startup command (reboot after adding it), this will run OBK in low-power mode and may help if the relay click is caused by a power supply issue. Maybe with such a high power consumption voltage drop is so high that BK doesn't get enough power.
  • #166
    xenonscrinium
    Level 3  
    p.kaczmarek2 wrote:
    That's quite a lot of power, are you sure that this device is rated for such a high power?
    Anyway, try using PowerSave 1 in OBK short startup command (reboot after adding it), this will run OBK in low-power mode and may help if the relay click is caused by a power supply issue. Maybe with such a high power consumption voltage drop is so high that BK doesn't get enough power.


    It is noted in specs for this device:
    Max. power
    2200W for 220V ,1100W for 110V
    I'm running it on 220v
  • #167
    p.kaczmarek2
    Moderator Smart Home
    Well, try PowerSave method and let us know if it helped.

    Also, does OBK reboot when relay clicks?
  • #168
    xenonscrinium
    Level 3  
    p.kaczmarek2 wrote:

    Well, try PowerSave method and let us know if it helped.
    Also, does OBK reboot when relay clicks?


    is this command should be put it here?

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

    If so, this didn't help


    There are no relay clicks and no reboots,
    I hear strange noises from the socket when this happening


  • #169
    p.kaczmarek2
    Moderator Smart Home
    You should put it here, save, and reboot:
    Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942

    Added after 6 [minutes]:

    BUT if there are no relay clicks... and you still lose the power.... then it sounds very bad, like a hardware issue, something must be disconnecting, I would really, really suggest you to lower the load or buy better quality relay... maybe 3300W one...
  • #170
    xenonscrinium
    Level 3  
    p.kaczmarek2 wrote:
    You should put it here, save, and reboot:
    Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942

    I put PowerSave 1 in startup command and rebooted, still nothing. It works ~1min, then turns off.
    It seems current overload protection, so there is nothing can be done I think
    Anyway thanks.