logo elektroda
logo elektroda
X
logo elektroda

[BK7231N][CBU + RF 433] AVATTO WSMD-4 Configuration of RESET button and RF chip on OpenBK

tomik67 543 10
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21191882
    tomik67
    Level 12  
    I purchased an AVATTO WSMD-4 four-channel switcher onto which I successfully uploaded OpenBK.

    [BK7231N][CBU + RF 433] AVATTO WSMD-4 Configuration of RESET button and RF chip on OpenBK .

    [BK7231N][CBU + RF 433] AVATTO WSMD-4 Configuration of RESET button and RF chip on OpenBK .

    On board is a 433MHz chip with the mysterious designation 0056

    [BK7231N][CBU + RF 433] AVATTO WSMD-4 Configuration of RESET button and RF chip on OpenBK .

    The device itself is similar to the one described here...:
    https://www.elektroda.pl/rtvforum/topic3989878.html

    Unfortunately the config was not extracted during the backup.
    I traced the paths visually and with a multimeter, I attach the config...:

     {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "AVATTO Smart DIY Switch Module",
      "model": "WSMD-4",
      "chip": "BK7231N",
      "board": "CBU",
      "flags": "-2147482620",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "6": "WifiLED_n;0",
        "7": "Btn_Tgl_All;0",
        "8": "Btn;1",
        "9": "Rel;3",
        "14": "Btn;4",
        "16": "Btn;3",
        "17": "Rel;4",
        "20": "Btn;2",
        "26": "Rel;1",
        "28": "Rel;2"
      },
      "command": "PowerSave",
      "image": "https://obrazki.elektroda.pl/3468700400_1723720949.jpg", "https://obrazki.elektroda.pl/9045306800_1723720972.jpg"
      "wiki": "https://www.elektroda.pl/rtvforum/topic4070656.html"
    }
    
    .

    The relays and buttons work fine but I have two questions.

    1. the device has an additional RESET button which is connected to pin 7 and connects the ground, how can I make a short press do the restart of the CBU module and a long press (5s) do the conversion to AP mode?

    2. the RF chip 0056 is connected by output 8 (in the picture above number 6) to pin P24 of the CBU, I understand that the RF support is not implemented yet and I will not do anything about it for now ?.
  • ADVERTISEMENT
  • #2 21192102
    gulson
    System Administrator
    I have moved the post from .com to .pl
  • ADVERTISEMENT
  • #3 21192442
    p.kaczmarek2
    Moderator Smart Home
    Re 1: Button events, set the role of the button as Btn_ScriptOnly. Use the events OnHold and maybe OnClick
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    https://www.elektroda.com/rtvforum/topic3941692.html
    Re 2 This is TODO, so to be done only.

    Do you have, after all, the 2MB of copy?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21192474
    p.kaczmarek2
    Moderator Smart Home
    Ok a can you complete the template with links to photos, topic, forum, etc?
    I don't see anything about WSMD-4 https://www.elektroda.pl/rtvforum/find.php?q=WSMD-4 and not here either:
    https://openbekeniot.github.io/webapp/devicesList.html
    so you could add a separate entry for it
    Helpful post? Buy me a coffee.
  • #6 21193558
    tomik67
    Level 12  
    p.kaczmarek2 wrote:
    Ad 1: Button events, set the button role as Btn_ScriptOnly. Use OnHold and maybe OnClick events
    .

    Thanks for pointing me in the direction of the search, I now have the Reset (Pin 7) button set to Btn_ScriptOnly , and in the /autoexec.bat file:

    // short pressing the button restart module
    addEventHandler OnClick 7 restart
    // long pressing the button opens Access Point
    addEventHandler OnHold 7 OpenAP
    .

    ....i works as I wanted
    I've tweaked the template but I've never added devices to the DeviceList and wouldn't want to mess something up.
  • ADVERTISEMENT
  • #7 21193982
    p.kaczmarek2
    Moderator Smart Home
    I can add, just post the full JSON here and complete the device name, tags and links to the subject and image.
    Helpful post? Buy me a coffee.
  • #8 21194318
    tomik67
    Level 12  
    I have corrected the first post with the json file, is that enough ?
  • #9 21311193
    Pete0815
    Level 7  
    Hi
    sorry not able to speak Polish and will include auto translated text afterwards.

    Also have this type of board with Tuya CBU Chip. May I ask if you desoldered the chip for flashing or just used the soldering pads at the pcb?

    Is there a solution for the 433MHz communication? Therefore I´m thinking about replacing CBU with ESP8685-WROOM-06-H4 but just with a short look there will be no simple replacement possible because ESP will need EN pulled high for operation and I´m not sure if special requirements for GPIO8&9 will need some more modifications.


    Hi
    Sorry, I do not speak Polish. I will attach the automatically translated text later.

    I also own this type of board with Tuya CBU chip. May I ask if you soldered the chip for flashing or just the solder fields on the PCB?

    Is there a solution for 433 MHz communication? So I'm considering replacing the CBU with ESP8685-WROOM-06-H4, but after a quick look this won't be possible in a simple swap as the ESP will require a high EN pull-up to operate and I'm not sure if the special requirements for GPIO8 and 9 will be met needs some more modifications.
  • #10 21318293
    tomik67
    Level 12  
    Pete0815 wrote:
    did you solder the flashing chip, or just the solder fields on the circuit board?
    .
    I didn't desolder the chip, in the picture in the first post you can see the thickened tin on two pins and two solder fields.
    As far as I know there is no 433 support yet
  • #11 21318570
    Pete0815
    Level 7  
    @tomik67
    Thank you very much. This worked fine with OpenBeken. But now I have the board working on ESPHome because 433 MHz also worked immediately.

Topic summary

The discussion centers on configuring the AVATTO WSMD-4 four-channel switcher running OpenBK firmware with a BK7231N chip on a Tuya CBU board, which includes a 433 MHz RF chip labeled "0056." The original configuration was not extracted during backup, prompting manual tracing and JSON template creation for device integration. The RESET button (Pin 7) was successfully configured as Btn_ScriptOnly with event handlers in the autoexec.bat file to restart the module on short press and open Access Point on long press. The device is not yet listed in the official OpenBK device list, and contributors encouraged adding a dedicated entry with complete JSON and links. A user inquired about flashing methods, confirming no desoldering was needed, only soldering on PCB pads. Currently, there is no support for 433 MHz communication in OpenBK, leading some to consider alternative firmware like ESPHome, which reportedly supports 433 MHz on similar hardware. Replacement of the CBU chip with ESP8685-WROOM-06-H4 was discussed but deemed complex due to hardware requirements such as EN pin handling and GPIO constraints.
Summary generated by the language model.
ADVERTISEMENT