Elektroda.com
Elektroda.com
X

[BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)

nkuehnel86 3306 13
  • Hi Community,
    I would like to contribute my teardown to a power plug with energy monitoring.
    The power plug is from ANTELA and is called "ANTELA Smart Plug Model: F1s202-EU".
    I bought it on Amazon Germany Link.
    The Tuya module WB2S is used for this power plug, which is based on the BK7231T. The energy monitory IC is the known BL0937.

    The flashing was pretty easy since I could use "bk_writer1.60.exe" to get a backup of the original firmware and the same program to flash the firmware. Before writing the firmware "OpenBK7231T_UA_1.15.52.bin" I needed to erase the original one.

    But before flashing we need to open the device, which is to be hones not very easy and will not happen without any damage on the housing.
    With two small screwdrivers between the inlet and the housing we can manage this. Connect 3,3V, GND, TX1 and RX1 (see pictures) with your UART device of trust.

    [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)

    Ones we flashed it, use the following config:
    [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)

    In short:

    Brand: ANTELA
    Module: WB2S
    MCU: BK7231T
    Power monitoring IC: BL0937

    PWM4 = P24 = BL0937 SEL
    PWM1 = P7 = BL0937 CF
    PWM2 = P8 = BL0937 CF1
    RX = P10 = Button
    PWM5 = P26 = Relay
    PWM0 = P6 = LED (negated)

    @p.kaczmarek2, maybe you could add this to the database.

    Here some picture to compare and verify:

    [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)
    [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937) [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937) [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937) [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937) [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)

    Cool? Ranking DIY
    About Author
    nkuehnel86
    Level 3  
    Offline 
    nkuehnel86 wrote 5 posts with rating 6. Been with us since 2022 year.
  • #2
    Rysiek.K
    Level 14  
    Hello
    You got me interested in the article, but you didn't write the most important thing - What did you get or want to get by this flashing.
    - unless I didn't drink coffee today and I can't see with my eyes :-)
  • #3
    robig
    Level 21  
    Freeing yourself from the manufacturer's cloud, using e.g. Home Assistant or another system.
  • #4
    p.kaczmarek2
    Moderator Smart Home
    In fact, you don't even need a Home Assistant. OpenBeken can be scripted so that it is able to send GET requests between devices and operate based on simple events or timers (as well as triggering events, e.g. as a result of current or voltage measurement), as well as using compatibility with Tasmota Device Groups to combine OpenBeken and Tasmota devices into groups that more or less work together. Or use the Tasmota Control application (also works without HA and also with OpenBeken).

    But the fact, in general, HA is also very useful.
  • #5
    robig
    Level 21  
    And that is why I always read your studies with great interest ?
    p.kaczmarek2 wrote:
    In fact, you don't even need a Home Assistant. OpenBeken can be scripted so that it is able to send GET requests between devices and operate based on simple events or timers (as well as events can be triggered, e.g. as a result of current or voltage measurement), as well as compatibility with Tasmota Device Groups to combine OpenBeken and Tasmota devices into groups that more or less work together. Or use the Tasmota Control application (also works without HA and also with OpenBeken).

    But the fact, in general, HA is also very useful.
  • #6
    Tilator
    Level 6  
    Hello,

    Denver SHP-102 seems to be the same device.

    Can be flashed using Cloudcutter. Package is simply glued, but no need to open it.

    Configuration:

    P6 (PWM0) LED 0
    P7 (PWM1) BL0937CF
    P8 (PWM2) BL0937CF1
    P9 (PWM3)
    P10 (RXD1) LED_n 0
    P11 (TXD1) Btn 0 0
    P24 (PWM4) BL0937
    P26 (PWM5) REL 0
  • #7
    p.kaczmarek2
    Moderator Smart Home
    @Tilator thanks, is Denver SHP-102 BK7231T or BK7231N?
    [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)
    [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)
  • #8
    Tilator
    Level 6  
    [BK7231T - WB2S] ANTELA WiFi power plug with energy monitoring (BL0937)
    p.kaczmarek2 wrote:
    @Tilator thanks, is Denver SHP-102 BK7231T or BK7231N?


    It's BK7231T as well as the Antela.

    Seems to have same WB2S board.
  • #9
    lechndo
    Level 2  
    Hi community

    First of all, special thanks @nkuehnel86 for the tear-down.

    I recently bought some of these smart plugs and wanted to try out OpenBeken, because it looks quite nice.
    So I started by opening the device and attaching my USB serial converter and the external supply - after finding out that the USB converter wasn't powerful enough ;-)

    I'm running Ubuntu on my machine, so I wanted to use the Python tools from OpenBekenIOT HID downloader... I have the "current" master head commit "61c07f19048f16af1bb4da26afe6822e25a576b9"

    I then tried to get a backup of the original firmware and could get it to work. I started the following command line and gave the module a reset via the CEN test point:

    ./uartprogram -d /dev/ttyUSB1 -r -s 0x11000 -l 0x200000 /tmp/tuya_smartPlug_F1s202-EU_backup.bin


    The relay startet to click a few times and also the LEDs were blinking but the download failed - giving the following output:

    UartDownloader....
    Read Getting Bus...
    Cannot get bus.
    Traceback (most recent call last):
      File "/home/nick/projects/hid_download_py/./uartprogram", line 56, in <module>
        downloader.read(args.filename, args.startaddr, args.length)
      File "/home/nick/projects/hid_download_py/bkutils/uart_downloader.py", line 83, in read
        self.pbar.close()
    AttributeError: 'NoneType' object has no attribute 'close'
    


    Please also find attached a video about the process...

    I also tried to use different baudrate settings, start addresses and sizes, without any changes.

    Does anyone have an idea what's wrong?

    Thank in advance for any help and ideas...



  • #10
    p.kaczmarek2
    Moderator Smart Home
    Have you tried the second method, doing power cycle by disconnecting 3.3V from device (maybe connecting it to GND from device side) and reconnecting it?

    Where do you get 3.3V from, can it supply enough current?

    Your wires are very long, that may cause interference.

    What kind of plug is that? Does it have a BL0942 on UART lines?
  • #11
    lechndo
    Level 2  
    Thank @p.kaczmarek2 for your thoughts.

    Seem I finally got it to work.
    At least I was able to properly connect and read a backup of 1150976 bytes (0x119000) and a CRC of 0x1e9b0464
    followed by one failed and finally a successful flashing attempt of OpenBK7231T_UA_1.17.54.bin

    I also configured everything as mentioned in the tear-down... and it seems to work.
    I will do a few quick test to check the power measures... but so far I'm quite happy with the results :-)

    It turned out that I had more than a single problem...
    • Another application (Cura) was running on my PC, accessed every new USB adapter and sent data over it in certain intervals
    • My USB UART adapter seems to be crap... I tried a different model which I often use at work... and TADA... it worked
    • I had to use a slower baudrate.


    I also connected the CEN test point of the WB2S to the RTS signal of my UART adapter.

    So I just can say... Lots of thank to all of you guys, spending your time with this...
  • #12
    p.kaczmarek2
    Moderator Smart Home
    I know this issue. Cura also suprised me with it few years ago. It just takes over COM port without any reason and blocks any other applications from using it.

    Good job on flashing the plug, don't forget to calibrate it.
  • #13
    lechndo
    Level 2  
    Thanks @p.kaczmarek2 for the hint about calibration.
    Already thought the measures were a bit off, but are now ok after calibration.
  • #14
    p.kaczmarek2
    Moderator Smart Home
    Calibration can be done through Web App -> Tools, or in a classic way, like in Tasmota, VoltageSet, etc commands.