logo elektroda
logo elektroda
X
logo elektroda

How to Flash OpenBK7231N on Moes MS-104B 2 Gang Smart Switch (Tuya CBU Board)

jmnvarandas 345 5
ADVERTISEMENT
  • Helpful post
    #1 21824581
    jmnvarandas
    Level 2  
    Module name: Moes Matter 2 Gang Smart Switch Module MS-104B
    Vendor: Moes
    Protocol: WiFi 2,4GHz
    Input Voltage: 90 - 250V AC 50/60Hz
    Max Current: Total 10A
    Chip: BK7231N
    Board: Tuya CBU
    Bought in: AliExpress

    Related topics:
    [BK7231N CB2S] Moes Smart Switch 1 gang WiFi - MS-104
    Wiring MOES MS-104B s WB2S to TTL FT232RL for OpenBK7231T Flashing

    Pictures of the module:

    












    Preparation to flash:
    1. Open the module
    Close-up of Moes MS-104B module interior with labeled components and relays










    2. Release the 2 relays to access the Tuya CBU



    Moes MS-104B module with visible PCB and detached FANHAR relays



    Important! If you prefer to remove the Tuya CBU and flash it outside the module, then jump to the step 5.

    3. Cut both 3V3 and GND vias near the Tuya CBU 

    You need to do it to break the pull-ups and pull-downs preventing to flash the Tuya CBU.
    Note: you will need to re-join them again, so do a very small cut.
     Before  Close-up of 3V3 and GND traces on Tuya CBU module with marked cut area   After  Close-up of Tuya CBU module with labeled pins and signal pathways visible

    4. Remove following components:
      - Micro controller U4 - signal conditioning, not required anymore will be replaced by 2 shunts, mandatory
      - Resistor R20 - 10k pulling up the RX1 and the button S1, mandatory
      - Diode D8 - debounce and voltage limiter for S1 and RX1, mandatory
      - Button S1 - Pulled up and connected to RX1, optional
      - Capacitor C7 - power filter to U4, not required, optional

        Front side    Close-up of PCB with highlighted areas where components were removed.                  Back side    Close-up of PCB with highlighted area showing 3V3 and GND vias cut

    5. Connect the wires:
    Code: Text
    Log in, to see the code




             Close-up of Tuya CBU board with wires connected to TX1 and RX1 pins

    6. Flash it with BK7231 Flasher
    BK7231 Easy UART Flasher interface with Write success! message and sector write log

    7. Restore:
     - 3v3 via
     - GND via
     - Relays

    8. Do 2 shunts for the S1 and S2 external inputs
    Close-up of PCB with two soldered wires highlighted in a red rectangle

    9. Connect the module to mains
    WARNING! NEVER connect the module to mains (e.g. 230VAC) and to the computer trough FTDI adapter at same time!

    10. Configuration:
    - Find the Wi-Fi host and connect to it
    Wi-Fi network named OpenBK7231N_8C000000 visible on screen

    - Into web browser open the 192.168.4.1 page
    Orange star icon next to IP address 192.168.4.1 on a dark background

    - Configure the Wi-Fi with your network router SSID and Password
    Blue button with white “Config” text in the center  Scan Local Networks button on a blue background 

    - Configure the MQTT - optional

    - Pin setting:

    Screenshot of Moes MS-104B pin configuration after firmware flashing

    - Channel Types:

    Dropdown list showing three entries set to Toggle

    - Template:
    Code: JSON
    Log in, to see the code

    AI: Could you clarify if you are facing any specific issues or errors during the flashing process, or are you looking for confirmation that your steps are correct?
    I confirm that the described steps work.
    AI: If you have already attempted the flashing, what was the result—did the device flash successfully, or did you encounter any problems (e.g., error messages, device not responding)?
    Flash successfully.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 21824778
    jmnvarandas
    Level 2  
    >>21824725
    Thank you very much for the appreciation!
    Yes, I attempted OTA on three different devices, from v1.18.250 to 1.18.251 and from v1.18.233 to 1.18.251, but was unsuccessful.
    Is there some known issue related?
    Also, thanks for the PR.
  • ADVERTISEMENT
  • Helpful post
    #4 21824784
    divadiow
    Level 38  
    Not an issue necessarily, just re-flash with overwrite bootloader selected

    BK7231 Easy UART Flasher window with “Write success!” message

    and while cabled for flashing (not mains power, obvs), the TLV partition probably needs restoring from backup file too https://www.elektroda.com/rtvforum/topic4106397.html#21764525

    assuming these Moes Matter devices are somewhat similar or the same as my Moes bulb https://www.elektroda.com/rtvforum/topic4074263.html
  • ADVERTISEMENT
  • #5 21825354
    p.kaczmarek2
    Moderator Smart Home
    Wait, why OTA is not working? It doesn't look like this device has a custom bootloader...
    Helpful post? Buy me a coffee.
  • #6 21825412
    divadiow
    Level 38  
    yeh, I think there's something with the BK7231N_2.0 (Matter-focussed BL?) bootloader that made OTA not work, or at least not see OBK rbl as a valid file to apply. I'm kinda going from memory/whatever's in that bulb Matter post.
ADVERTISEMENT