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  23 7386 Cool? (+8)
📢 Listen (AI):

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".
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"
}

About Author
knust wrote 2 posts with rating 8 . Been with us since 2023 year.

Comments

p.kaczmarek2 17 Aug 2023 19:40

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. [Read more]

knust 17 Aug 2023 19:45

I got it from AliExpress for ~4 Euro. My listing does not exist anymore, but just search for "Tuya Smart Micro USB Adapter Switch". [Read more]

honorjlh 29 Aug 2023 16:43

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? [Read more]

p.kaczmarek2 29 Aug 2023 17:10

How did you "flash" this device? The process must have failed. [Read more]

honorjlh 30 Aug 2023 10:58

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... [Read more]

p.kaczmarek2 30 Aug 2023 11:29

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... [Read more]

anthonythomas 30 Aug 2023 19:49

I've just received one of these. I'll try to flash it soon. [Read more]

anthonythomas 31 Aug 2023 19:26

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... [Read more]

p.kaczmarek2 31 Aug 2023 20:41

Can you please copy here the crash stack trace so I can fix the tracer? [Read more]

anthonythomas 03 Sep 2023 23:38

I can't find any log. Where should it be located? [Read more]

p.kaczmarek2 04 Sep 2023 08:40

OpenBeken log can be viewed by going to: Launch Web Application -> Logs [Read more]

CrewMdk 19 Nov 2023 20:40

The TP3 pin is CEN so you can reset and flash. [Read more]

banid0 09 Jul 2024 22:44

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... [Read more]

p.kaczmarek2 09 Jul 2024 23:15

As far as I know, this is a patched version. You need to solder wires. [Read more]

banid0 10 Jul 2024 00:05

I always get the same answer...it's my destiny :D At least I managed to open the device already, yupee! [Read more]

p.kaczmarek2 11 Jul 2024 09:40

So how your version looks like? Is it the same as the one in the first post? [Read more]

banid0 24 Jul 2024 09:23

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... [Read more]

banid0 06 Aug 2024 23:05

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... [Read more]

divadiow 07 Aug 2024 13:19

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... [Read more]

FAQ

TL;DR: At 2.99 USD to ~4 Euro, this BK7231N USB relay is a low-cost OpenBeken target, and one user said it "works like a charm" after UART flashing. This FAQ helps modders open the glued case, identify TP4/TP5 and TP3, avoid false-success flashes, and apply the posted OpenBeken pin map for Home Assistant use. [#21333477]

Why it matters: This thread turns a cheap Tuya USB adapter into a documented, repeatable BK7231N flashing case with real failure reports and working recovery tips.

Method / Tool Result reported in thread Key limitation
BK7231 Easy UART Flasher 1.0.6 Worked for at least one successful flash Needed several reconnect and power attempts
BK7231 Easy UART Flasher 1.1.1 Crashed for one user No crash log was posted
BekenWriter V1.60 Mixed results One user saw write success but verify failure
Tuya Cloudcutter Not supported on firmware 1.3.10 Patched firmware requires wired flashing

Key insight: The most reliable path in this thread is wired UART flashing on a BK7231N, using TP5 as RX and TP4 as TX. If flashing seems to succeed but Tuya still boots, erase and boot-mode handling were the likely weak points. [#20697534]

Quick Facts

  • Approximate purchase price was ~4 Euro in 2023, and another buyer later paid 2.99 USD, confirming this is a budget USB smart relay rather than a premium adapter. [#20697555]
  • The posted device identity lists Tuya, model HC-S050-WIFI, chip BK7231N, and keywords 5V and MOSFET, which matches a low-voltage USB power-switch design. [#20697534]
  • The original firmware reported by one successful flasher was 1.3.10, and that version was explicitly described in-thread as not exploitable via Cloudcutter. [#20716571]
  • One user reported standby current improvement from 0.04 mA to 0.01 mA after enabling PowerSave 1, a claimed reduction for idle use. [#21645634]

How do I open the Tuya USB Smart Adapter HC-S050-WIFI or HC-S5050-WIFI case without damaging the cover?

Open it by applying gentle force around the case edge and lifting the glued cover carefully. One user said the cover is glued but comes off without damage, while another opened it by prying the lid around the perimeter. Reassembly needs care, because the inner module can slide out when you plug in a USB device if you do not reglue the cover. [#20716571]

Which UART pads are RX and TX on the BK7231N-based Tuya USB Smart Adapter, and how should they be connected for flashing?

TP5 is RX and TP4 is TX for UART flashing on this board. Connect your USB-UART adapter to those pads, then use the matching TX/RX cross-connection required by your flasher setup. The original teardown explicitly names TP5 as RX and TP4 as TX for the BK7231N-based HC-S050-WIFI. [#20697534]

Where can I find the CEN pin on the HC-S050-WIFI board, and do I actually need CEN to put the BK7231N into download mode?

TP3 is the CEN pad on this board, but you do not always need it. A later reply identified TP3 as CEN, while another user said you can often reach the same flashing state by interrupting power on a USB-powered device. If you already have stable UART access, power-cycling can replace CEN handling for many attempts. [#20823382]

Why would a BK7231N device appear to flash successfully but then boot the original Tuya firmware again after a power cycle?

A false-success flash usually means the write process failed, the wrong image or platform was chosen, or old firmware remained in another partition. One reply said original firmware should not simply “come back,” except a rare case where something in the OTA partition might restore Tuya after boot. The same troubleshooting reply asked whether the user picked BK7231N instead of BK7231T and whether a 2MB flash backup existed. [#20714328]

What is the correct OpenBeken pin configuration for the Tuya USB Smart Adapter HC-S050-WIFI, including the LED, relay, and button pins?

The posted OpenBeken map is GPIO6 for WifiLED_n;0, GPIO7 for Rel;1, GPIO8 for Btn_Tgl_All;0, and GPIO24 for Btn;1. That JSON was shared directly with the teardown, so it is the thread’s reference configuration for LED, relay, and buttons on the HC-S050-WIFI. [#20697534]

BekenWriter V1.60 vs BK7231 Easy UART Flasher: which one works better for flashing this Tuya BK7231N USB adapter?

BK7231 Easy UART Flasher 1.0.6 produced the clearest success report in this thread. One user said version 1.1.1 kept crashing, then version 1.0.6 worked after several disconnect and power-on attempts. BekenWriter V1.60 gave mixed results elsewhere, including a write that later failed verification. [#20716571]

How can I tell whether my BK7231 chip is BK7231N or BK7231T before choosing the firmware image?

You confirm it by identifying the chip or board first, then choosing the matching platform image. The board shown in this thread was identified as BK7231N, and a troubleshooting reply specifically warned to verify whether the target was N or T before flashing. Choosing the wrong platform can leave the device non-booting after erase. [#20714328]

What is CEN on a BK7231N board, and what role does it play during reset and flashing?

"CEN" is a chip-enable control pin that resets or re-enables the BK7231N, letting you force a fresh boot state for flashing or recovery. In this thread, TP3 was identified as CEN, and it was mentioned as useful for reset and flash entry. On USB-powered boards, users also substituted a physical power-cycle when CEN access was inconvenient. [#20823382]

What is the OTA partition in Tuya or OpenBeken firmware, and could it affect reflashing behavior?

"OTA partition" is a flash-memory area that stores update data for over-the-air firmware replacement, separate from the main running image. One expert reply suggested that, in a strange edge case, leftover data there might make a device appear to return to Tuya firmware after flashing. The same reply treated that as unusual, not normal behavior. [#20714328]

Why does flasher version 1.1.1 crash on some BK7231N devices while version 1.0.6 works?

The thread does not give a root cause, but it documents the failure pattern clearly: flasher 1.1.1 crashed for one user, while 1.0.6 worked on the same adapter. The developer asked for the crash stack trace so the tracer could be fixed, which shows the issue was treated as a software-side crash report rather than a proven hardware fault. [#20716655]

How do I capture the UART2 TX2 boot log from a BK7231N device to diagnose why OpenBeken will not start?

Use the TX2 boot output during startup and also check the OpenBeken web log. The troubleshooting reply explicitly asked for the UART2, or TX2, log to see where firmware was failing. For the software-side log, the thread says to open Launch Web Application -> Logs in OpenBeken. [#20720644]

Why is Tuya firmware version 1.3.10 on this USB smart adapter not supported by Tuya Cloudcutter, and what are the alternatives?

Firmware 1.3.10 was described here as a patched Tuya build, so Cloudcutter support does not apply. One reply quoted 1.3.10 among patched BK7231N versions and concluded that this device needs soldered wires. In practice, the alternative used successfully in-thread was wired UART flashing with BK7231 tools. [#21149173]

What is the right procedure to flash this Tuya USB relay with ESPHome after opening the device?

This thread does not provide an ESPHome-specific flashing procedure. It documents a UART path instead: 1. open the case, 2. connect TP5 as RX and TP4 as TX, 3. flash the BK7231N over UART with compatible BK7231 tools. If you want ESPHome later, this thread only supports the wired flashing stage, not an ESPHome build recipe. [#20697534]

How can I safely power-cycle a USB-powered BK7231N device during flashing if I do not have access to the CEN pad?

Safely interrupt the device’s USB power instead of using CEN directly. One reply recommended simply plugging the USB cable in or toggling power on the USB port feeding the board. That approach was suggested specifically for USB-powered devices when the CEN pad is hard to reach. [#21183079]

Which OpenBeken startup commands are useful on this USB Smart Adapter for features like SafeMode and PowerSave, and what do they do?

The thread shows two practical startup ideas: addEventHandler OnHold 24 SafeMode 5 or addEventHandler OnHold 8 SafeMode 5, plus PowerSave 1. The first adds a long-press recovery path, and the second enables an economy mode. One user reported standby dropping from 0.04 mA to 0.01 mA, and wrote, “I have 4x more efficient in standby.” [#21645634]
%}