Smart switch ESP 8266EX
Sonoff WiFi smart switch

- Original firmware: fwbackup.bin
- Installing alternative firmware: https://tasmota.github.io/docs/Getting-Started/
Input for the board is from mains. It is then rectified and transformed down to 3.3V via DS1117 regulator to power the ESP8266EX chip and the relay that switches the mains relay.
Marked are 3.3V VCC and GND. The ESP8266EX UART-0 is on marked points TX and RX.
Boot message
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
Flashing
While holding the button connect the USB UART.
$ esptool.py -p /dev/ttyUSB0 flash_id
esptool.py v4.5.1
Serial port /dev/ttyUSB0
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:xx:xx:xx
Stub is already running. No upload is necessary.
Manufacturer: 5e
Device: 4014
Detected flash size: 1MB
Hard resetting via RTS pin...
Backup original firmware and erase.erase flash.
$ esptool.py -p /dev/ttyUSB0 read_flash 0x00000 0x100000 fwbackup.bin
...
1048576 (100 %)
1048576 (100 %)
Read 1048576 bytes at 0x00000000 in 96.5 seconds (86.9 kbit/s)...
Hard resetting via RTS pin...
$ esptool.py -p /dev/ttyUSB0 erase_flash
...
Erasing flash (this may take a while)...
Chip erase completed successfully in 52.8s
Hard resetting via RTS pin...
Now power cycle with button pressed again to enter programming mode.
$ esptool.py -p /dev/ttyUSB0 write_flash -fm dout 0x0 tasmota.bin
....
Configuring flash size...
Flash will be erased from 0x00000000 to 0x000a2fff...
Compressed 665504 bytes to 475418...
Wrote 665504 bytes (475418 compressed) at 0x00000000 in 41.9 seconds (effective 127.0 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Connecting via UART
$ tio /dev/ttyUSB0
00:00:00.002 HDW: ESP8266EX
00:00:00.017-031 CFG: Use defaults
00:00:00.577 QPC: Reset
00:00:00.591 Project tasmota - Tasmota Version 14.3.0(release-tasmota)-2_7_7(2024-10-15T08:18:01)
00:00:00.951 WIF: WifiManager active for 3 minutes
00:00:00.461 HTP: Web server active on tasmota-79E7BE-1982 with IP address 192.168.4.1
The device can be connected to via WiFi directly or configured via URAT.UART.


