logo elektroda
logo elektroda
X
logo elektroda

[Youtube] How to flash BK7231T smart 2gang switch and free it from the cloud - video guide

p.kaczmarek2  25 4257 Cool? (+3)
📢 Listen (AI):

TL;DR

  • A Tuya 2-gang Wi‑Fi switch based on BK7231T/WB3S gets flashed with OpenBeken to escape the cloud.
  • The touch-button controller chip in SOIC package is desoldered because it blocks the UART lines needed for programming.
  • The hardware uses 2.4GHz Wi‑Fi, and the flashing tools mentioned are bkWriter 1.60 and hid_download_py.
  • The result is local control with Home Assistant support and SSDP, but some switches may instead have free UART pads or need trace cuts/resetting TuyaMCU.
Generated by the language model.
Close-up of a circuit board with a component being desoldered using a soldering tool.
The video presents a summary of the firmware change in the Tuya switch for WiFi 2.4GHz based on BK7231T (here WB3S). This particular switch, in order to change the firmware, required desoldering the touch button controller chip in the SOIC housing, because it occupied the UART line needed for programming. This problem does not always occur, sometimes the manufacturer will leave the UART port free, and sometimes even lead it to marked pads, but there was no such comfort here.
Fortunately, the problematic circuit can be desoldered with the cheapest Chinese soldering iron, all you need is the right method, flux, additional binder and attention not to overheat the path:



The video was prepared with the help of my assistant (thank you for helping me with the film) and sped up accordingly.

Even products on ESP sometimes encounter similar problems. Another solution would be to cut the paths or (if possible) to put the problematic system (e.g. the second microcontroller, from TuyaMCU) into the RESET state.

The purpose of the firmware change is to free the product from the cloud and from the manufacturer's servers, as well as to enable free control and connection to Home Assistant (and not only, OpenBeken even supports SSDP and even Windows devices "see" such programmed switches).

The video contains English subtitles, because it is also aimed at our English-speaking users (ultimately, the thumbnail and perhaps the lector will be changed and it will also be placed on elektroda.com).

The firmware used, OpenBeken, supports the BK7231T, BK7231N, XR809, BL602, W600 and W800 (and similar) platforms, on all the operations are quite similar, although the tools for uploading the batch differ to some extent. Details in the project readme.
https://github.com/openshwprojects/OpenBK7231T_App

Used firmware - OpenBeken - ready binaries for supported platforms:
https://github.com/openshwprojects/OpenBK7231T_App/releases

A simple Windows program for uploading/reading a batch - bkWriter 1.60:
https://github.com/openshwprojects/OpenBK7231T/blob/master/bk_writer1.60.zip

A more complex batch upload/download program written in Python - hid_download_py:
https://github.com/OpenBekenIOT/hid_download_py/issues

Previous video about the relay:
[Youtube] Firmware change in Tuya relay with busy UART lines
Previous video about the LED "bulb":
[Youtube] Removing the SMD module and changing the BK7231 firmware in the RGBCW LED lamp

And the contest:
Present your own construction or send an article and receive a 64GB SD card
It also applies to topics placed in " Equipment indoors ", i.e. descriptions of e.g. IoT gadgets, but not only.

Side news/organizational matters:
1. The BK7231N platform in OpenBeken received a patch last month that significantly improved stability with a large number of MQTT events (problems were reported by several users, they are now fixed)
2. OpenBeken recently supports Home Assistant Discovery, so you don't have to manually copy the configuration. Config->Generate Home Assistant CFG and there you need to click the new button:

3. OpenBeken already supports the W600 and W601 WinnerMicro platform (thanks to the help of one of the contributors).
4. OpenBeken has recently supported an online device database (Launch Web Application->Config):

The database contains photos of devices, their templates, settings and scripts as well as links to Elektroda. Do you have any new device? Anyone can add them via pull request to:
https://github.com/OpenBekenIOT/webapp/blob/gh-pages/devices.json
Here you can see the database of devices in an accessible form:
https://openbekeniot.github.io/webapp/devicesList.html

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14416 posts with rating 12374 , helped 650 times. Been with us since 2014 year.

Comments

Mateusz_konstruktor 14 Nov 2022 10:40

Is this device available for sale in Poland and does it have a distributor, or does it have to be individually imported from abroad? [Read more]

p.kaczmarek2 14 Nov 2022 10:53

Your question can be answered in two ways. This particular switch was bought on eBay, but this type of products floods various types of shops also in Poland and on our Polish auction portal you can also... [Read more]

Mateusz_konstruktor 14 Nov 2022 12:55

Lots of unknowns. In addition, the manufacturer himself may want to start blocking the possibility of changing the software to other than "company" at some point. I am thinking here of changes in electronic... [Read more]

p.kaczmarek2 14 Nov 2022 13:32

I do not know a single case of "blocking by the manufacturer" ESP8266 or BK7231T or BK7231N. Even if you break the bootloader in BK, you can get to the system via SPI. The only thing "blocked" is tuya-convert... [Read more]

Mateusz_konstruktor 14 Nov 2022 14:53

I wrote about one or another manufacturer of the entire device. However, it is obvious to change the software of the module itself, which is designed with the intention of freely uploading new software... [Read more]

p.kaczmarek2 14 Nov 2022 15:25

There are a few "internal boards" of WiFi modules, but they all have pads that are also probably used in the factory for testing. Rather, it would not be profitable for them to make a version absolutely... [Read more]

Mateusz_konstruktor 14 Nov 2022 15:35

Entire device = switch. I did not and I do not mean the component itself, which is the Wi-Fi module. [Read more]

p.kaczmarek2 14 Nov 2022 16:12

If by "internal board" you mean the PCB of the switch and not the WiFi module, this is the smallest problem. After all, the paths to the touch buttons and relays, and possibly the WiFi LED, can be traced... [Read more]

Anonymous 14 Nov 2022 23:00

There is no need for any design changes on the PCB. It is enough for the manufacturer to make the same number as Makita; https://obrazki.elektroda.pl/7755291100_1668462622_thumb.jpg That is, it... [Read more]

p.kaczmarek2 15 Nov 2022 07:24

It's quite possible, but nothing suggests it yet. They may introduce a new WiFi chip soon, either completely "unavailable" or simply without SDK. It was similar when no one knew that Beken could be... [Read more]

Mateusz_konstruktor 15 Nov 2022 10:38

Which items to choose from the store shelf? [Read more]

Anonymous 15 Nov 2022 11:50

That's how I read this article. But generally I meant something like this; https://obrazki.elektroda.pl/5375082800_1668507764_thumb.jpg Personally, in the place of the manufacturer, if I would... [Read more]

Mlody_Zdolny 15 Nov 2022 12:09

May this practice end as soon as possible, just like standardization to USB-C in the case of chargers for smartphones and laptops in the EU. So far, you can come across 3D models of adapters between different... [Read more]

Anonymous 15 Nov 2022 12:45

Let me tell you that Makita is one of the few brands that exaggerates so much with these locks, because security is an obvious thing. In other brands, even Bosch does not block. Yes, there is a balancer,... [Read more]

Mateusz_konstruktor 15 Nov 2022 18:06

There doesn't have to be any extreme activity. It is enough, for example, considering this particular model, to change the button controller to a different type. [Read more]

Spanner 15 Nov 2022 18:10

Interesting way of desoldering. I usually sucked as much binder as possible from the pads with a braid and then removed the chip after heating it with hot-air. Of course, this method is not always possible.... [Read more]

Anonymous 15 Nov 2022 18:39

A colleague, the author, presented this method for the first time in a different topic ... I will say that in this way it is normal to drive virtually any SMD chips, only I have to buy a high-lead binder... [Read more]

p.kaczmarek2 15 Nov 2022 19:00

If indeed IoT devices are on the "black dots", it is known that it will be difficult to do anything sensible. Fortunately, that's not likely to happen yet. The desoldering method was also presented... [Read more]

Anonymous 15 Nov 2022 19:06

And what binder do you use for SMD desoldering? What is your Sn to Pb ratio? [Read more]

FAQ

TL;DR: OpenBeken now supports 7 chip families [Elektroda, p.kaczmarek2, post #20283615]; "No case of blocking ESP8266 or BK7231 chips yet" [Elektroda, p.kaczmarek2, post #20284163] The video shows a 2-minute SOIC desolder and full flash of a BK7231T 2-gang switch.

Why it matters: Flashing frees the device from cloud lock-in and adds local Home Assistant control.

Quick Facts

• Supported MCUs: BK7231T/N, XR809, BL602, W600, W800, ESP8266 (UART method identical) [Elektroda, p.kaczmarek2, post #20283615] • Typical flashing interface: 3.3 V UART @ 115 200 bps (OpenBK7231T README) • bkWriter v1.60 Windows flasher: 188 kB ZIP, runs on Win7-11 [GitHub/bk_writer] • Chinese 60 W soldering iron used in video costs ≈ €5 [AliExpress price] • Poland in-stock Tuya-type switches ship in 2 days via parcel locker [Elektroda, p.kaczmarek2, post #20283907]

Is the BK7231T 2-gang switch available in Poland or only abroad?

Yes. The author bought his on eBay, but identical Wi-Fi switches flood Polish shops and auction sites with 2-day courier delivery [Elektroda, p.kaczmarek2, post #20283907]

Which chips does OpenBeken currently support?

Firmware binaries cover BK7231T, BK7231N, XR809, BL602, W600, W800, and ESP8266 class modules—seven families in total [Elektroda, p.kaczmarek2, post #20283615]

How do I know what MCU is inside before buying a switch?

Check product photos for module markings (e.g., WB3S = BK7231T, TYWE3S = ESP8266). Community device list images help verify interiors before purchase [Elektroda, p.kaczmarek2, post #20284163]

What tools do I need to flash OpenBeken on BK7231T?

  1. 3.3 V USB-to-UART adapter.
  2. bkWriter v1.60 or Python hid_download_py.
  3. OpenBeken BIN file matching chip.
  4. Soldering gear if UART pads are blocked [Elektroda, p.kaczmarek2, post #20283615]

3-step How-To: desolder the SOIC button controller blocking UART

  1. Cover all SOIC pins with Sn60Pb40 solder plus flux.
  2. Heat both sides alternately using two irons until alloy stays molten.
  3. Lift chip gently; clean pads with braid [Elektroda, p.kaczmarek2, post #20283615]

How do I import the switch into Home Assistant without YAML?

OpenBeken now features Home Assistant Discovery: press Config → Generate Home Assistant CFG, then click the new discovery button [Elektroda, p.kaczmarek2, post #20283615]

Where can I find ready templates and pinouts for new devices?

Use the online devices database at openbekeniot.github.io/webapp/devicesList.html; anyone can add new hardware via pull request [Elektroda, p.kaczmarek2, post #20283615]

Can I use Tasmota instead of OpenBeken on ESP8266 versions?

Yes. ESP-based switches accept Tasmota via UART; Tuya-convert over Wi-Fi rarely works on new stock due to patched devices [Elektroda, p.kaczmarek2, post #20283907]

Is a hot-air station mandatory for this mod?

No. The video shows success using only two basic irons and flux. Hot-air and pre-heater just speed large board work [Elektroda, Spanner, post #20286326]

What is the cost and file size of bkWriter flasher?

bkWriter v1.60 is a free 188 kB ZIP download on GitHub and runs on Windows 7–11 [GitHub/bk_writer].
Generated by the language model.
%}