logo elektroda
logo elektroda
X
logo elektroda

OpenBeken WB2S (BK7231T) Flashing CRC Error and Rocker Switch Configuration for Relay

erdemefe1 378 10
ADVERTISEMENT
  • #1 21719099
    erdemefe1
    Level 3  
    I have two questions about OpenBeken.

    I have many Moes 1-gang WiFi + RF switches based on WB2S (BK7231T). I tried to flash three of them with BK7231GUIFlashTool using the firmware OpenBK7231T_UA_1.18.188.bin. The backup and erase processes completed successfully, but I got a BAD CRC error at the end of flashing. After that, the devices would not boot successfully, and strangely, the modules consumed only around 1 mA of current after the failed flash. Finally, I used BK Writer 1.6 on a fourth module with the same firmware, and it worked.

    When I assign pin 26 as button channel 1 and pin 6 as relay channel 1 on the module, pressing the button changes the relay state. However, I am not using a button; I am using a rocker switch. In short toggle operations, the relay position does not change. I want the relay to operate based on the input being 1 or 0, rather than on the rising or falling edge of the input. I want the outputs to operate as momentary, not latched. How should I configure this?
    Moes Wi-Fi+RF switch module with labeled connectors and white casing
  • ADVERTISEMENT
  • #2 21719352
    DeDaMrAz
    Level 21  
    What version of the flasher gave you Bad CRC?

    Try to assign dInput to the button and see if that will make the desired effect.

    Also this would be a god time to point out you can use OBK win simulator - https://github.com/openshwprojects/OpenBK7231...s/download/1.18.193/obkSimulator_1.18.193.zip

    More infor how to use it here - https://www.elektroda.com/rtvforum/topic4046056.html
  • #3 21719478
    erdemefe1
    Level 3  
    I used v93 and v99.

    When an assigned pin as DInput it works like btn. No any difference.
  • ADVERTISEMENT
  • #4 21719490
    DeDaMrAz
    Level 21  
    erdemefe1 wrote:
    I am using a rocker switch


    Can you clarify this a bit is it switch or a momentary button? Am I understanding you correctly you want your relay to be ON as long as that "switch" is pressed and OFF once you release it?? If so try with dInput_n and test.

    Added after 5 [minutes]:

    erdemefe1 wrote:
    I have many Moes 1-gang WiFi + RF switches based on WB2S (BK7231T). I tried to flash three of them with BK7231GUIFlashTool using the firmware OpenBK7231T_UA_1.18.188.bin. The backup and erase processes completed successfully, but I got a BAD CRC error at the end of flashing. After that, the devices would not boot successfully, and strangely, the modules consumed only around 1 mA of current after the failed flash. Finally, I used BK Writer 1.6 on a fourth module with the same firmware, and it worked.


    @divadiow are you in position to test this maybe?
  • ADVERTISEMENT
  • #6 21719602
    p.kaczmarek2
    Moderator Smart Home
    I see, wrong offset, but luckily there is now bootloader protection

    Added after 1 [minutes]:

    hey but that should not cause crc error, unless he had much older, broken version
    Helpful post? Buy me a coffee.
  • #7 21719603
    divadiow
    Level 36  
    yes, I'm not sure of the connection either.

    Added after 50 [seconds]:

    maybe unrelated and the cables were just too long?
  • #8 21719609
    p.kaczmarek2
    Moderator Smart Home
    I've checked again and it seems that v93 was bad, so that one is to remove from hard drive permanently. It's possible that those Beken may need SPI recovery.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #10 21719625
    erdemefe1
    Level 3  
    DeDaMrAz wrote:
    Can you clarify this a bit is it switch or a momentary button? Am I understanding you correctly you want your relay to be ON as long as that "switch" is pressed and OFF once you release it?? If so try with dInput_n and test.

    Yes, exactly as you described. When the switch is on, the relay is on; when it’s off, the relay is off. When the relay state is changed via HTTP or MQTT, I want to opposite behavior when the switch is on, the relay turns off; when the switch is off, the relay turns on.

    When the input changes rapidly, the relay does not respond and remains in the previous state.

    On the board, there are another MCU and an RF receiver IC expect WB2S. The input may be coming through this MCU. I couldn’t fallow traces on the layout carefully. My issue might be hardware-related; I will notice you again once I am sure.


    p.kaczmarek2 wrote:
    I've checked again and it seems that v93 was bad, so that one is to remove from hard drive permanently. It's possible that those Beken may need SPI recovery.


    I recovered my modules with v126 by SPI Flashing with CH341 programmer
  • #11 21719649
    DeDaMrAz
    Level 21  
    erdemefe1 wrote:
    Yes, exactly as you described. When the switch is on, the relay is on; when it’s off, the relay is off. When the relay state is changed via HTTP or MQTT, I want to opposite behavior when the switch is on, the relay turns off; when the switch is off, the relay turns on.


    This would require some event handling and creating autoexec file to handle that but first figure out what you want exactly and more importantly figure how your board is working with that RF section as that can be a separate can of worms altogether.

    Documentation for event handling and scripting can be found here:

    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md

    And autoexec examples here:

    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md

    For example assign your pin role as ButtonScriptOnly and in autoexec add this line

    addEventHandler OnClick 26 POWER TOGGLE


    Let us know if that works for you.

Topic summary

The discussion addresses two main issues with Moes 1-gang WiFi + RF switches based on the OpenBeken WB2S (BK7231T) platform. First, flashing the firmware OpenBK7231T_UA_1.18.188.bin using BK7231GUIFlashTool resulted in a BAD CRC error despite successful backup and erase steps, causing the devices to fail boot and draw minimal current (~1 mA). The error was linked to problematic flasher versions, particularly v93, which should be avoided. Recovery was successfully achieved using BK Writer 1.6 and SPI flashing with a CH341 programmer and firmware v126. Second, configuring the relay to respond to a rocker switch input rather than a momentary button was problematic. Assigning pin 26 as button channel 1 and pin 6 as relay channel 1 caused the relay to toggle on button press, but the relay did not maintain state correctly with a rocker switch input. The desired behavior is for the relay to follow the input state (on/off) rather than edge-triggered toggling, with momentary output operation. Suggested solutions include using dInput or dInput_n for input assignment and implementing event handling with autoexec scripts to manage relay state based on input level. The presence of an additional MCU and RF receiver IC on the board complicates input tracing and may contribute to hardware-related issues. Documentation and examples for event handling and scripting are available in the OpenBK7231T_App GitHub repository.
Summary generated by the language model.
ADVERTISEMENT