logo elektroda
logo elektroda
X
logo elektroda

Brazil eWelink Smart Plug (BL0937) with Trolink BL602 SM-028_V1.3 Module - A Quick Look

divadiow 2211 8
ADVERTISEMENT
  • Helpful post
    #1 21143395
    divadiow
    Level 34  
    Hello. Here's a quick look at a Brazilian/South American eWelink smart plug with power monitoring (BL0937) that I bought from Ali Express. I was looking for an SM-039, but instead got a standard SM-028_V1.3. A Bouffalo Labs BL602 module manufactured by Trolink.

    https://www.aliexpress.com/item/1005006023269137.html

    eWelink WiFi Smart Plug 16A with power monitoring feature.

    External and internal pictures:

    Sticker with barcode and Chinese characters on a box. Box of a smart plug with various home appliance icons.

    Interior of eWelink smart plug with relay. Internal view of the eWelink smart plug with electronic components. White smart plug with Brazilian standard on a wooden surface. Brazilian eWelink smart plug with three holes on the front. Packaging of Brazilian eWelink smart plug. Packaging of the eWelink smart plug with power monitoring BL0937. Smart plug eWelink with open casing and wires. Interior of eWelink smart plug with power monitoring Interior of the eWelink smart plug showing electronic components on a circuit board. Interior of a smart plug with visible electronic components on a circuit board. Interior of an eWelink smart plug showing electronic components

    (pics are a bit naff. Might retake)

    eWelink app when paired:

    eWelink app screen showing energy consumption at zero. Screenshot of the device settings in the eWelink app. eWelink app interface displaying a smart plug device view.

    After soldering TX. RX, 3V3 and GND, the boot log captured:

    Code: Text
    Log in, to see the code


    And flashID read by BL DevCube 1.8.9

    Code: Text
    Log in, to see the code


    Following the procedure in Backup and Restore of Factory Firmware on Bouffalo Lab BL602/LF686 IoT Smart Devices to backup the factory fw, I attach the result of that.

    One interesting thing was that I had no issues with power with this BL602. It was fine on factory and OBK at 3.3v and not using particularly short wires. I wonder if the later revision SDK/bootloader has anything to do with that.

    I have also noticed (not recently though) that even if deleting the device from the eWelink app and factory resetting again with the push button, that the resultant firmware backup file still contains credentials for my wifi! I have since joined to a test network and reset again, and so the attached file does contain credentials, but it's just junk. Something to bear in mind for future posts. This isn't usually the behaviour for Beken devices. I have not checked methodically if this is the case for non eWelink BL602s.

    After flashing to OBK I used the GPIO doctor to determine the below. Noting the limited number of GPIOs available on the SM-028_V.1.3 module helps to narrow the possibilities.

    "2": "Rel;0",
    "17": "Btn;0",
    "20": "LED_n;0",


    with that combination known we may not have to guess the 3 BL0937 GPIOs. Searching for "2": "Rel in https://github.com/OpenBekenIOT/webapp/blob/gh-pages/devices.json reveals 1 device that matches GPIOs 2, 17, 20 and has a BL0937 and is a BL602. This whole template does indeed match.

    OpenBL602 application screen with power monitoring details

    and so the template is:
    Code: JSON
    Log in, to see the code


    and PR to add to devicelist https://github.com/OpenBekenIOT/webapp/commit/ae832cd99f02c0495595845dfa297702005b9bf2
  • ADVERTISEMENT
  • #2 21155721
    divadiow
    Level 34  
    OBK boot

    Code: Text
    Log in, to see the code
  • #3 21215189
    eph2
    Level 2  
    Hey there. I bought one of this too, but I can't load the firmware OTA, and can't flash it.

    OTA the problem seems to be with the software, as it loads a page to enter the network credentials, but it always fails. I believe it may be some restriction in the eWeLink firmware (also in version 1.1.1).

    But when I try to flash it via UART, it doesn't complete the handshake.

    From what I've seen, this module doesn't need to have the boot "button" pressed (it's not mentioned in the link above), but I'm not sure if it's necessary to do some other procedure.

    Here are the log from the Bouffalo Lab Dev
    [13:50:24.242] - ========= Interface is Uart =========
    [13:50:24.244] - eflash loader bin is eflash_loader_40m.bin
    [13:50:24.246] - ========= chip flash id: ef4015 =========
    [13:50:24.248] - create partition.bin, pt_new is True
    [13:50:24.254] - fw_boot_head_gen xtal: 40M
    [13:50:24.255] - Create bootheader using C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini
    [13:50:24.256] - Updating data according to <C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [13:50:24.257] - Created file len:176
    [13:50:24.259] - Create efuse using C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini
    [13:50:24.260] - Updating data according to <C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [13:50:24.262] - Created file len:128
    [13:50:24.265] - ========= sp image create =========
    [13:50:24.268] - Image hash is b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
    [13:50:24.268] - Hash ignored
    [13:50:24.268] - Header crc ignored
    [13:50:24.268] - Write flash img
    [13:50:24.271] - Encrypt efuse data
    [13:50:24.273] - fw_boot_head_gen xtal: 40M
    [13:50:24.276] - Create bootheader using C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini
    [13:50:24.276] - Updating data according to <C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [13:50:24.278] - Created file len:176
    [13:50:24.280] - Create efuse using C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini
    [13:50:24.281] - Updating data according to <C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [13:50:24.282] - Created file len:128
    [13:50:24.286] - ========= sp image create =========
    [13:50:24.288] - Image hash is b'83891c0734583b9209e28aeaba717f85657b94747f6c4f2cc1c71e7fd874b4e8'
    [13:50:24.289] - Hash ignored
    [13:50:24.289] - Header crc ignored
    [13:50:24.289] - Write flash img
    [13:50:24.292] - Encrypt efuse data
    [13:50:24.297] - fw_boot_head_gen xtal: 40M
    [13:50:24.298] - Create bootheader using C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini
    [13:50:24.298] - Updating data according to <C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [13:50:24.300] - Created file len:176
    [13:50:24.302] - Create efuse using C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini
    [13:50:24.303] - Updating data according to <C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\img_create_iot\efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [13:50:24.305] - Created file len:128
    [13:50:24.308] - ========= sp image create =========
    [13:50:24.324] - Image hash is b'0f1e4d78452c0a690184f6c87ef01b6e513274829c2cce5dc22d7d2699613428'
    [13:50:24.324] - Header crc: b'1341791f'
    [13:50:24.324] - Write flash img
    [13:50:24.331] - Encrypt efuse data
    [13:50:24.333] - FW Header is 176, 3920 still needed
    [13:50:24.334] - FW OTA bin header is Done. Len is 4096
    [13:50:24.401] - BL60X_OTA_Ver1.0
    [13:50:24.462] - FW OTA bin is Done. Len is 790704
    [13:50:24.817] - OTA XZ file len = 422496
    [13:50:24.818] - Partiton len = 0
    [13:50:24.818] - Warn: fw1 xz bin size is overflow with partition table, don't create ota bin
    [13:50:24.818] - Warning: remove OTA files
    [13:50:24.819] - FW OTA xz is Done
    [13:50:24.820] - ========= eflash loader config =========
    [13:50:24.823] - Image offset = 8192
    [13:50:24.859] - =========C:/Users/User/Downloads/BouffaloLabDevCube-v1.9.0/chips/bl602/device_tree/bl_factory_params_IoTKitA_40M.dts ——> C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602/device_tree/ro_params.dtb=========
    [13:50:24.958] - True
    [13:50:24.961] - Version: eflash_loader_v2.5.1
    [13:50:24.961] - Program Start
    [13:50:24.961] - ========= eflash loader cmd arguments =========
    [13:50:24.961] - Config file: C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\eflash_loader/eflash_loader_cfg.ini
    [13:50:24.962] - serial port is COM3
    [13:50:24.962] - cpu_reset=False
    [13:50:24.962] - chiptype: bl602
    [13:50:24.963] - ========= Interface is uart =========
    [13:50:24.963] - com speed: 115200
    [13:50:24.963] - Eflash load helper file: C:\Users\User\Downloads\BouffaloLabDevCube-v1.9.0\chips\bl602\eflash_loader/eflash_loader_40m.bin
    [13:50:24.964] - ========= load eflash_loader.bin =========
    [13:50:24.964] - Load eflash_loader.bin via uart
    [13:50:24.964] - ========= image load =========
    [13:50:25.335] - Not ack OK
    [13:50:25.336] - FL
    [13:50:25.336] - result: FL
    [13:50:25.640] - tx rx and power off, press the machine!
    [13:50:25.640] - cutoff time is 0.1
    [13:50:25.744] - power on tx and rx
    [13:50:26.556] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [13:50:26.556] - clean buf
    [13:50:26.602] - send sync
    [13:50:26.712] - ack is
    [13:50:26.713] - retry
    [13:50:26.982] - tx rx and power off, press the machine!
    [13:50:26.982] - cutoff time is 0.1
    [13:50:27.085] - power on tx and rx
    [13:50:27.899] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [13:50:27.899] - clean buf
    [13:50:27.945] - send sync
    [13:50:28.057] - ack is
    [13:50:28.057] - retry
    [13:50:28.079] - shake hand fail
    [13:50:28.080] - ########################################################################
    [13:50:28.080] - 请按照以下描述排查问题:
    [13:50:28.080] - GPIO8是否上拉到板子自身的3.3V,而不是外部的3.3V
    [13:50:28.080] - GPIO7(RX)是否连接到USB转串口的TX引脚
    [13:50:28.080] - GPIO16(TX)是否连接到USB转串口的RX引脚
    [13:50:28.080] - 在使用烧录软件进行烧录前,是否在GPIO8拉高的情况下,使用Reset/Chip_En复位了芯片
    [13:50:28.080] - 烧录软件所选择的COM口,是否是连接芯片的串口
    [13:50:28.081] - 烧录软件上选择的波特率是否是USB转串口支持的波特率
    [13:50:28.081] - 3.3V供电是否正常
    [13:50:28.081] - 板子供电电流是否正常(烧录模式下,芯片耗电电流5-7mA)
    [13:50:28.081] - ########################################################################
    [13:50:28.081] - shake hand fail
    [13:50:28.092] - Load helper bin time cost(ms): 3128.458251953125
    [13:50:28.092] - ErrorCode: 0003, ErrorMsg: BFLB LOAD HELP BIN FAIL
    [13:50:28.092] - Burn Retry
    [13:50:28.092] - 0
    [13:50:28.092] - Burn return with retry fail
  • ADVERTISEMENT
  • #4 21215347
    divadiow
    Level 34  
    hi

    airton1 wrote:
    OTA the problem seems to be with the software, as it loads a page to enter the network credentials, but it always fails. I believe it may be some restriction in the eWeLink firmware (also in version 1.1.1).


    not sure what you mean by this. I'm not aware of an OTA exploit for these to go from eWelink factory firmware to OpenBeken. You will have to UART flash to free from the cloud. The OTA exploit for Magic Home BL602 devices mentioned here https://www.elektroda.com/rtvforum/topic4050297.html does not apply to this device.

    This distinction could be made clearer for users who start their journey here and see that option.

    Screenshot of the Introduction section on a page related to OpenBK7231T/OpenBeken.

    airton1 wrote:
    But when I try to flash it via UART, it doesn't complete the handshake.


    handshake failure will be down to the BL602 not being in UART download mode, the cables are not connected correctly or the cables are too long.

    To get into UART download mode the BL602 must have the BT/BOOT/GPIO8 pulled high with a 10k resistor to 3.3v.

    This is demonstrated and detailed:

    https://www.elektroda.com/rtvforum/topic3889041.html
    https://youtu.be/bs0ylC6xRs0?si=JeoRk_48GIZEWxxd

    full factory backup prior to conversion to OBK can be achieved using https://www.elektroda.com/rtvforum/topic4051649.html

    don't forget to use an external 3.3v PSU rather than rely on the USB-TTL adaptor's 3.3v
  • ADVERTISEMENT
  • #5 21215409
    eph2
    Level 2  
    Forget it, my problem was one of the cables that was very poorly soldered to the board.

    I was able to flash it using a CP2102, and without an additional external power supply. Everything worked perfectly.

    By the way, thank you very much for the template settings!
    You guys are awesome!

    Taking advantage of the topic, can the LED be controlled separately from the relay? I have flashed some other devices where the LED was soldered together, so without control. Is it possible to keep it off in this case, even if the relay is on?
  • ADVERTISEMENT
  • #6 21215421
    divadiow
    Level 34  
    airton1 wrote:
    I was able to flash it using a CP2102, and without an additional external power supply.

    cool. that's not often the case

    airton1 wrote:
    can the LED be controlled separately from the relay?

    yes. assign the LED to a different, unused, channel. Or unassign it completely if you don't want any LED use at all
  • #7 21215429
    eph2
    Level 2  
    >>21215421
    divadiow wrote:
    yes. assign the LED to a different, unused, channel. Or unassign it completely if you don't want any LED

    Excellent, it worked! Fantastic!

    I liked this device more than the smart plugs with the BK7231N module, where the relay is connected together with the LED, so I can't control it separately. In fact, there are two LEDs, one for the Wi-Fi and one for the relay, unlike this device which only has one LED.

    Thank you very much again
  • #8 21215434
    divadiow
    Level 34  
    >>21215429 no problem :)
  • #9 21511242
    divadiow
    Level 34  
    in the unlikely event anyone swaps the SM-028 for a WB2S, the pin assignments would then be the following for this device

    Code: Text
    Log in, to see the code

Topic summary

The discussion revolves around the eWelink Smart Plug (BL0937) purchased from AliExpress, which features power monitoring capabilities. The user initially sought the SM-039 model but received the SM-028_V1.3 instead, equipped with a Bouffalo Labs BL602 module from Trolink. Several users shared their experiences with firmware flashing, particularly issues with OTA updates and UART flashing. One user encountered a handshake failure during UART flashing, which was later resolved by fixing a poorly soldered cable. The conversation also covered the ability to control the LED separately from the relay, a feature appreciated in this device compared to others with integrated LED and relay connections.
Summary generated by the language model.
ADVERTISEMENT