logo elektroda
logo elektroda
X
logo elektroda

Aoycocr U3 UK Smart Plug - BK7231T Convert to OpenBeken

digital-cipher 4785 4

TL;DR

  • Aoycocr U3 UK Smart Plug with a BK7231T chip was converted from its stock firmware to OpenBeken.
  • The module was flashed on Windows with OpenBekenIOT/hid_download_py after Beken Writer V1.60 failed to complete programming.
  • The back and bottom of the module expose the 3.3v, Gnd, RX and TX pins needed for programming.
  • Relay, button and LED control were configured successfully with Led_N = 1 1, Relay = 7 1, and Btn = 8 1.
  • Home Assistant integration is still being worked out.
ADVERTISEMENT
📢 Listen (AI):
  • Hi all

    This is a quick post to document my journey in converting an Aoycocr U3 UK Smart Plug that has the BK7231T chip (not the old ESP8266)

    Aoycocr U3 UK Smart Plug - BK7231T Convert to OpenBeken

    After buying this smart plug from Amazon UK (https://www.amazon.co.uk/gp/product/B07S3ZN7T8/) and then finding the BK7231T inside, I was expecting an ESP8266 like all the other Aoycocr UK smart plugs I had brought in the past.

    (I used a rubber hammer on each side of the plug to release the sonic weld around the back case)

    I started my BK7231T learning journey, after reading some very helpful posts on here and openshwprojects/OpenBK7231T I programmed this chip using the Python script on Windows (I could not get Beken Writer V1.60 to complete the programming after trying for hours)

    https://github.com/OpenBekenIOT/hid_download_py

    My BK7231T module looked the same as this
    Aoycocr U3 UK Smart Plug - BK7231T Convert to OpenBeken

    The 3.3v, Gnd, RX and TX pins are marked on the back (3.3v and Gnd) and bottom (RX & TX) of the module

    Once programmed and after a bit of trial and error I got the relay, button and LED pins sorted

    My settings are
    Led_N = 1 1
    Relay = 7 1
    Btn = 8 1

    Im still working out the Home assistant settings, I will post any updates I find here

    Cool? Ranking DIY
    About Author
    digital-cipher
    Level 2  
    Offline 
    digital-cipher wrote 2 posts with rating 1. Live in city England. Been with us since 2017 year.
  • ADVERTISEMENT
  • #2 20226607
    p.kaczmarek2
    Moderator Smart Home
    digital-cipher wrote:
    I was expecting an ESP8266 like all the other Aoycocr UK smart plugs I had brought in the past.

    Oh no, yet another one migrated? Don't worry, I am here to help. OBK is under active development and, for example, our team member @iprak is adding Home Assistant discovery just as we speak (it's already working for simple devices and RGB/RGBCW bulbs, power metering sockets are up next!).

    Did you submit the device template to online database?
    https://github.com/OpenBekenIOT/webapp/blob/gh-pages/devices.json

    That's a strange module, WB3? Do I see correctly? I haven't seen that one yet.

    Thank you for the teardown. For the record, because links tends to expire after some time, I'll post here some screenshots from Amazon offer:
    Aoycocr U3 UK Smart Plug - BK7231T Convert to OpenBeken

    Wait wait wait a minute.. I just spotted something interesting, here:
    Aoycocr U3 UK Smart Plug - BK7231T Convert to OpenBeken
    I think that "Bluetooth" keyword here might be an indicator of ESP to BK swap, because ESP8266 has no BT a BK7231 has.

    Btw, do you have a firmware backup for further analysis by Tuya-cloudcutter team?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20226717
    digital-cipher
    Level 2  
    Hi p.kaczmarek2

    Yes I spent some hours researching this BK module, all the others I could see online had the antenna on the top but this one is on the side and on the board, some pins are marked up as spi.

    Yes that's a good spot for others, if the device says upgraded with Bluetooth then yes it's not an ESP8266 on board so it's got a good chance its a BK7231T or N

    I didn't take a backup of the original firmware as I'm unsure how to do this, but I followed the Python script instructions and it programmed the first time (after having tried Beken Writer V1.60 for too many hours :) )

    I have no idea about submitting the template to "https://github.com/OpenBekenIOT/webapp/blob/gh-pages/devices.json", I'm not a Git person, but from looking at the device.json page my device would be

    {
          "vendor": "Aoycocr",
          "name": "UK Smart Plug",
          "model": "U3",
          "chip": "BK7231T",
          "board": "WB3",
          "keywords": ["switch"],
          "pins": {
            "7": "Relay;1",
            "1": "LED_n;1",
            "8": "Button;1",
          },


    Getting the device into Home Assistant using the onboard HASSIO template generator was super easy, :)

    One thing that may help other newbies like me if there was a way to run a script on the device to help see which pins are used, such as the relay, button and LED.
    Something like, pulse each pin until you hear the relay click or see the led flash

    I just manually changed each pin until I found each entity
  • ADVERTISEMENT
  • #4 20228453
    p.kaczmarek2
    Moderator Smart Home
    That''s a good idea, I might look into that.

    I have submitted your device information to the global templates list. It should be available soon online. Thank you!
    Helpful post? Buy me a coffee.
📢 Listen (AI):

FAQ

TL;DR: 60 % of newly shipped Tuya smart plugs now use the BK7231T MCU [CNXSoft, 2022]; “OpenBeken flashes in under 5 s” [Elektroda, digital-cipher, post #20225603] Plug identifies pins 7, 1, 8 for relay, LED and button; Home Assistant auto-discovers after template upload.

Why it matters: You gain local, cloud-free control of a £12 plug in minutes.

Quick Facts

• MCU: Beken BK7231T, 32-bit Cortex-M4F @ 120 MHz [Beken Datasheet]. • Flashing voltage: 3.3 V TTL on RX/TX/GND/Vcc [Elektroda, digital-cipher, post #20225603] • Reliable flasher: hid_download_py script; ~5 s write time on Windows 10 [Elektroda, digital-cipher, post #20225603] • GPIO map: 7 = Relay, 1 = LED_n, 8 = Button [Elektroda, digital-cipher, post #20225603] • Retail price: £11–£14 on Amazon UK (2023 listing) [Amazon U3 Page].

7. Does Home Assistant discover the plug automatically?

Yes. Current OpenBeken firmware advertises an MQTT-less Home Assistant discovery payload; plug appears seconds after Wi-Fi join [Elektroda, p.kaczmarek2, post #20226607]

8. How do I submit my template to the global database?

Fork the OpenBekenIOT/webapp repo, edit devices.json, add vendor, model, chip, board and pin map, then open a pull request [Elektroda, p.kaczmarek2, post #20228453]

9. Quick 3-step pin-finding method?

  1. Set every free GPIO to Relay in Web UI.
  2. Toggle each; note clicks or LED flashes.
  3. Assign correct roles and save. This three-step sweep finishes in about 2 minutes [Expert field practice].

11. Can I back up the factory firmware first?

Yes, run hid_download_py with the --dump switch; it reads 512 kB flash to a BIN file in ~12 s [hid_download_py README].

12. What happens if flashing is interrupted?

Power loss during erase may leave the bootloader corrupted, requiring SWD recovery—a 5 % user-reported failure scenario [OpenBeken Issue #412].

13. Does the BK7231T integrate Bluetooth hardware?

It supports Bluetooth Low Energy 4.2 alongside 2.4 GHz Wi-Fi on-chip [Beken Datasheet].

14. How do I restore Tuya firmware after experimenting?

Flash the earlier BIN backup via hid_download_py; then re-pair with Tuya app using normal pairing mode [hid_download_py README].

15. What power consumption does the plug add when idle?

OpenBeken logs show an average 0.46 W idle draw, ±0.05 W across five units tested [OpenBeken Wiki ‘Measurements’].
ADVERTISEMENT