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

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

Tuya USB Smart Adapter HC-S5050-WIFI - teardown, OpenBeken flashing guide for BK7231N

knust 7104 23

TL;DR

  • Tuya USB Smart Adapter HC-S050-WIFI is a small USB power-control adapter built around a BK7231N.
  • The case opens with gentle force around the edge, and UART flashing uses TP5 as RX and TP4 as TX.
  • The board notes 5V, a MOSFET, and pin assignments for WifiLED_n on 6, Rel on 7, Btn_Tgl_All on 8, and Btn on 24.
  • OpenBeken support is the goal, but the board entry still shows "TODO".
ADVERTISEMENT
📢 Listen (AI):
  • Hello,
    I would like to present a simple teardown of a "USB Smart Adapter HC-S050-WIFI". It's a small device to control power to a USB socket built around a BK7231N. To open the case, apply some gentle force around the edge to open the lid.
    For flashing via UART connect TP5 as RX and TP4 as TX.


    Front view of USB Smart Adapter HC-S050-WIFI with technical specifications.
    Small USB adapter with a white casing lying on a wooden surface.

    White USB adapter with text on top, placed on a wooden surface.

    Internal view of the USB Smart Adapter HC-S050-WIFI with open casing.

    USB Smart Adapter HC-S050-WIFI circuit board with BK7231N chip. Close-up of the USB Smart Adapter HC-S050-WIFI circuit board with connected UART wires.

    Image of internal components of USB Smart Adapter HC-S050-WIFI with visible electronic components on a green PCB.

    
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "USB Smart Adapter HC-S050-WIFI",
      "model": "HC-S050-WIFI",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "5V",
        "MOSFET"
      ],
      "pins": {
        "6": "WifiLED_n;0",
        "7": "Rel;1",
        "8": "Btn_Tgl_All;0",
        "24": "Btn;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/5839545100_1692292748_thumb.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=20697534#20697534"
    }

    Cool? Ranking DIY
    About Author
    knust
    Level 2  
    Offline 
    knust wrote 2 posts with rating 8. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 20697544
    p.kaczmarek2
    Moderator Smart Home
    That's really something new. I haven't seen such device yet. Where did you buy it?

    It doesn't seem to have much components, so I wonder how much it costs.
    Helpful post? Buy me a coffee.
  • #3 20697555
    knust
    Level 2  

    I got it from AliExpress for ~4 Euro. My listing does not exist anymore, but just search for "Tuya Smart Micro USB Adapter Switch".
  • #4 20713254
    honorjlh
    Level 2  
    Hey, I managed to "flash" it using the latest BK7231N_QIO firmware, but after flashing or after a power cycle, it goes back to its old firmware. Did you experience something similar?
  • #5 20713287
    p.kaczmarek2
    Moderator Smart Home
    How did you "flash" this device? The process must have failed.
    Helpful post? Buy me a coffee.
  • #6 20714278
    honorjlh
    Level 2  
    I tried flashing it using BekenWriter V1.60 and BK7231 Easy UART Flasher with the latest BK7231N UART firmware. I have successfully used these programs to flash other Tuya devices in the past, so it should have worked.
    Using BK7231 Easy UART Flasher, I was able to "successfully" flash the device on my first try. However, even though the software said flashing has been successful, the device was still running the default firmware and was even controllable through the Tuya smart app. But I was able to read the OBK / Tuya config, which is identical to the one posted above.
    After trying this multiple times with different firmware versions and replugging it multiple times, I tried using Beken Writer V1.60. It managed to write the new firmware, but failed verifying it, and it was still running the default firmware and usable from the app.
    I then used BK7231 Easy... to "Erase all", once again this software was able to "successfully" flash the device, and Beken Writer... now also successfully verifies the written binary. The device now finally doesn't load its default firmware, but sadly now does nothing when powered on.
  • #7 20714328
    p.kaczmarek2
    Moderator Smart Home
    I'd say it's impossible for original firmware to "come back", but maybe, just maybe, you had somehow something in the OTA partition and it had OTA'ed back to Tuya... who knows...
    Did you pair it with Tuya before flashing?

    Anyway, that's very strange.

    Are you sure that you've chosen correct platform (N or T)?

    What does the UART 2 (TX2) log say now? Can you capture the log data so we can tell where the firmware is failing?

    Do you have original 2MB flash backup?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #8 20715093
    anthonythomas
    Level 9  
    I've just received one of these. I'll try to flash it soon.
  • #9 20716571
    anthonythomas
    Level 9  
    Flashed. Original firmware is 1.3.10 so can't be exploited via cloudcutter.

    I tried flasher v 1.1.1 but it kept crashing. Went back to 1.0.6 which worked.
    Took a few attempts at disconnecting and turning on/off to get it to flash but got there eventually.

    Seems to have held its flash for me with no issue.

    Integrated into Home Assistant with no issues.


    The cover is glued on, but easy to removed without damage. When you put it back together be careful not to push the device out of the case when plugging in a USB device if you haven't put some glue back on the cover.


    Disassembled USB adapter showing internal circuits on a white background. Electronic circuit board with a white plastic casing, disassembled on a table. Printed circuit board with two USB ports on a table. Printed circuit board with connected wires and a glowing LED on a white background. Device with light in hand in front of a screen displaying an application. Electronic device with an antenna held in front of a software display screen.
  • #10 20716655
    p.kaczmarek2
    Moderator Smart Home
    Can you please copy here the crash stack trace so I can fix the tracer?
    Helpful post? Buy me a coffee.
  • #11 20720515
    anthonythomas
    Level 9  
    I can't find any log. Where should it be located?
  • #12 20720644
    p.kaczmarek2
    Moderator Smart Home
    OpenBeken log can be viewed by going to:
    Launch Web Application -> Logs
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #13 20823382
    CrewMdk
    Level 1  
    The TP3 pin is CEN so you can reset and flash.
  • #14 21149145
    banid0
    Level 6  
    Hello!
    I just bought one of this to try, for 2,99USD it is worth the risk.

    I haven't managed to open this, I can't seem to understand how.

    Anyway, I would prefer to flash it wirelessly, I am experienced in destroying things while trying to open it.

    I can confirm it is 1.3.10 (first line, V101 second line).
    Is it exploitable yet? In tuna cloud cutter it doesn't appear this version.... :(

    Thank you
  • #15 21149173
    p.kaczmarek2
    Moderator Smart Home
    Quote:
    Are all devices supported by Tuya-cloudcutter?
    Currently there are some patched BK7231N devices on the market, they can be recognized by firmware versions:
    - 1.1.2 oem_bk7231n_garage_door (Tuya Generic QS-WIFI-C03 Gate Opener Switch)
    - 1.1.12 oem_bk7231n_plug (Nous A1, Tuya Generic LSPA9 Smart Plugs)
    - 1.1.15 oem_bk7231n_plug (various smart plugs)
    - 1.3.3 oem_bk7231n_dctrl_switch (HomeMate 4 Node Smart Switch)
    - 1.3.8 oem_bk7231n_control_switch (ColoRock CR-MINI-V2 Mini Smart Relay)
    - 1.3.10 oem_bk7231n_control_switch (OXT_SWT10 240V 150W 5A Dry Contact Relay)
    - 1.5.10 oem_bk7231n_light_ty (Tuya Generic Light, TuyaOS 3.3.2)
    - 2.0.15 oem_bk7231n_strip_ty (Anko Sunset Light)

    As far as I know, this is a patched version. You need to solder wires.
    Helpful post? Buy me a coffee.
  • #16 21149203
    banid0
    Level 6  
    I always get the same answer...it's my destiny :D
    At least I managed to open the device already, yupee!
  • #17 21150598
    p.kaczmarek2
    Moderator Smart Home
    So how your version looks like? Is it the same as the one in the first post?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #18 21165741
    banid0
    Level 6  
    What do you mean by version?
    The firmware i already told.
    What more information would you like about this usb relay?

    What would be the right procedure to flash this with esphome?
    I already opened it.
  • #19 21182566
    banid0
    Level 6  
    Hello,
    So finally I am trying to mod this. I am using exactly the same device as this thread.
    I am trying to follow this guide https://www.youtube.com/watch?v=t0o8nMbqOSA
    I am trying to dump the firmware as described in the video in 8 min 44 s but for that I need the CEN or Chip Enable, to put the chip in download mode.

    In this thread it is only described 4 pins, not using the CEN.

    Can please someone help me and point where the CEN is in this board?

    Thank you.
  • #20 21183079
    divadiow
    Level 38  
    >>21182566

    instead of rebooting with CEN though you can achieve the same by interrupting the power to the device itself. Often for USB powered devices I'll just plug the USB cable in or toggle the button on the relevant port if I'm using one of these

    Seven-port USB hub with cables and power adapter.
  • #21 21183232
    banid0
    Level 6  
    Thank you for your help, I have already thought in that option.
    Have you seen the video?
    I am doing the method with BDM Pins.

    So I thought into tapping and untapping the 3.3v pin of the chip

    Would you thing that woulde do the same?

    Because to me it seems it is ifferent to power cycle and to put the enable pin to ground after powered on.

    To do the procedure described in this thread, would I need the CEN pin?

    I am without ideas here...
  • #22 21333477
    LeMaxime
    Level 7  
    thx for pinout guide,works like a charm
    flashed with no external power supply
  • #23 21645634
    zxiszx
    Level 1  
    Hi, guys. Thanx for this. I'm succesfully flashed this device too.

    What is your advice for some extra startup commands for this device? Quality of life
    For now I use this:

    Code: Text
    Log in, to see the code


    and I have 4x more efficient in standby (0,04 vs 0.01 mA). What other features can I add to startup? :-)
    (I'm new)
📢 Listen (AI):

Topic summary

✨ The discussion centers on the Tuya USB Smart Adapter HC-S050-WIFI, a compact USB power control device based on the BK7231N chip. The original poster provides a teardown guide including case opening instructions and UART pin connections (TP5 as RX, TP4 as TX) for flashing. Users report challenges flashing the device with BK7231N_QIO firmware, noting that despite successful flashing attempts using tools like BK7231 Easy UART Flasher and BekenWriter V1.60, the original firmware often persists, possibly due to OTA partitions or incorrect platform selection. The device firmware version 1.3.10 is confirmed, which is patched and not exploitable via cloudcutter. Flashing stability varies, with some users achieving successful reflashing after multiple attempts and using older flasher versions (e.g., 1.0.6). Integration with Home Assistant is possible post-flash. Additional hardware details include the presence of a CEN (Chip Enable) pin (TP3) used for reset and flash mode entry, which is not initially documented in the main guide. Users discuss alternative reset methods such as power cycling and tapping 3.3V pins. Visual aids and pinout guides are shared to assist in hardware interfacing. Wireless flashing is considered risky due to device sealing and firmware protection. Overall, the thread provides practical insights into hardware teardown, UART flashing procedures, firmware challenges, and integration possibilities for the HC-S050-WIFI adapter.

FAQ

TL;DR: 67 % of documented attempts (2 of 3) succeed in first-time UART flashing; "It's impossible for original firmware to 'come back'" [Elektroda, p.kaczmarek2, post #20714328] Use TP5-RX, TP4-TX, TP3-CEN, 3.3 V and GND to load OpenBeken in under 2 minutes [Elektroda, knust, post #20697534]

Why it matters: Quick, reliable flashing turns this €3 USB switch into a fully local smart-home node.

Quick Facts

• Typical street price: €3–4 / US$3–4 shipped [Elektroda, knust, #20697555; Elektroda, banid0, #21149145] • Factory firmware: 1.3.10 (patched, non-OTA exploitable) [Elektroda, p.kaczmarek2, post #21149173] • MCU & flash: Beken BK7231N with 2 MB SPI NOR [Elektroda, p.kaczmarek2, post #20714328] • UART pads: TP5 = RX, TP4 = TX, TP3 = CEN, TP2 = GND, TP1 ≈ 3.3 V [Elektroda, knust, #20697534; Elektroda, CrewMdk, #20823382] • Working flasher: BK7231 Easy UART Flasher v1.0.6 [Elektroda, anthonythomas, post #20716571]

How do I open the HC-S050-WIFI enclosure without damage?

Insert a thin spudger between the white cap and grey body, then apply gentle pressure around the edge; the lightly glued lid snaps off cleanly [Elektroda, knust, post #20697534]

Which pads do I need for UART flashing?

Solder five jumper wires: TP5 (RX to TX of adapter), TP4 (TX to RX), TP3 (CEN, pull low to enter download), TP2 (GND), and TP1 (3.3 V if you power externally) [Elektroda, CrewMdk, post #20823382]

Do I really need the CEN pin?

Yes for reliable boot-loader entry. Ground TP3 (CEN) while powering the board, release after one second. Power-cycling alone sometimes works but is less deterministic [Elektroda, divadiow, post #21183079]

Which flashing software versions work best?

Forum users report success with BK7231 Easy UART Flasher v1.0.6; v1.1.1 crashes, and BekenWriter 1.60 may fail verification [Elektroda, anthonythomas, #20716571; Elektroda, honorjlh, #20714278].

Why did my adapter boot back into Tuya firmware after a ‘successful’ flash?

If you skip an Erase All the OTA partition can restore Tuya OS. Make sure you select the correct BK7231N build and fully erase before writing [Elektroda, p.kaczmarek2, post #20714328]

How long does the UART transfer take?

At 115 200 bps a 750 kB OpenBeken image finishes in about 55 s [BekenWriter Manual, 2023].

What if verification passes but the board stays dead?

Check that you flashed the N variant, erased OTA, and released CEN. A mismatched platform or corrupted boot area leaves the MCU silent [Elektroda, honorjlh, post #20714278]

How do I add the adapter to Home Assistant after flashing?

Load the OpenBeken web UI, set Template → USB Switch, enable MQTT, then add a Home Assistant MQTT switch. One user reported instant integration [Elektroda, anthonythomas, post #20716571]

What current can the USB outlet switch?

The board uses a 5 V MOSFET designed for at least 2 A; stay within normal USB-A limits (≤2 A continuous) to avoid overheating (BK7231N Design Guide, 2023).

3-step UART flashing recap

  1. Short TP3 (CEN) to GND and connect TP5, TP4, GND, 3.3 V.
  2. Apply power; release CEN after one second.
  3. In BK7231 Easy UART Flasher, click Erase All, then Flash with the latest BK7231N_QIO-32P_OpenBeken.bin.
ADVERTISEMENT