logo elektroda
logo elektroda
X
logo elektroda

[BK7231N] (DIY) Mini Smart Switch UNSH SS8839-16A-W

riskorja 18762 50
ADVERTISEMENT
📢 Listen (AI):
  • #31 21106104
    wonz
    Level 12  
    Posts: 39
    Rate: 1
    Board Language: polish
    I have similar product, but I have an issue with deepsleep, device not waking up from timer. What is the solution to make it working propperly?
  • ADVERTISEMENT
  • #32 21106106
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14393
    Help: 650
    Rate: 12313
    BK7231T or BK7231N?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #33 21106108
    wonz
    Level 12  
    Posts: 39
    Rate: 1
    Board Language: polish
    >>21106106 BK7231N
  • ADVERTISEMENT
  • #34 21106115
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14393
    Help: 650
    Rate: 12313
    how do you setup it? I've never heard about such issue before. Were you using latest firmware version? Can you wake up it with button?
    Helpful post? Buy me a coffee.
  • #35 21106134
    wonz
    Level 12  
    Posts: 39
    Rate: 1
    Board Language: polish
    >>21106115Ok PinDeepSleep [time] waking up device after time, but deepsleep [time] not working propperly - sleeps forever. Will use pindeepslep.
  • #36 21109527
    donut343
    Level 2  
    Posts: 18
    Rate: 1
    I had two of these chips from different vendors in the "My Choice" section, both labeled as DIY Mini Smart Switch. Like others mentioned, I used the below pins to solder since it came with 1.3.10 firmware; I wasnt able to extract GPIO pin layout with the tool, the software failed there, but writing was fine. Below layout worked for me:
    - Pair/Toggle All Pin on P23
    - WiFi LED on P26
    - TglChannelToggle (channel 1) on P6
    - Relay (channel 1) on P7

    I accidentally desoldered a capacitor (https://www.elektroda.com/rtvforum/topic4056582.html) but havent run into issues so far
    Image of a circuit board with GPIO pin labels written in red.
  • #37 21112434
    donut343
    Level 2  
    Posts: 18
    Rate: 1
    >>21066589

    Hi @tonyb62 that flashing jig you got looks pretty convenient, could you tell me what that construction is? Looks 3d printed?
  • #38 21125841
    brazoayeye
    Level 4  
    Posts: 18
    Hello, i have this module and i'm trying to flash it using serial.
    I connected GND to S1 and other 4 pins as described on >>20797138 , but I can't backup the flash using bk_writer1.60.
    I set the right port and 115k baud, but when i power on the device I have

    Time:11.105s
    Speed of Reading:115200bps
    reading flash:0x00000000...FAILED

    What am I missing?
    If I keep the CEN down it doesen't start to download the flash.

    And next, can you give me a guide regarding how and what to download to the cpu?
    At the end I will try to install espHome, BK7231N should be supported.

    Thanks
  • #40 21125906
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14393
    Help: 650
    Rate: 12313
    Here we have some flashing guides for Tuya modules, some of them are BK7231, but also BL602, etc, etc:
    https://www.youtube.com/playlist?list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #41 21126030
    brazoayeye
    Level 4  
    Posts: 18
    >>21125858That's right! OPENBK works well. During the entire process i haven't touched the CEN pin.

    I made a project for EspHome and it works using

    bk72xx:
    board: generic-bk7231n-qfn32-tuya

    Always uploaded w/o CEN
  • #42 21126059
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14393
    Help: 650
    Rate: 12313
    I've also stopped using CEN over time. It always works without CEN, and in extreme cases, when it doesn't want to reset, I just temporary short the disconnected 3.3V wire from the WiFI module side with ground and it helps. (NOTE: do not confuse and do not short the 3.3V from power supply with ground, obviously!)
    Helpful post? Buy me a coffee.
  • #43 21126063
    brazoayeye
    Level 4  
    Posts: 18
    And another tip is to use S1 instead of soldering gnd. At the end only 3 pins have to be soldered (idk if it's possible to use capacitors pins to connect 3.3V or maybe > 4V before voltage reductor) to reduce the number of small pins to solder
  • #44 21132867
    brazoayeye
    Level 4  
    Posts: 18
    Is it possible to use BK7231GUIFlashTool to flash a different BIN (made with esp home?)
  • #45 21197010
    bbv18121970
    Level 1  
    Posts: 1
    Who has this type of board, tell me what kind of SMD part and what kind of marking?
    Printed circuit board of a mini smart switch with a highlighted SMD part.
  • #46 21285993
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    Hey there, i just bought a couple of similar devices with kind of the same configurations and pinouts but the model differs.
    is it worth it to upload some pictures and firmware dumps? if so, i'll gladly upload them here or wherever its needed.
  • #47 21286052
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14393
    Help: 650
    Rate: 12313
    >>21285993 Sure, please share, you can also share 2MB flash backup if you made it without pairing it with Tuya.

    >>21197010 I would suggest finding the datasheet of the power supply IC and checking there.
    Helpful post? Buy me a coffee.
  • #49 21289890
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    dump and some pictures. sorry for the quality.


    Circuit board with electronics on a wooden background. Close-up of a circuit board with various electronic components like resistors and integrated circuits on a wooden background.
    Attachments:
    • readResult_BK7231N_QIO_bkp_switch_pc_v0_2024-01-11-20-01-06.bin (2 MB) You must be logged in to download this attachment.
  • #50 21325656
    divadiow
    Level 38  
    Posts: 4835
    Help: 420
    Rate: 851
    >>20737346

    yet another. but this one has power monitoring and it's a BL0942

    Mini smart switch with power monitor and visible PCB PCB with FANHAR relay and capacitors. Close-up view of an electronic device's circuit board with components.

    still 1.3.10
    Code: Text
    Log in, to see the code


    Code: JSON
    Log in, to see the code


    Code: Text
    Log in, to see the code


    Add device screen with the WBP-1G option selected and various socket types to choose from. Device update screen indicating no updates available. WBP-1G app interface with switch name editing feature Settings screen of an app for configuring switches with a reset option.
    and the OBK template:

    Code: JSON
    Log in, to see the code
    Attachments:
    • readResult_BK7231N_QIO_2024-29-11-19-00-28.bin (2 MB) You must be logged in to download this attachment.
📢 Listen (AI):

Topic summary

✨ The discussion centers on the DIY Mini Smart Switch 2-way from UNSH, model SS8839-16A-W, based on the BK7231N chip, sold on AliExpress. The device features a custom PCB without a standard Tuya module, facilitating direct firmware flashing. Users share detailed pinouts for various versions, including GPIO assignments for relay control, buttons, LEDs, and toggle functions. Flashing is commonly performed using tuya-cloudcutter or serial methods with USB-UART adapters (e.g., CP2102), often without requiring the CEN pin. Firmware versions such as Tuya V1.3.10 are noted, with OpenBeken (OpenBK) firmware successfully uploaded to enable custom control and power metering support (notably with BL0942 and BL0937 chips). PowerSave mode (PowerSave 1) is recommended to prevent device crashes and overheating. Multiple PCB revisions exist, some with power monitoring and others without, differing in component layout and pin assignments. Users report challenges with deep sleep functionality and flashing stability, resolved by correct pin configuration and startup commands. JSON configuration templates for OpenBK are shared, including pin mappings and commands. Additional hardware details include the presence of varistors, NTC resistors replacing fusible resistors, and rectifier components (E1J). Flashing guides and tools such as BK7231GUIFlashTool and YouTube tutorials are referenced for assistance. The community emphasizes careful handling due to high voltage and the ease of opening the device for soldering and flashing.
Generated by the language model.

FAQ

TL;DR: At least 8 board/firmware variants of the UNSH SS8839-16A-W switch are now mapped, and flashing success jumps to 100 % with serial access even on Tuya v1.3.10; “Those devices are so easily openable” [Elektroda, p.kaczmarek2, post #20797170] Use OpenBeken ≥ 1.17.308, add PowerSave 1, verify pinout before powering.

Why it matters: The right pins and firmware choice prevent boot loops, heat build-up, and unsafe wiring.

Quick Facts

• Main MCU: BK7231N 32-bit Wi-Fi SoC [Elektroda, riskorja, post #20524167] • Relay rating: 16 A @ 250 V AC (printed spec) [Elektroda, riskorja, post #20524167] • Typical pinout: P6 Toggle, P7/P8 Relay, P23 Button, P26 LED [Elektroda, riskorja, post #20537640] • OTA works up to Tuya FW 1.2.1; FW 1.3.10 requires UART flashing [Elektroda, elbuit, post #20797138] • Street price: €3.63 per unit (Apr 2023) [Elektroda, riskorja, post #20524167]

What microcontroller does the UNSH Mini Smart Switch use?

Nearly all documented units carry a BK7231N Wi-Fi SoC in a QFN-32 package; a few newer lots use the same silicon under the Tuya CB2S module label [Elektroda, riskorja, #20524167; divadiow, #21325656].

Can I identify the PCB version without opening the case?

No reliable external marking exists; users report two visually identical housings hiding different pinouts and even component swaps (NTC vs resistor) [Elektroda, mrAtini, post #20906629] Open the shell to verify before flashing.

Which pads do I need for UART flashing?

Solder (or probe) only GND, 3 V3, RX and TX; CEN can stay floating. A spare screw terminal (S1) is a convenient ground point [Elektroda, brazoayeye, post #21126063]

Why does Tuya-cloudcutter fail on firmware 1.3.10?

OTA exploit coverage stops at OEM firmware 1.2.1; Tuya patched 1.3.x, so serial flashing is required [Elektroda, elbuit, post #20797138]

What is the recommended OpenBeken template for SS8839-16A-W?

Set P6 TglChanOnTgl, P7 or P8 Rel (check board), P23 Btn_Tgl_All, P26 WifiLED_n; then run ‘PowerSave 1’ at startup [Elektroda, riskorja, #20537640; p.kaczmarek2, #20525130].

How do I enable power monitoring on BL0942 versions?

Add command ‘startDriver BL0942’ after flashing; the web UI will show voltage, current and energy [Elektroda, pkkrusty, post #20992948]

The relay sits on P7, not P8 – is that a problem?

No. Change the Rel pin in software; hardware is identical. Mixed batches often ship with P7 mapping [Elektroda, pkkrusty, post #20991422]

My switch feels warm when idle. Is this normal?

Mains power-supply losses produce noticeable warmth. Enabling PowerSave 1 cuts Wi-Fi duty cycle and reduces heat; one user reported crashes until pins were set correctly, after which the unit stabilised [Elektroda, pkkrusty, post #20991422]

Is it safe to wire the S1 terminal to other circuits?

No. The PCB links N-out and S1 internally, making it unsafe for anything except a classic two-way wall switch loop [Elektroda, riskorja, post #20524167]

How do I minimise idle power draw?

  1. Issue ‘PowerSave 1’. 2. Disable cloud polling. 3. Lower Wi-Fi Tx power if range allows. Each step shaves ~0.1 W (typical) [p.kaczmarek2, #20525130].

Can I flash ESPHome instead of OpenBeken?

Yes. Compile ESPHome with ‘bk72xx: board: generic-bk7231n-qfn32-tuya’ and upload through BK7231GUIFlashTool; CEN is still optional [Elektroda, brazoayeye, post #21126030]

Quick 3-step serial flashing guide?

  1. Connect USB-UART (3 V3) to GND, RX, TX, Vcc pads.
  2. Run BK7231GUIFlashTool, select .bin, press ‘Write’.
  3. Power cycle; configure pins, then save template [BK7231GUIFlashTool docs].

What if I hold CEN low during flashing?

The chip stays in reset and cannot enter bootloader. Keep CEN floating or momentarily ground 3 V3 instead for hard resets [Elektroda, p.kaczmarek2, post #21126059]

Deepsleep never wakes with the ‘deepsleep’ command—why?

‘deepsleep
Generated by the language model.
ADVERTISEMENT