logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/CB2S] Inverted PCB layout of CB2S on FS-05R Mini Dimmable Switch

iotflasher 5484 30
ADVERTISEMENT
  • #31 21859199
    pierdata
    Level 6  
    Update:
    i was able to get the module working, it is possible that the wrong flags were causing the device to be killed....

    pin setting:
    "7": "Btn;1",
    "8": "LED_n;1",
    "24": "Btn_ScriptOnly;0",
    "26": "Btn_ScriptOnly;0"

    autoexec.bat
    Spoiler:
    // this is not really tuyaMCU but we will treat it as such
    startDriver TuyaMCU
    // set baud rate
    tuyaMcu_setBaudRate 115200


    // create a toggle and a dimmer
    setChannelType 1 toggle
    setChannelType 2 dimmer256


    // invoke refresh on change
    addEventHandler OnChannelChange 1 startScript autoexec.bat refresh
    addEventHandler OnChannelChange 2 startScript autoexec.bat refresh


    refresh:
    // channel 5 is temporary variable, from 0 to 255*3, multiplied also by toggle value
    setChannel 5 $CH2*3*$CH1
    // split into two bytes
    setChannel 3 $CH5/256
    setChannel 4 $CH5%256
    // send the two bytes
    tuyaMcu_sendCmd 0x30 00$CH3$$CH4$



    OpenBK7231N web panel screenshot showing OFF, Toggle 1 button, and a Channel 2 slider

    after further reading of the related topics actually the slider or button does not always work, sometimes you have to press several times i.e. I understand that this is not yet a polished and closed topic....

    My request, because I'm not proficient enough to create these scripts myself, can someone help me to make a ready script without additional options such that I can configure this device properly for its intended use so that the button on the device turns on and off (can also be hold-dimming/brightening) and the 3 contacts power,+ and - as intended to perform their function ?

    thank you in advance
    kind regards
    prucho
  • ADVERTISEMENT

Topic summary

The discussion addresses issues with the FS-05R Mini Dimmable Switch featuring the BK7231N/CB2S Wi-Fi module, specifically the inverted or mirrored PCB silkscreen layout that contradicts official documentation. Users report inability to communicate with the CB2S chip via USB-TTL and BekenWriter, observing continuous 0xFF data on serial lines. The root cause is identified as incorrect silkscreen pin labeling; the correct pinout aligns with Tuya documentation rather than the PCB markings. Solutions include ignoring the PCB silkscreen and following the classic Tuya pinout for connections. OpenBeken firmware and custom scripts (autoexec.bat) enable functional control, including button event handling (click, double-click, hold) and dimmer operation via TuyaMCU-like protocol, though the device uses a custom UART protocol rather than classic TuyaMCU. Wiring guidance for momentary switches in 2-way configurations is provided, emphasizing correct GPIO pin assignments (e.g., pins 24 and 26 for button inputs) and scripting roles (Btn_ScriptOnly) for flexible control. Some users report issues with stock firmware detection and device operation, suggesting firmware replacement or flashing with OpenBeken. Additional notes mention similar silkscreen issues on FS-02HW switches with CB2S modules. The discussion includes references to reverse-engineering resources and firmware flashing tools like Tuya-Cloudcutter, with success dependent on firmware versions.
Summary generated by the language model.
ADVERTISEMENT