Sonoff Basic
Revision: Sonoff RF R2 POWER V1.0 PCB - ESP8285 Chipset
Need to be flashed with custom firmware to prevent the switch to connect the Itead cloud.
Resources
- https://github.com/arendst/Sonoff-Tasmota
- https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Basic#new-board-layout
Tasmota
https://github.com/arendst/Sonoff-Tasmota
Tasmota firmware
https://github.com/arendst/Sonoff-Tasmota/releases Actual version: 6.4.1.8
ESPTool
https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool#esptool-executable-windows–linux
Scheme
Source Domoblog
Wall switch
https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Basic#new-board-layout
A physical switch can be added to the Sonoff devices.
Can be achieved connecting GPIO3 labeled RX
and GND
.
In Tasmota Web interface, setup the module and bind the GPIO3
to 9 Switch1
(SwitchMode2 1
).
Firmware mode
https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool#put-device-in-firmware-upload-mode
On ESP8285, the green LED don’t blink in firmware mode.
Erase firmware
Can be useful if WiFi issue.
esptool -cp COM5 -cb 115200 -ce -v
esptool.py --port COM5 erase_flash
Flash firmware
- Plug the FTDI (without power supply) to the Sonoff device
- Push (and hold) the Sonoff button
- Plug in the FTDI to the PC
-
Launch the following command (supposing you downloaded the Tasmota firmware into the same directory)
EXE version
esptool.exe -cp COM5 -cb 115200 -bm dout -cf sonoff.bin -v
Python version
esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 sonoff.bin
- As soon as the firmware update begins, the button can be released.
esptool v0.4.13 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting flash mode from qio to dout
opening bootloader
resetting board
trying to connect
trying to connect
Uploading 534032 bytes from sonoff.bin to flash at 0x00000000
................................................................................ [ 15% ]
................................................................................ [ 30% ]
................................................................................ [ 45% ]
................................................................................ [ 61% ]
................................................................................ [ 76% ]
................................................................................ [ 91% ]
.......................................... [ 100% ]
starting app without reboot
closing bootloader
Setting up
Connect to the new WiFi AP : sonoff-...
- Setup the WiFi connection to home network
- Setup MQTT broker
Troubleshooting
- Sonoff don’t connect to WiFi configured network
- After flashing, unplug FTDI from USB
- Plug FTDI to USB
- Disconnect VCC from Sonoff (3V3)
- Reconnect VCC
- Sonoff should connect to WiFi
- Display logs from Sonoff device
- Launch Putty
- Setup a serial connection
Serial line: COM5 Speed: 115200
Miscellaneous
- Sonoff take 30-45 seconds to reboot and reconnect to WiFi network
Add to HomeAssistant
configuration.yaml
:
switch:
- platform: mqtt
name: "Sonoff "
state_topic: "stat/sonoff/RESULT"
value_template: ""
command_topic: "cmnd/sonoff/POWER"
payload_on: "ON"
payload_off: "OFF"