Assumptions
This guide assumes that you already have a functional linux environment. For this guide, I am using vanilla Ubuntu 20.04.
Pre-reqs:
apt install python3 python3-pip
pip install pyserial
next we need the ESPTool for flashing:
git clone https://github.com/espressif/esptool.git esp
cd esp
Now, wire up the FTDP usb uart plug. Some of these intentionally mis-label TX and RX, so don’t be afraid to swap. TX on the USB goes to RX on the S31, and RX on the USB goes to goes to TX on the S31 as in the video/pictured.
If you don’t want to solder, that’s fine. I have these handy HP micro-grabber things, and they work fine to avoid soldering if you’d rather not. It can be hard to find a place to order the hp micrograbbers, though.
The Tasmota firmware is the one I like to use because it can be OTA upgraded (meaning, hopefully, no more FTDI usb flashing) and because it can be configured wirelessly. Other solutions have you modify source code and flash device-specific S31 firmwares to each smart plug.
I used the appropriate Sonoff S31 firmware from here:
http://ota.tasmota.com/tasmota/release/
Verify you’ve got a good connection before doing anything:
That’s how I ran the command, and esptool was able to “shake hands” with the ESP8266.
Now, flash Tasmota.
0. Ensure FTDI is configured for 3.3v, not 5v, power.
- PRess and hold the button on the S31 as you plug in the USB dongle (USB dongle supplies VCC power of 3.3v)
- run
dmesg
to confirm /dev/ttyUSB??? (/dev/ttyUSB0 in my case). - run the handshake command above which is non destructive. IF all is good
*** DESTRUCTIVE ***
About to overwrite the factory flash! - run the command to flash the tasmota bin file:
Once you do that, reboot the S31 device (power cycle) and you should see a new wifi network tasmota_SOMETHING
join that, and you can configure from there.
Re-assemble the smartplug fully BEFORE plugging back in to 110v AC mains. Be sure to remove/desolder the wires.
BE CAREFUL to restore it to its original state. It is not 100% safe to leave a plug or pig tail on this programming header when it is plugged into AC mains.
Level1 is not responsible for any thing you might do; etc etc.
From here, we will continue with the HomeAsssistant Guide and our other videos on smart home automation.