logo elektroda
logo elektroda
X
logo elektroda

[Solved] Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)

hga00453 3924 11
ADVERTISEMENT
  • #1 20396816
    hga00453
    Level 3  
    Hello everyone.
    This is my first post on this site. I'm a newbie, please help me out.

    Now, I have the following Smart Switch at hand and am trying to rewrite the firmware for the model with [2022.10.15] written on the printed circuit board.
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)

    In past posts of this site, I found the post;
    https://www.elektroda.com/rtvforum/topic3895572.html
    may be helpful, but so far I have been unable to rewrite the firmware.

    I have gathered a lot of information and the Wi-Fi module used in this device is CB2S (BK7231N), which matches the information in the datasheet, so I hope to be able to rewrite that.
    I have tried to flash the firmware but I can not enter to the flash mode.

    So far, I have attempted the following,
    (1) Supply 5VDC to AMS1117 as external power supply
    (2) Connect RX1 and TX1 of CB2S to TX and RX of USB to UART converter by cross connection
    (3) Cut the pattern on the board for connecting RX1 to Button.
    (4) Rewrite with BK7231 GUI Flash Tool 1.0.4

    Does anyone have specific information on rewriting the firmware for this model?

    Added after 23 [minutes]:

    Add supplemental information.
    The following figure shows actual pictures of (1) external power supply and (3) pattern cutting on the board.
    Please feel free to point out any mistakes.
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
  • ADVERTISEMENT
  • Helpful post
    #2 20396890
    p.kaczmarek2
    Moderator Smart Home
    Hello, I would like to suggest you the most reliable approach.
    Just desolder CB2S.
    First add some flux to the pads and remove solder with soldering wick:
    Desoldering process on a green circuit board using a soldering iron and solder wick.
    Then solder the wires:
    Close-up of an electronic module with visible pads and pin labels.
    Then power module from 3.3V and connect to USB to TTL:
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
    Then use BK GUI flasher. If it doesn't work for you (there are some rare reports that BK GUI doesn't work with certain USB converters, but hid_download_py does), use hid_download_py method from this video:



    Make sure that OBK access point shows up.
    Then desolder wires, and clear the module pads:
    Electronic module with soldered wires and a holding clamp.
    Then prepare to solder back the module, add some flux to the pads:
    Desoldering braid over a circuit board with electronic components.
    And solder back the module:
    Soldering a component onto a printed circuit board using a soldering iron.
    Helpful post? Buy me a coffee.
  • #3 20396918
    hga00453
    Level 3  
    Hi, p.kaczmarek2
    Thank you for your reply.
    The information you provided is in the video and is very clear.

    It seems that the most common method is to disconnect the Wi-Fi sub-board from the main board (unsolder it) and rewrite it on its own.
    If this seems to be the only way, I will try it.

    Does anyone have any information on how to rewrite this model (2022.10.15) without removing the sub board?
  • ADVERTISEMENT
  • Helpful post
    #4 20396936
    p.kaczmarek2
    Moderator Smart Home
    hga00453 wrote:

    Does anyone have any information on how to rewrite this model (2022.10.15) without removing the sub board?

    1. Locate AMS1117 3.3V LDO regulator on the board
    2. connect 5V to AMS1117 input, connect common ground
    3. connect RX and Tx, also make sure that RX and TX is not used for something else on the board (if so, cut the trace)
    4. Start flashing in the programmer tool. Try BK GUI flasher, if it fails, you can also try hid_download_py
    5. The tool will wait for device reboot (for "getting bus"), then:
    OPTION A: disconnected 5V power supply and reconnect it quickly (so module reboots)
    OPTION B: use extra CEN wire and short it for 0.25 seconds to ground (so module reboots)
    6. flashing should proceed

    hid_download_py commands for firmware backup (2MB, please do it first!) and writing are on the video linked above.

    This method should work as long as you have no interference on RX/TX lines.
    You can also read this topic (I also cut the trace here):
    ZN268131 WiFi Smart Switch that allows you to connect a bistable button
    You can also watch this CB2S flashing video (I had to cut the trace there):



    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
    Helpful post? Buy me a coffee.
  • #5 20397307
    hga00453
    Level 3  
    Hi, @p.kaczmarek2
    Thank you for your additional information provided.
    I have tried them in the past, but failed to flash the firmware.

    It seems that the RX and TX pins are connected to the relay module, as the relay ticks when I run the flashing application.
    It seems like there is a missing pattern cut on the board, so I guess I should still follow your advice and separate the CB2S sub-board of the Wi-Fi module before flashing.
  • Helpful post
    #6 20397465
    p.kaczmarek2
    Moderator Smart Home
    There are many things that can go wrong with flashing BK7231. It is not guaranteed that desoldering WiFi module will help, but at least it will tell you that your problem is not the RX/TX tracks interference.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20397597
    hga00453
    Level 3  
    Hi, @p. kaczmarek2
    Your advice has been very helpful.
    The direction you recommended is still generic for the future, so I will try that approach.
    Thanks.
  • ADVERTISEMENT
  • #8 20398512
    hga00453
    Level 3  
    As suggested, I responded by separating the CB2S sub-board from the main board.
  • #10 20405966
    hga00453
    Level 3  
    p.kaczmarek2 wrote:
    Is the flashing working now? @hga00453

    YES! I did it.
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
    Rewriting Firmware for Wi-Fi DIY Smart Switch (2022.10.15 model) using CB2S (BK7231N)
  • #11 20405974
    hga00453
    Level 3  
    Just remove the WiFi (CB2S) module from the main board.
  • #12 20405987
    p.kaczmarek2
    Moderator Smart Home
    Very good job, it's' the most reliable way.
    Helpful post? Buy me a coffee.

Topic summary

A user seeks assistance in rewriting the firmware for a Wi-Fi DIY Smart Switch (model 2022.10.15) utilizing the CB2S (BK7231N) module. Initial attempts to flash the firmware were unsuccessful, primarily due to difficulties entering flash mode and potential interference from RX/TX connections to the relay module. Community members suggest desoldering the CB2S module from the main board to eliminate interference issues. Detailed steps are provided, including connecting power to the AMS1117 regulator, using BK GUI flasher or hid_download_py for flashing, and ensuring proper connections. After following the advice and separating the CB2S module, the user successfully flashed the firmware.
Summary generated by the language model.
ADVERTISEMENT