What is Tasmota?
[Tasmota is an] alternative firmware for ESP8266/ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. -https://github.com/tasmota/install
Things You Will Need
Preparation
Download Tasmotizer Download
Download CP2102 Windows drivers Download
Extract the downloaded CP2102 zip
Plug the CP2102 USB adapter into an available USB port
Right click the Start button > Device Manager
Expand Other devices and locate the CP2102 > Right click on it > Update driver
Select Browse my computer for drivers
Click the Browse... button > Browse to and select the extracted CP2102 driver files
Check the Include subfolders box > Click Next
Wait while the driver is installed
Take note of the COM port assigned to the CP2102 adapter
CRUCIAL STEP: Unplug the CP2102 USB adapter
Disassembly and Wiring
Disassemble the Sonoff S31 plug by gently prying the gray end cap/power button with a spudger and sliding the two rounded plastic pieces off to reveal 3 screws
Remove the 3 screws and flip the S31's PCB over
Using the minigrabber probes (or by soldering wires from the S31's PCB to the CP2102 USB adapter, make the connections shown below
The CP2102 adapter should NOT be plugged in at this point
CP2102
USB
TXD
RX
S31
PCB
RXD
TX
GND
GND
3V3
VCC
After verifying the connections 3 times, hold down the button the S31 PCB and plug the CP2102 adapter into an available USB port on the PC
Continue holding the button on the S31 PCB for approximately 5 seconds to boot the plug into programming/flashing mode
Flashing Tasmota
Launch the Tasmotizer .exe
Set the Select port field to the COM port of the CP2102 USB adapter
For the first S31 device, check the Save original firmware box and set the Flash size to 4MB
Select Release under image to have Tasmotizer download the latest release of Tasmota
Verify Erase before flashing is checked
Click the Tasmotize! button
Wait while Tasmotizer backs up the stock S31 firmware
When prompted, power cycle the plug by unplugging the CP2102 USB adapter from the PC, holding down the button on the S31 PCB and plugging the CP2102 USB adapter back into the PC
Continue holding the button on the S31 PCB for approximately 5 seconds to boot the plug into programming/flashing mode
Click OK on the Tasmotizer dialog to continue with the flashing process
Wait until Tasmotizer has completed the flash and prompts to restart the device
Unplug the CP2102 USB adapter from the PC and plug it back in, this time without holding the button the S31 PCB
Connecting to Wifi and Configuration
From a wifi enabled device (ie laptop/smart phone), look at the available wifi networks and connect to the tasmota- SSID
Open a web browser and navigate to 192.168.4.1
Enter the Wireless network SSID and password > Click Save
The S31 will attempt to connect to the Wireless network and upon connection will redirect to the new IP address
Welcome to Tasmota on the Sonoff S31 smart plug
Select Configuration > Configure Module > Set the module to Sonoff S31 > Click Save
Back on the Configuration menu, click Configure Other > Set the device Name and Friendly Name > Save
Further reading: https://tasmota.github.io/docs/devices/Sonoff-S31/