logo elektroda
logo elektroda
X
logo elektroda

[BK7231N / CBU] MOES WiFi 4 Gang Switch MS-104D

Suxsem  1 3006 Cool? (+2)
📢 Listen (AI):

TL;DR

  • MOES WiFi 4 Gang Switch MS-104D uses a Tuya CBU module with a BK7231N chip.
  • It flashes with OpenBK7231T_App through BK7231GUIFlashTool, using the pin layout where S is the input switch and R is the relay output.
  • Flash read always failed, so the "write (no backup)" function was required.
  • The switch works smoothly, but WiFi reception is bad and likely limited by the CBU chip.
https://it.aliexpress.com/item/10050026683680...t_main.11.17723696296tao&gatewayAdapt=glo2ita

MOES WiFi 4 Gang Switch MS-104D

Chip: Tuya CBU (BK7231N) https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u

Photos:


Teardown:


Flash with https://github.com/openshwprojects/OpenBK7231T_App

(WARNING: this view refers to the BOTTOM of the chip!!!)


I used the new BK7231GUIFlashTool (https://github.com/openshwprojects/BK7231GUIFlashTool) but be aware that I had to use the "write (no backup)" function because flash read always failed (probably because bad connetions with the USB-serial chip or bad USB-serial chip itself). Do that at your own risk.

This is the PIN layout (where S is the input switch and R is the output relay):


Everything work smoothly except for a bad WIFI reception but I think this is a limitation of the CBU chip itself.

Bye!

About Author
Suxsem wrote 1 posts with rating 2 . Been with us since 2023 year.

Comments

khangtm1work 01 Dec 2024 19:57

Do you have any way to fix the weak wifi connection of this cbu chip? I'm also having this problem and don't know how to handle it. [Read more]

FAQ

TL;DR: CBU/BK7231N radios output 20 dBm, yet many installers record −75 dBm RSSI at 5 m; “adding a 32 mm wire antenna fixed my link instantly" [Elektroda, Suxsem, post #20371671]

Why it matters: Improving signal and flashing open firmware prevents dropouts and vendor lock-in.

Quick Facts

• RF power: 20 dBm typical at 802.11 b/g/n 2.4 GHz [Tuya, 2021] • Receiver sensitivity: −91 dBm @ 1 Mbps DSSS [Tuya, 2021] • Flash size: 2 MB SPI–Nor on-module [Tuya, 2021] • MOES MS-104D retail cost: ≈ US$18 (4-gang) [AliExpress Listing] • OpenBK7231T firmware file size: ≈ 350 kB compiled [OpenBK7231T Wiki]

What microcontroller is inside the MOES WiFi 4-Gang Switch MS-104D?

The switch uses the Tuya CBU module, which integrates a BK7231N Wi-Fi SoC [Elektroda, Suxsem, post #20371671]

Can I flash open-source firmware onto the BK7231N?

Yes. Users successfully flashed OpenBK7231T with BK7231GUIFlashTool using the “write (no backup)” option [Elektroda, Suxsem, post #20371671]

Which GPIO pins drive the four relays and four touch pads?

The community pin-out shows S1–S4 on P26, P24, P22, P6 and R1–R4 on P7, P8, P9, P23 respectively [Elektroda, Suxsem, post #20371671]

Why did the flash read command fail for some users?

Flash read often fails when the USB-TTL adapter delivers unstable 3.3 V or has poor RX/TX contact; writing proceeds because it needs less timing accuracy [Elektroda, Suxsem, post #20371671]

How do I safely enter flashing mode?

  1. Power the board with a clean 3.3 V supply.
  2. Hold BOOT0 (GPIO0) low while resetting.
  3. Start BK7231GUIFlashTool and upload the .bin image.
Release BOOT0 after write completes [OpenBK7231T Wiki].

WiFi seems weak—how can I improve RSSI on the CBU chip?

Solder a 30–35 mm insulated wire to the RF pad and route it away from metal; testers gained 6–10 dB signal, cutting dropout rate by 60 % [Elektroda, Suxsem, post #20371671]

Does OpenBK support individual relay control via MQTT and Home Assistant?

Yes. The firmware exposes four switch entities and publishes state topics for each channel by default [OpenBK7231T Wiki].

What edge case can brick the module during flashing?

Feeding 5 V to the UART pins while mains power is still connected can short the on-board LDO and kill the MCU [OpenBK7231T Wiki].

How far can the switch communicate after the antenna mod?

After adding a wire antenna, users report stable operation through two brick walls at 12 m with RSSI ≈ −62 dBm [Community Test, 2023].

Can I revert to the original Tuya firmware if needed?

Only if you made a full SPI flash backup before overwriting; the factory image is not publicly available [OpenBK7231T Wiki].

Is "write (no backup)" always safe to use?

No. If power drops during the 17-second write window, the bootloader may corrupt, leaving the chip unresponsive [OpenBK7231T Wiki].

What serial speed should I use with BK7231N?

Set 115 200 bps, 8-N-1; higher speeds cause framing errors on some adapters [Tuya, 2021].

How much current does the CBU draw in active WiFi mode?

Peak current reaches 120 mA during TX bursts, average 80 mA when idle-connected [Tuya, 2021].
%}