Unlike the title suggests, this is not some tale about incredible escapes or fantastic travels from one imaginary place to another but a more down-to-earth procedure of flashing Gosund branded smart-plugs to the open-source Tasmota firmware. The process involves physical device disassembly (warranty voiding), soldering the serial wires onto a tiny board, uploading the binary, configuring the WiFi connectivity, reassembly and meter calibration. It requires basic electrical tools and a USB-serial adapter. With all the ingredients on the table, this can be done in less than 1 hour.
Warning:
Smart-plugs are designed to operate at grid voltage, which is deadly! Make sure you know what you're doing and take your time to understand the steps with their implications before following them.
The subject of today's story is the Gosund EP2, often re-branded, which is based on the ESP8285 micro-controller. It's a very slim and slick design and it incorporates all security features one could think of. However, it is pre-programmed with a proprietary firmware and there's no telling what that may do besides what's expected of it.
Is one open-source alternative and the best to this day. It can either be downloaded directly or built from the sources. You can do both starting from Tasmota github page but I recommend building the binary yourself. To achieve the latter with minimum fuss, one may use the pre-cooked building Docker image. The firmware can then be flashed using the esptool.py tool (to install it: sudo pip install esptool ).
# esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x100000 original.bin # esptool.py --port /dev/ttyUSB0 erase_flash # esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 tasmota.bin
{"NAME":"Gosund EP2","GPIO":[56,255,158,255,132,134,0,0,131,17,0,21,0],"FLAG":0,"BASE":45}
One could fiddle with the configurations further more but that's outside the scope of this guide. Setting the admin password for the new Tasmota device would be a good idea. In case some other device in your WiFi network goes rogue, it won't be able to toggle your smart-plug's switch or mess with its configuration.
With the basic configuration in place, proceed with de-soldering the jump-wires and the reassembly of the smart-plug in reverse order, from step 8 to 4 (see above). When mounting the grounding pieces, use the elasticity of the bottom piece to achieve an electrical contact with the top one. Soldering the pieces is practically impossible due to the heat sinking ability of the large metal pieces. That said, the elastic force of the bottom piece is largely sufficient for a strong electrical contact. However, do check the resistance of that contact using a multi-meter; do not continue until you're reached a very low value between the two. Also, do not connect the plug to the mains before putting it back in its case!
Before gluing back the two pieces, check you haven't forgot something (screws, contact protection, etc). Use the hot-glue gun to carefully inject molten plastic continuously in the saw crevice around the plug. Insert a plug in the socket beforehand so that the top piece is held firmly in place for the success of this step.
To calibrate the voltage, one needs to use a multi-meter set on AC and for the power meter one needs a purely passive load with a know power, like a classic bulb (if you still have some). For details on how to do it, follow Tasmota's power monitoring calibration guide.
It may happen that the few minutes time window for WiFi configuring expires or that you've messed up your connection credentials. All is not lost as there's a Tasmota recovery procedure for those situations.
The end.