logo elektroda
logo elektroda
X
logo elektroda

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

knust 6141 21
ADVERTISEMENT
  • 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.
  • ADVERTISEMENT
  • #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?
  • ADVERTISEMENT
  • #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.
  • #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.
  • ADVERTISEMENT
  • #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.
  • #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.
  • #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 34  
    >>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
    darkassassinmax
    Level 3  
    thx for pinout guide,works like a charm
    flashed with no external power supply

Topic summary

The discussion revolves around the Tuya USB Smart Adapter HC-S050-WIFI, which utilizes the BK7231N chip. Users share experiences regarding the device's teardown, flashing process, and firmware issues. The adapter can be opened with gentle force, and flashing is done via UART by connecting TP5 (RX) and TP4 (TX). Several users report difficulties in retaining the new firmware after flashing, with some experiencing the original firmware reverting post-power cycle. Various flashing tools like BekenWriter and BK7231 Easy UART Flasher are mentioned, with mixed results. Users also discuss the possibility of OTA updates restoring the original firmware and share tips on accessing logs and using the CEN pin for flashing. The conversation includes attempts to integrate the device with Home Assistant and inquiries about the device's firmware version and exploitability.
Summary generated by the language model.
ADVERTISEMENT