Flash Generic $2 Smart Plug

I’ve been on the hunt for some additonal smart plugs, and recently I’ve been seeing some extremely cheap ones from AliExpress for $2, so I bought one to see if it’s able to be reflashed with ESPHome or OpenBeken. Following the instructions in the box I’m directed to download the eWelink app, which I’m not interested in using, but I will use only briefly to ensure the device is working before I flash it.

Fresh from the packaging
Bottom side and package info
Cover removed

With some gentle prying, I separated the outer case from the bottom, exposing the PCB. Instead of finding an ESP8266 or one of the many Tuya chips, I found a BL602L20. While I’ve never seen one in person, I know they are another common non-ESP8266 chip used in inexpensive WiFi “smart” devices. ESPHome doesn’t seem to officially support the BL602 just yet, but OpenBeken does, so I’ll be using that for this project.

Front of SM-028_V1.3 (BL602L20)
Back of SM-028_V1.3 (BL602L20)

Wiring and flashing will be generally the same process as a BK7231, but we’ll need a different firmware file and a different tool to flash it. I’ll be using the blflash tool to flash the firmware, and I’ll be using the OpenBK7231T_App firmware file. For the UART, I’ll be using my trusty Tigard FTDI adapter.

Wiring:

1
2
3
4
5
SM-028_V1.3  RX  ->  UART TX
SM-028_V1.3 TX -> UART RX
SM-028_V1.3 3V3 -> UART VCC (on 3V3)
SM-028_V1.3 GND -> UART GND
SM-028_V1.3 BT -> 10Kohm resistor to VCC

Pogo pins on programming pads

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Back up the current firmware
./blflash-macos-amd64 dump generic-smart-plug1.bin --port /dev/cu.usbserial-TG10005e0 --baud-rate 230400
./blflash-macos-amd64 dump generic-smart-plug2.bin --port /dev/cu.usbserial-TG10005e0 --baud-rate 230400
./blflash-macos-amd64 dump generic-smart-plug3.bin --port /dev/cu.usbserial-TG10005e0 --baud-rate 230400

# MD5SUM
md5sum generic-smart-plug*.bin

# All matched, so only keeping one copy
mv generic-smart-plug1.bin generic-smart-plug.bin
rm generic-smart-plug2.bin generic-smart-plug3.bin

# Flash the latest version of OpenBeken for BL602
./blflash-macos-amd64 flash OpenBL602_1.17.451.bin --port /dev/cu.usbserial-TG10005e0 --baud-rate 230400

Configuration

  • Initial boot up, it will create an access point called “OpenBL602_[MAC]”, connect to it
  • Configure your WiFi settings
  • Reboot, and it should join your network
  • Find the IP address of the new device using your router, and connect to it
  • If it works, disconnect the UART and reassemble the device, plug it in to wall power
  • Configure your MQTT settings
  • Configure GPIO and save
    1
    2
    3
    P14 - LED_n, CH 1
    P20 - Btn, CH 1,0
    P21 - Rel, CH 1

If you want to set it up in Home Assistant, you can use the following configuration:

1
2
3
4
5
6
7
8
9
10
11
12
mqtt:
switch:
- unique_id: "OpenBL602_[MAC_ADDRESS]_relay_1"
name: 1
state_topic: "obl[MAC_ADDRESS]/1/get"
command_topic: "obl[MAC_ADDRESS]/1/set"
qos: 1
payload_on: 1
payload_off: 0
retain: true
availability:
- topic: "obl[MAC_ADDRESS]/connected"

And you’re done! It should be available in MQTT. This plug was very easy to flash and configure, and it’s a great value for $2. I expect to be picking up a few more of these in the near future.

Ref: