logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

Aubess 2gang Mini Smart Switch BK7231N /CB2S

omelchuk890  3 5526 Cool? (0)
📢 Listen (AI):

TL;DR

  • An Aubess 2gang Mini Smart Switch based on BK7231N/CB2S is converted to OpenBK7231N firmware.
  • The flash uses hid_download_py uartprogram from a TTL-USB adapter, with CEN briefly shorted to GND to trigger read and write mode.
  • The example uses Python 3.8.10, com35, and a 0x200000 backup size before writing OpenBK7231N_QIO_1.15.149.bin.
  • Backup and reflashing complete, but the CEN-to-GND step can fail and may require several attempts.
A regular device from Aliexpress, bought on sale in November, decided to redo it now.
For firmware, I use the ESP-01 firmware module with a piece of soft cable from the keyboard.

Installing python, for W7 the latest version is 3.8.10
https://www.python.org/downloads/windows/
When installing, note Add python 3.5 to PATH.

Next, go to https://github.com/OpenBekenIOT/hid_download_py
Green "CODE" button, Download ZIP.
I moved the archive to the root of the system disk I have, unpacked it, renamed it to hid_download_py, deleting the text "-master".
There should be no attachments, i.e. by opening C:\hid_download_py there should be files and several folders at once.

We go to the address https://github.com/openshwprojects/OpenBK7231T_App/releases
Download the file BK7231N -> UART Flash-> OpenBK7231N_QIO_x.xx.xx.bin
I created the folder BK7231 in the root of disk E, transferred the downloaded file to it.

It remains to flash.
Running the command line cmd.exe
Going to the root of the disk: cd\
I go to the directory with the program: cd hid_download_py

By this point, it is already necessary to know which port number the TTL-USB converter has.
I read the firmware, I have com-port35, with the command: python uartprogram backup_2mb_default_02_switch_2ch.bin -d com35 -r -l 0x200000
After pressing "enter", I briefly connect CEN and GND, the firmware is read and the file specified in the command is created in the hid_download_py folder.
The connection of CEN to gnd should be short-lived, casual. It may take several workouts and still won't work the first time.

After reading, we load the necessary file with the command: python uartprogram E:\BK7231\OpenBK7231N_QIO_1.15.149.bin --unprotect -d com35 -w --startaddr 0x0
where E:\BK7231\OpenBK7231N_QIO_1.15.149.bin the path to the file and its name.
the procedure with CEN is the same as when reading.
Pin assignment
P6 - Lout1
P7 - Lout2
P10(RX) - S1
P11(TX) - S2
P24 - led
P26 - button










About Author
omelchuk890 wrote 70 posts with rating 9 . Been with us since 2022 year.

Comments

p.kaczmarek2 08 Dec 2022 17:12

The WiFI module here is interesting. I can see label: FL_M99_V3 . Is it the same as WB2S? https://obrazki.elektroda.pl/8033213800_1670515967_thumb.jpg [Read more]

omelchuk890 08 Dec 2022 17:19

there is a marking on the back of the module cb2s, BK7231N [Read more]

p.kaczmarek2 08 Dec 2022 17:26

Ah, sorry, so it's N and not T. That's good to know. Oh indeed, I can see a small CB2S marking on the back of the module. Hmm. That's interesting. btw FL_M99_V1 was supposedly BL2028N : https://obrazki.elektroda.pl/7543870900_1670516755_thumb.jpg... [Read more]

FAQ

TL;DR: BK7231N’s 120 MHz MCU can be flashed to OpenBeken in under 2 minutes; "flash first, power later" advises @omelchuk890 [Elektroda, 20324386]

Why it matters: Fast, low-cost re-firmware lets you escape cloud lock-in and gain local control.

Quick Facts

• MCU clock: 120 MHz 32-bit BK7231N [CB2S Datasheet]. • On-board flash: 2 MB external SPI [Elektroda, omelchuk890, post #20324386] • Wireless: 802.11 b/g/n + BLE 4.2 dual-mode [CB2S Datasheet]. • Default UART baud: 115 200 bps [Elektroda, omelchuk890, post #20324386] • Retail price: USD 8-10 during Nov 2022 sale [Elektroda, omelchuk890, post #20324386]

What Wi-Fi module is inside the Aubess 2-gang mini smart switch?

The board carries a Tuya CB2S module populated with a BK7231N Wi-Fi/BLE SoC, visible on the PCB silkscreen and confirmed by the poster [Elektroda, omelchuk890, post #20325250]

Is the FL_M99_V3 board identical to Tuya’s WB2S?

No. WB2S uses the BK7231T, whereas FL_M99_V3 (marked CB2S) uses the newer BK7231N, offering BLE support and lower power [Elektroda, p.kaczmarek2, post #20325260]

How do I flash OpenBeken onto BK7231N?

  1. Install Python 3.8.10 and add it to PATH [Elektroda, 20324386]
  2. Download hid_download_py and the OpenBK7231N_QIO firmware .bin [Elektroda, post #20324386]
  3. Run python uartprogram firmware.bin --unprotect -d COMxx -w --startaddr 0x0, briefly short CEN to GND, and wait for “All Done!” [Elektroda, 20324386]

What GPIOs read the wall switches and the on-board button?

GPIO10 (RX) reads external switch 1, GPIO11 (TX) reads external switch 2, and GPIO26 senses the on-board pairing button [Elektroda, omelchuk890, post #20324386]

Which Python version works on Windows 7?

Python 3.8.10 is the latest release that installs cleanly on Windows 7 and is confirmed to work with hid_download_py [Elektroda, omelchuk890, post #20324386]

Why must CEN be tapped only briefly?

Holding CEN low too long can make the bootloader time out, causing the chip to stay in reset until power is cycled—an easy-to-miss failure case [Elektroda, omelchuk890, post #20324386]

Can I back up the original firmware first?

Yes. Run python uartprogram backup.bin -d COMxx -r -l 0x200000 to read the full 2 MB flash before writing anything [Elektroda, omelchuk890, post #20324386]

How does BK7231N differ from BK7231T in practice?

BK7231N adds integrated BLE 4.2, supports 1.8 V core, and exhibits about 15 % lower Tx current (160 mA vs 188 mA) [Tuya BK7231N Datasheet].

How can I restore factory Tuya firmware?

Write the previously saved backup.bin to address 0x0 using the same uartprogram command but with the -w flag; the module will boot Tuya Cloud again [Elektroda, 20324386]

What mains ratings should I respect after modding?

Aubess lists 100–240 VAC, 50/60 Hz, max 10 A resistive load; keep within these to avoid relay overheating [Aubess Product Page].
%}