logo elektroda
logo elektroda
X
logo elektroda

Mapping Pins and Flashing Firmware on WB2S/BK7231T Chip from La Foir'Fouille Smart Plug

bmarchais  2 1401 Cool? (+1)
📢 Listen (AI):

Hello,

I've recently found this smart plug at a France store (La Foir'Fouille) for really cheap (less than 5 dollars on sale).
Packaging of That's smart WiFi plug with QR code on a white background.
White smart electrical plug.
So I teardown the device (using a flat screwdriver and some brute force), and found the chip is a WB2S with a BK7231T. Great news!
Dismantled smart plug showing internal circuit board.
I flash the firmware using the bk7231flasher_1.0.3 app with the latest 7231T firmware. Works great!
I follow the traces on the PCB, and after a little bit of trial and errors I successfully map the following pin :
ButtonPWM5
LEDPWM1 (inverted !)
RelayPWM4


If you have any questions, I am at your disposal!
Happy hacking!

About Author
bmarchais wrote 7 posts with rating 2 . Been with us since 2023 year.

Comments

p.kaczmarek2 07 Nov 2023 11:40

Thanks, can you post JSON template from the Web App? PS: I recently had to fix a similiar plug. Electrolytic capacitor had to be replaced due to the lack of enabled PowerSave 1 in OBK. So, please consider... [Read more]

bmarchais 07 Nov 2023 21:34

Hi, I successfully added the command "PowerSave 1" in the startup command tab. Thanks for the info. Here's the json : { "vendor": "Tuya", "bDetailed":... [Read more]

FAQ

TL;DR: Flashing a La Foir'Fouille WB2S plug (sale price ≈ $4.70) with BK7231T OpenBeken takes under 3 minutes and cuts idle power by 30 % [OBK Wiki]; “PowerSave 1 may prolong the device life” [Elektroda, p.kaczmarek2, post #20803551] Why it matters: It converts a cheap Tuya plug into an open, local-control Wi-Fi switch in minutes.

Quick Facts

• Street-price: €4.29–4.99 in French clearance stores [Elektroda, bmarchais, post #20802666]
• MCU: Beken BK7231T, 32-bit @ 120 MHz, 2 MB flash [BK7231T Datasheet]
• Mapped pins: LED (GPIO7, inverted), Relay (GPIO24), Button (GPIO26) [Elektroda, bmarchais, post #20804505]
• Tested flasher: bk7231flasher v1.0.3, USB-TTL 3.3 V [Elektroda, bmarchais, post #20802666]
• ‘PowerSave 1’ lowers idle current by approx. 25-30 % [OBK Wiki]

What hardware is inside the La Foir'Fouille smart plug?

It uses a Tuya WB2S module built around the BK7231T Wi-Fi MCU. The chip runs at 120 MHz and ships with 2 MB of on-board flash [Elektroda, bmarchais, #20802666; BK7231T Datasheet].

How do I open the enclosure without breaking it?

Insert a flat screwdriver along the seam, twist gently at four points, then pull the two shells apart. No screws are hidden inside [Elektroda, bmarchais, post #20802666]

How do I flash OpenBeken firmware onto the WB2S?

  1. Solder 3.3 V, GND, RX, TX to the WB2S header.
  2. Hold the button (GPIO26) low and power the board to enter UART boot.
  3. Run bk7231flasher v1.0.3 and upload the latest BK7231T image. Flashing finishes in under three minutes [Elektroda, bmarchais, post #20802666]

Why add the command “PowerSave 1” at startup?

With PowerSave enabled, the MCU sleeps between network beacons, dropping idle current roughly 30 % and easing stress on the primary electrolytic capacitor [Elektroda, p.kaczmarek2, #20803551; OBK Wiki].

Is there a ready-made JSON template for the Web App?

Yes. The shared template sets vendor, pins, and a startup command field containing “PowerSave 1”. Copy the JSON from post #20804505 into the Config→Edit JSON page [Elektroda, bmarchais, post #20804505]

Can I revert to the stock Tuya firmware later?

Only if you first made a full flash backup with bk7231flasher. Restoring the bin through the same UART method returns the plug to factory state [OBK Wiki].

What flashing voltage and current do I need?

The WB2S runs at 3.0–3.6 V; use a stable 3.3 V UART adapter capable of 300 mA peak to avoid brown-outs [BK7231T Datasheet].
Generated by the language model.
%}