FAQ
TL;DR: For 1 AVATTO US-TS02 switch, the expert takeaway is "break RXD temporarily": flash the BK7231N CB3S over UART at 3.3 V, then restore the trace or resolder the 16-pin chip. This FAQ helps OpenBeken users solve flashing and GPIO setup. [#20616408]
Why it matters: The AVATTO US-TS02 can run OpenBeken, but the onboard 16-pin chip can block UART flashing unless isolated first.
| Option |
Action |
When used |
| Remove 16-pin chip |
Desolder, flash, solder back |
When the chip interferes with UART |
| Break RXD/TXD trace |
Cut trace, flash, repair trace |
When you can identify the correct UART trace |
Key insight: The switch is a direct GPIO BK7231N device, not a TuyaMCU case in this thread. Configure P7, P9, P23, and P26 after flashing.
Quick Facts
- Device data: AVATTO brand, US-TS02 model, Tuya vendor, BK7231N chip, CB3S module, and 1-gang US wall-switch format. [#20616408]
- UART wiring uses 4 connections: TXD1 to UART RX, RXD1 to UART TX, 3.3 V to UART 3.3 V, and GND to UART GND. [#20616408]
- OpenBeken GPIO mapping uses P7 for Btn 1, P9 for LED 1, P23 for WifiLED 0, and P26 for Rel 1. [#20616408]
- Flashing requires either removing the 16-pin chip or breaking the RXD/TXD trace before using BK7231GUIFlashTool. [#20616408]
- The Web App device entry was added through GitHub pull request 157 and marked merged on 2024-11-01. [#21284985]
How do I flash OpenBeken on an AVATTO Tuya US-TS02 1-gang WiFi wall switch with a BK7231N CB3S module?
Flash it with BK7231GUIFlashTool after isolating the UART path from the 16-pin chip.
- Connect TXD1, RXD1, 3.3 V, and GND to a UART adapter.
- Remove the 16-pin chip, or break the correct RXD/TXD trace.
- Flash the BK7231N, then solder the chip or trace back.
Use the template with P7, P9, P23, and P26 after flashing. [#20616408]
What UART connections are needed to flash the AVATTO Tuya US Wifi Wall Switch 1 Gang using BK7231GUIFlashTool?
Use four UART connections: TXD1 to UART RX, RXD1 to UART TX, 3.3 V to UART 3.3 V, and GND to UART GND. The thread names TXD1 and RXD1 as the serial flashing pins. Keep the logic supply at 3.3 V, as listed in the connection table.
[#20616408]
Which GPIO pins should be configured for the button, relay, LED, and WiFi LED on the AVATTO US-TS02 BK7231N switch?
Configure P7 as Btn 1, P26 as Rel 1, P9 as LED 1, and P23 as WifiLED 0. The posted JSON maps pin 7 to Btn;1, pin 9 to LED;1, pin 23 to WifiLED;0, and pin 26 to Rel;1. This mapping matches the AVATTO US-TS02 BK7231N profile.
[#20616408]
Why do some Tuya wall switches require breaking the RXD or TXD trace before flashing the BK7231N chip?
Some Tuya wall switches route RXD or TXD through another 16-pin chip, which can block flashing access. The thread calls the RX pin issue a known "complicator" also seen on ESP8266 Tuya switches 3–4 years earlier. Temporarily breaking the trace isolates the BK7231N UART for flashing.
[#20616589]
What is the purpose of removing the 16-pin chip before flashing the AVATTO US-TS02 switch?
Removing the 16-pin chip isolates the BK7231N UART so BK7231GUIFlashTool can communicate cleanly. The thread gives two options: remove the 16-pin chip, flash, then solder it back; or break the RXD/TXD trace, flash, then repair it. Both methods target the same UART conflict.
[#20616408]
How can I repair the RXD or TXD trace after flashing a Tuya BK7231N wall switch?
Repair the trace by soldering the broken RXD or TXD connection after flashing finishes. The thread states the process as: find the correct trace, break it, flash, then solder and repair the trace. This restores the original connection to the 16-pin chip.
[#20616408]
What is BK7231GUIFlashTool and how is it used with BK7231N Tuya devices?
BK7231GUIFlashTool is the flashing tool named for programming the BK7231N chip over UART. In this switch, use it after connecting TXD1, RXD1, 3.3 V, and GND. The post says to finally use BK7231GUIFlashTool to flash the BK7231N chip.
[#20616408]
What is a CB3S module in Tuya smart switches?
"CB3S is the Tuya module category used here that carries the BK7231N chip for WiFi switch control, identified in the thread by the chip field BK7231N [CB3S] and the AVATTO US-TS02 device template." The device profile lists chip BK7231N and names CB3S in the title.
[#20616408]
What is TuyaMCU mode and why does it make flashing or configuring smart switches more complicated?
"TuyaMCU mode is a smart-switch configuration mode that uses a separate Tuya MCU for device functions, requiring OpenBeken to communicate through that MCU instead of simple direct GPIO pin roles." One expert noted this switch was easier because it was not TuyaMCU. TuyaMCU switches need extra mode configuration.
[#20616605]
BK7231N vs ESP8266 Tuya switches: what is different when flashing custom firmware?
BK7231N uses BK7231GUIFlashTool in this thread, while the RX-pin complication also existed on ESP8266 Tuya switches. The author had seen the same RX issue 3–4 years earlier on ESP8266 Tuya switches. For this AVATTO switch, the chip is BK7231N [CB3S], not ESP8266.
[#20616589]
What should I do if BK7231GUIFlashTool cannot connect to the BK7231N chip in an AVATTO wall switch?
Check the UART wiring first, then isolate the interfering 16-pin chip or RXD/TXD trace. The required wiring is TXD1 to UART RX, RXD1 to UART TX, 3.3 V to 3.3 V, and GND to GND. If connection still fails, remove the 16-pin chip or break the correct trace before flashing.
[#20616408]
How do I create or import a JSON template for the AVATTO Tuya US-TS02 switch in the OpenBeken Web App?
Use the posted JSON template with vendor Tuya, name AVATTO Tuya US Wifi Wall Switch 1 Gang, model US-TS02, and chip BK7231N. Add pins 7, 9, 23, and 26 with Btn, LED, WifiLED, and Rel roles. The Web App JSON was requested and then added to the edited post.
[#20616531]
Where can I find the AVATTO US-TS02 device profile in the OpenBeken devices list after the GitHub pull request was merged?
Find it in the OpenBeken Web App devices list after pull request 157 was merged. The maintainer replied on 2024-11-01 that the device should be soon live at the devices list page. The profile came from the GitHub pull request posted on 2024-10-31.
[#21284985]
What safety precautions should I follow when opening and flashing a mains-powered AVATTO Tuya wall switch?
Disconnect mains power before opening, desoldering, cutting traces, or attaching a 3.3 V UART adapter. The thread concerns a US WiFi wall switch, so it is a mains-powered device even though flashing uses 3.3 V UART. Do not work on the PCB while it is connected to wall power.
[#20616408]
How can I identify whether my Tuya wall switch is a direct GPIO device or a TuyaMCU-based switch before configuring OpenBeken?
Check whether the template maps functions directly to BK7231N GPIO pins or requires TuyaMCU mode. This AVATTO profile maps four direct pins: P7 Btn 1, P9 LED 1, P23 WifiLED 0, and P26 Rel 1. A maintainer noted this device was not TuyaMCU, which avoided extra configuration.
[#20616605]
Generated by the language model.