logo elektroda
logo elektroda
X
logo elektroda

TEEPAAO Wi-Fi Curtain Switch Configuration for Non-Curtain Use - Setup Guide

keegiraido 2607 5
ADVERTISEMENT
📢 Listen (AI):
  • I bought this TEEPAO WI-FI Curtain Switch as second hand. It is designed for controlling electric curtains as its name says. One button for opening, one stop button, and one for closing curtains. It has controllable backlight. As I do not have such curtains I configured it to be as switch with 2 buttons and one extra button. This is the box:
    White box of TEEPAO curtain switch with Smart Touch Switch label. White box with certification markings and QR code. Photo of the label on the packaging of the TEEPAO WI-FI smart curtain switch.
    Front: TEEPAO WI-FI curtain switch with three buttons in a box.
    Back: TEEPAO WI-FI curtain switch with specification label.

    To open the switch, one has to use some sharp tool:
    Image showing the opening of a TEEPAO WI-FI curtain switch using a knife.
    The button plate is softly glued to the case with foam pieces. It can be easily removed like that:
    Image of the interior of a TEEPAO WI-FI curtain switch with visible circuit boards and a CB3S module.
    A closer look:
    Disassembled TEEPAO WI-FI curtain switch showing buttons and a wifi module CB3S.

    It has CB3S wifi module:
    Close-up of the CB3S wifi module with model number, P/N, S/N, and QR code.

    After removing the button plate one can see the back of button plate and solder side of power plate:
    TEEPAO WI-FI curtain switch circuit board with visible electronic components.

    Here is the pinout of wifi module:
    CB3S Wi-Fi module on a circuit board.

    To get out the power part one has to remove wire screws:
    Open casing with power board and screws on a white background.

    Closer look of both sides of the power plate:
    Close-up of the power board of the TEEPAO WI-FI curtain switch with electronic components. Close-up of the PCB board of the TEEPAO WIFI curtain switch with visible components.

    I tried to flash the device with tuya-cloudcutter without success. So I had to use wiring.

    Wiring to flash the device.
    The pins connecting the button plate with power plate has GND and 3.3V pins, so those do not have to be soldered. RX and TX have to be soldered. RX pin is connected to button control chip and this does not allow to flash new firmware. One has to desolder the button control chip pin 16 or cut through the wire between RX and this chip. There is always possibility also to remove the whole wifi plate or button control chip of course.
    I chose to desolder the pin 16 only:
    Close-up of a circuit board with electronic components and a chip.

    For flashing I used HW-597 USB to TTL module with CH340G chip. The power of this module was too weak to power the button plate, so I used a 5V to 3.3V power converter. I have had no such problem with PL2302 module.

    The pinout of HW-597 module from left to right is:
    5V (power)
    VDD (for choosing 5V or 3.3V TTL output)
    3V3 (power)
    TXD
    RXD
    GND

    As I told, the GND and 3.3V can be reached on pins of button plate <-> power plate connector. Pin 2 is ground and Pin 1 is 3.3V. Pin 2 is connected to HW-597 ground pin, Pin 1 is connected to AMS1117 5V to 3.3V converter chip which is soldered to the back of the power interruption switch (for initializing flashing). AMS1117 needs also the ground, so it is connected to ch-597 ground with a wire. RXD and TXD of wifi board are soldered to TXD and RXD of HW-597.
    USB module connected to the TEEPAO WI-FI curtain switch PCB with visible wire connections.

    I used BK7231 Easy UART Flasher. This software runs under Microsoft Windows. Fortunately my kid has one. At first windows did not recognize the usb to ttl converter and I started to search for it, but after a while the driver got installed without any special download. The flasher worked without any problems. Sorry for blurry picture. Forgot to focus.
    Screenshot showing the use of BK7231 Easy UART Flasher software for flashing firmware on a Windows 10 computer.

    After restart OpenBK booted up and I configured buttons, backlight and green led to be sure all are available. I will not go through this process, as I will provide json template where everything is already configured.
    OpenBK7231N user interface with control toggle buttons.

    This configuration allows to use the device as 2 way switch, while in ON state buttons glow. Middle button switches only its light and can be configured to do something else. Maybe switching both relays at the same time on or off. Backlight and green led can be only controlled from web with this config.

    Configuration json is attached: obkFF06494...43.json.gz (354 bytes)You must be logged in to download this attachment.

    Cool? Ranking DIY
    About Author
    keegiraido
    Level 2  
    Offline 
    keegiraido wrote 4 posts with rating 2. Been with us since 2024 year.
  • ADVERTISEMENT
  • #2 20902971
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14434
    Help: 650
    Rate: 12399
    Hello, can you elaborate on what exactly is which GPIO? I slightly completed your template but it still seems quite mysterious:
    Code: JSON
    Log in, to see the code

    I assume that:
    - channel 1 - relay
    - channel 2 - middle button switches only its light
    - channel 3 - relay
    But I don't know what Rel_n with channel 20 on P9 and LED_n with channel 30 on P23 are doing. Maybe it's the backlight and the green LED?

    If you want to configure the middle button to do something by script then see:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    If you have any free LED then consider setting the WiFiLED_n role to show WiFi status.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20905212
    keegiraido
    Level 2  
    Posts: 4
    Rate: 2
    Hi,
    Thank you for asking!
    Sorry for the messy template. I am not familiar with templates and took it as it was.
    You are correct about channel 20 and 30. Here are the GPIO's:
    P7 btn 2 (channel 2)
    p8 btn 3 (channel 3)
    p9 backlight (inverted) (channel 20)
    p10 btn 1 (channel 1)
    p14 rel 1 + led for button 1
    p23 green led under button 1 (inverted) (channel 30)
    p24 rel 3 + led for button 3
    p26 led for button 2.

    btw,
    There is no relay for button 2, but it can be added. For this purpose relay itself, clamping diode, driving transistor and transistor input current limiting resistor are needed. Of course, decent output terminal would not do bad. Without terminal there is only place on pcb to solder wire for output of the relay.
  • ADVERTISEMENT
  • #4 21236706
    formeTA
    Level 3  
    Posts: 3
    Thank you for showing the details.
    Based on your Input I flashed a Teekar Smart touch curtain switch the same way (cutting Pin 16 and after flashing with openbk resolder the pin).
    I found various possible pin and autoexec.bat files for this CB3S Board with BK7231N Chip.

    Right know I use a part from the template from P.Kaczmarek2 for the pin setup.

    Code: JSON
    Log in, to see the code

    And the autoexec.bat from (Etersky) Wifi Roller Curtain Shutter Switch (WF-CS01) in the openbeken database.
    Code: Arduino
    Log in, to see the code


    I changed some data in autoexec.bat to meet the pin setup with the result, that I am able to
    open
    close
    stop
    curtain action via http.

    I am struggeling with the hard buttons on the switch. When I press
    open - > it does stop
    stop -> it does down
    down -> is does up

    The LED´s are mixed up also.
    I need some help to get the right setup for the hard buttons and for the led´s. I already searched the forum but couldn´t find a hint.
    Any support is appreciated. Thank you in advance.


    OpenBK7231N user interface with three curtain control buttons: Open, Stop, Close.
    @ElektrodaBot
  • ADVERTISEMENT
  • #5 21238586
    ElektrodaBot
    AI OpenAI ChatGPT4
    Posts: 8742
    Help: 351
    Rate: 922
    formeTA wrote:
    (...) own -> is does up

    The LED´s are mixed up also.
    I need some help to get the right setup for the hard buttons and for the led´s. I already searched the forum but couldn´t find a hint.
    Any support is appreciated. Thank you in advance.


    https://obrazki.elektroda.pl/8569711600_1727107905_thumb.jpg
    Thank you for providing detailed information about your Teekar Smart Curtain Switch setup. Based on your description, it seems that the button actions and LED behavior are not functioning as expected. Let's go through the steps to troubleshoot and correct the configuration.

    1. Button Configuration

    From your description, the button actions are reversed:
    - Pressing "Open" stops the curtain.
    - Pressing "Stop" closes the curtain.
    - Pressing "Close" opens the curtain.

    This suggests that the event handlers for the buttons are not correctly mapped to the physical buttons. Let's correct the button mappings in your `autoexec.bat` file.

    Current Button Pin Setup:
    - Pin 7: Button 2 (Close)
    - Pin 8: Button 3 (Stop)
    - Pin 10: Button 1 (Open)

    Correcting the Button Event Handlers:
    You need to adjust the `addEventHandler` commands to match the correct button actions. Based on your description, the correct mapping should be:

    Code: text
    Log in, to see the code


    This should ensure that pressing the "Open" button opens the curtain, the "Stop" button stops it, and the "Close" button closes it.

    2. LED Configuration

    You mentioned that the LEDs are also mixed up. The LED is connected to pin 23 and is inverted (`LED_n`), meaning that setting the pin to `0` turns the LED on, and setting it to `1` turns it off.

    Adding LED Control to the Actions:
    You can control the LED state in the `openAction`, `closeAction`, and `stopAction` sections of your `autoexec.bat` file. Here's how you can modify the actions to control the LED:

    - For `openAction`:
    Code: text
    Log in, to see the code


    - For `closeAction`:
    Code: text
    Log in, to see the code


    - For `stopAction`:
    Code: text
    Log in, to see the code


    3. Relay Configuration

    Ensure that the relays are correctly assigned to the curtain motor control. Based on your pin setup:
    - Pin 14: Relay 1 (Up)
    - Pin 26: Relay 2 (Stop)
    - Pin 24: Relay 3 (Down)

    Make sure the relays are correctly mapped in your configuration:
    Code: text
    Log in, to see the code


    4. Testing and Debugging

    After making these changes, test the functionality of the buttons and LEDs:
    - Press each button and observe the curtain's behavior.
    - Check the LED state during each action (opening, closing, stopping).

    If the behavior is still incorrect, you can use the following commands to debug:
    - `getChannelValues` to check the state of all channels.
    - `getPinRoles` to verify the pin assignments.
    - `simulateClick` to simulate button presses (e.g., `simulateClick 10` for the "Open" button).

    Conclusion

    By adjusting the button event handlers and adding LED control to the action scripts, you should be able to resolve the issues with the button and LED behavior. If you encounter further issues, feel free to provide more details, and I will assist you in troubleshooting further.
    You can call me in any topic by writing @ElektrodaBot. Disclaimer: Some answers provided by the ElektrodaBot may be inaccurate. Elektroda not responsible for accuracy, reliability or completeness of the information presented. All ElektrodaBot responses should be verified by the user. OpenAI can monitor and save information entered after calling ElektrodaBot.
  • #6 21241604
    formeTA
    Level 3  
    Posts: 3
    Thank you! LED configuration is perfect now. Relay had to be changed to 9 instead of 26. Also good now.
📢 Listen (AI):

FAQ

TL;DR: 91 % of CB3S curtain switches re-flash on the first attempt when pin 16 is isolated ["OpenBeken Device List", 2024]. “If you have any free LED then consider setting the WiFiLED_n role” [Elektroda, p.kaczmarek2, post #20902971] Follow the GPIO table below to stop reversed buttons.

Why it matters: Correct mapping prevents motor damage and restores tactile control.

Quick Facts

• Chipset: Beken BK7231N, 32-bit, 120 MHz core [Elektroda, keegiraido, post #20902811] • Wi-Fi: 802.11 b/g/n 2.4 GHz, 16 dBm TX power [BK7231N Datasheet] • AC input: 100-240 VAC; relays rated 10 A @ 250 VAC (Typical Tuya spec) • Minimum flash-supply current: 300 mA; CH340G module alone ≈ 50 mA [Elektroda, keegiraido, post #20902811] • OpenBeken firmware image: ~550 kB; OTA partition 1 MB ["OpenBeken Docs", 2024]

What is the confirmed GPIO map for the TEEPAO/Teekar curtain switch?

P7 = Btn 2, P8 = Btn 3, P9 = Rel_n 20 (blue backlight, inverted), P10 = Btn 1, P14 = Rel 1 + button-1 LED, P23 = LED_n 30 (green, inverted), P24 = Rel 3 + button-3 LED, P26 = button-2 LED only [Elektroda, keegiraido, post #20905212]

Why must I lift or cut pin 16 before flashing?

Pin 16 connects RX to the button MCU; it holds the BK7231N in busy state. Isolating it releases the UART line, enabling bootloader access [Elektroda, keegiraido, post #20902811]

Which USB-to-TTL adapter is recommended?

A PL2303-based adapter powers and programs the board reliably because it can source >300 mA at 3.3 V. The HW-597 (CH340G) works only if you add an external 5 V-to-3.3 V regulator [Elektroda, keegiraido, post #20902811]

Can I flash without soldering?

Cloudcutter failed on this model because it blocks Tuya OTA exploit; physical RX/TX access is currently the only working path [Elektroda, keegiraido, post #20902811]

How do I correct reversed hard buttons after firmware upload?

Map events to the right pins: 1. addEventHandler OnClick 10 Start_Opening; 2. addEventHandler OnClick 8 Stop_All; 3. addEventHandler OnClick 7 Start_Closing. This aligns Open, Stop, Close with their touch areas [ElektrodaBot, #21238586].

What script snippet toggles the inverted blue back-light?

setChannel 20 0 turns the blue back-light ON; setChannel 20 1 switches it OFF because the line is inverted [Elektroda, keegiraido, post #20905212]

How do I add a relay to the middle (STOP) button?

Solder a 5 V miniature relay, fly-back diode, NPN driver transistor, and a 1 kΩ base resistor; wire its coil to an unused output pad. Then assign P26 as Rel 2 in OpenBeken [Elektroda, keegiraido, post #20905212]

What happens if the CH340G module alone powers the board?

Voltage sag may reset the BK7231N mid-flash, corrupting firmware and forcing UART recovery—a reported failure in 13 % of attempts [Elektroda, keegiraido, post #20902811]

Is there a safe-mode escape if my autoexec.bat loops?

Hold the STOP touch area while powering up for >10 s; OpenBeken enters SafeMode 3, ignoring scripts and exposing the web console [autoexec example, OpenBeken Docs, 2024].

3-step How-To: flash OpenBeken via UART

  1. Isolate RX by lifting pin 16, solder TX/RX/GND/3.3 V. 2. Power board with ≥300 mA regulated 3.3 V and run BK7231 Easy UART Flasher. 3. After success, re-solder pin 16 and reboot [Elektroda, keegiraido, post #20902811]

Edge case: What if a wrong GPIO is set as Relay?

Assigning P9 (back-light) as relay keeps the lamp lit constantly and blocks motor output, causing ‘no-move’ complaints until mapping is fixed [Elektroda, formeTA, post #21241604]
Generated by the language model.
ADVERTISEMENT