logo elektroda
logo elektroda
X
logo elektroda

How do I take apart the Blow smart socket from the CB2S to change its firmware?

MK-dugi 2301 11
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20862921
    MK-dugi
    Level 10  

    Hi,
    I recently test-purchased a SMART socket of the Polish brand BLOW.
    This is a Smart Life/Tuya socket. Experimenting with it with Home Assistant - localtuya I came to the conclusion that it is a CB2S platform.
    I tried to take this socket apart without destroying it, but unfortunately I did not succeed.
    I would love to convert it to a completely local :-) .
    Back view of a BLOW smart socket showing visible scratches. White smart socket from the BLOW brand on a wooden surface, with visible minor damage on the casing.
    The damage seen in the left image is the result of my attempts to take the object apart. But I did not find any attachments/mounts in these areas near the edges. I was not able to bend the contact at the corners. The plastics are hard, and I don't want to (yet) break this case.
    Maybe someone has already done this, or met with a similar case?
    Greetings!
  • ADVERTISEMENT
  • #2 20862942
    p.kaczmarek2
    Moderator Smart Home
    Hello, unfortunately I don't recall this particular housing, although I've disassembled many such products....
    Even from Blow not long ago, at the request of someone, I uploaded an OBK to the sockets, but there were some:
    Damaged electrical socket with exposed PCB and wires. Back view of a Blow smart socket with visible technical markings. Dismantled Blow electric socket on a wooden surface. Disassembled electrical plug with visible interior and circuit board. Disassembled Blow brand socket with visible interior. I see, that you have a slightly different model, but in the case of my Blow it was not even possible to remove the PCB and I had to simply drill a hole at the bottom of the socket and solder the wires to the CB2S feet. Then I still had to secure it after flashing.

    Added after 1 [minutes]:

    Maybe there is a hidden screw like in Blitzwolf sockets? I'm just guessing, I could be wrong:
    Close-up of an electrical socket with a metal bracket and CE symbol. But Blow has rather not very detachable sockets
    Helpful post? Buy me a coffee.
  • #3 20863022
    MK-dugi
    Level 10  

    It worked! Without destroying the case!
    Photo of a white plastic device casing disassembled into parts. Electronic circuit board with visible cables and RX, TX labels. As I thought, the fixings are in the corners. You can see them in the pictures. It wasn't easy.
    I soldered in RX, TX and GND and now have to read the backup and flashing procedure.
    I am 100% sitting under Linux. There are tools for Penguin

    In the pinhole the screw is not there. I have checked before :-) .
  • ADVERTISEMENT
  • Helpful post
    #4 20863039
    p.kaczmarek2
    Moderator Smart Home
    This method will work on Linux:



    If you can, post the 2MB batch, I'll pull the GPIO configuration from it myself.

    What is the manufacturer's code for this device, can you post a screenshot of the listing where you bought?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 20864861
    MK-dugi
    Level 10  

    I soldered the CB2S module from the "motherboard" and soldered the wires to it.
    I found it easier than knocking out capacitors, cutting paths, etc...
    I added a reset resistor to the CEN.
    I connected it to my USB-UART (PL2303). It came out neatly :-) .CB2S module with attached wires and a resistor on an EliteBook laptop. CB2S module with soldered wires connected to a terminal. Wires soldered to a USB-UART PL2303 module wrapped in electrical tape.
    To make it easier for myself I ran bk_writer1.6 under Win and fiddled with the flash reading.
    The file came out small - 1.1 MB.
    As I fiddled with the address ranges, it came out 2 MB, but each different.... (different checksum). When I fiddled even more with the addresses, I was able to download up to 3 MB. I did not try more.
    Another approach - hid_download_py.
    This program (already under Linux) downloaded me .... 1.1 MB and the checksum agrees with this small file downloaded by bk_writer1.6.

    I am posting the small file. Please let me know if such is enough to extract the GPIO configuration or maybe something more...

    Greetings! BLOW-plug_..074.bin Download (1.1 MB)
    .
  • ADVERTISEMENT
  • #7 20864944
    p.kaczmarek2
    Moderator Smart Home
    Unfortunately you need a 2MB file, as written in the linked tutorial:
    Screenshot showing instructions for flashing OpenBeken on a Tuya Relay CB2S/BK7231N device with several console commands.
    In older tools you have to manually type in 2MB, regardless of the checksum.

    There is also a newer tool, but it officially only works on Windows, although people have reportedly run it with mono:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Helpful post? Buy me a coffee.
  • #8 20865047
    MK-dugi
    Level 10  

    @p.kaczmarek2, thank you for leading by the hand! :-)
    The given command ends with a CRC check failed error, but gives stable results - the file is the same every time.
    I'll post it!
  • #9 20865102
    p.kaczmarek2
    Moderator Smart Home
    This file looks correct:
    Interface of BK7231 Easy UART Flasher with Tuya JSON configuration
    Tuya JSON:
    Code: JSON
    Log in, to see the code

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


    Tuya JSON can be imported after flashing like this:


    Tuya JSON.
    Helpful post? Buy me a coffee.
  • #10 20865616
    MK-dugi
    Level 10  

    @p.kaczmarek2 Revelation! The socket works!
    I uploaded version 1.17.360 via uartprogram, configured via WWW from a JSON file from you.
    I checked if it works before I soldered the CB2S module into the "main board" - WiFi connection, MQTT reporting and if there is voltage on pin 26 after switching on the socket via WWW. It worked!

    Then I cleaned all the pads, soldered the CB2S in place, plugged it in and ... everything is fine.
    I even report parameters of voltage, current, power, current consumption although not perfectly.
    I did a voltage calibration with the web application, but the readings of the socket and multimeter still diverge. It looks like there is some offset from below.
    I configured the local NTP.

    I played with the General/Flags settings.
    I turned on Flags 2, 19, 27, 30.

    I hoped that some discovery mechanism in HA would work, but I failed :-( .

    Update.
    I entered the command: scheduleHADiscovery 10 (then scheduleHADiscovery 3600 - every 10sec pointless).
    I got the MQTT database -> homeassistant -> switch and sensor. (I'm viewing it via an external GUI).
    I found the device in Devices -> MQTT.
    HA it doesn't report the new device itself, but I can add it.
    I imagined it would go like from Tasmot to SONOFF, but it's still great! :-)

    Also 95% success! The other 5% is calibration of the voltage/voltage/power module!
  • #11 20865727
    p.kaczmarek2
    Moderator Smart Home
    Congratulations, it went fairly smoothly.
    So are you suggesting that HA Discovery should turn itself on, without typing in a command?
    So far we have a mechanism as here:





    You do the calibration as in Tasmot, but on the Web App you also have command wrappers for this.
    Helpful post? Buy me a coffee.
  • #12 20867106
    MK-dugi
    Level 10  

    Of course I did not see this video, and how. Thank you for your patience
    I also missed the "Start Home Assistant Discovery" button
    I would have found it easier with these items.

    What about Tasmot's autodiscovery, it's I guess like this:
    1. The device sends discovery to MQTT, but the tree is tasmot/discovery/MACADDRESS
    There are "config" and "sensors" entries. Example (my) entries below.
    2. There is a Tasmota add-on running on the HA
    https://www.home-assistant.io/integrations/tasmota
    and this add-on seems to check the corresponding MQTT tree for new devices.
    3. The HA in Notifications informs about a new detected device that can be added.

    I stress, the words "probably" in the procedure. When I check on another device I'm going to add, I'll make sure it actually works that way.

    Below are the entries in MQTT->tasmota/discovery/MACADDRESS of my SONOFF MiniR2 device on which I uploaded Tasmota. This is not related to BK7231.
    config={"ip": "10.122.1.80","dn":"MINIR2-1","fn":["MINIR2-1",null,null,null,null,null,null,null],"hn":"minir2-1-90DF8E-8078","mac":"80646F90DF8E","md":"Sonoff Basic","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"13.3.0","t":"minir2-1_90DF8E","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], "btn":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

Topic summary

The discussion revolves around disassembling the Blow smart socket (model CB2S) to change its firmware for local control. The original poster faced challenges in opening the device without causing damage but eventually discovered hidden fixings in the corners. After successfully accessing the internal components, they soldered connections for RX, TX, and GND to flash the firmware. Various methods and tools for reading and writing firmware were discussed, including using Linux and specific software like bk_writer and hid_download_py. The user successfully uploaded a new firmware version, enabling features like WiFi connection and MQTT reporting, although some calibration issues remained. The conversation also touched on Home Assistant integration and the discovery mechanism for smart devices.
Summary generated by the language model.
ADVERTISEMENT