Sonoff

http://robin.me/pi
sonoff s20 hardware: https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-S20-Smart-Socket
sonoff firmware http://https://github.com/arendst/Sonoff-Tasmota/releases
sonoff MQTT https://github.com/arendst/Sonoff-Tasmota/wiki/MQTT-Features
sonoff MQTT Commands https://github.com/arendst/Sonoff-Tasmota/wiki/Commands
sonoff tasmota button usage: https://github.com/arendst/Sonoff-Tasmota/wiki/Button-usage
sudo vi /boot/config.txt add to the end of the file: enable_uart=1 sudo systemctl stop serial-getty@ttys0.service sudo systemctl disable serial-getty@ttys0.service sudo vi /boot/cmdline.txt remove: console=serial0,115200 sudo reboot sudo apt-get install esptool download firmware: https://github.com/arendst/Sonoff-Tasmota/releases
sudo esptool -vv -cb 115200 -cp /dev/serial0 -ca 0X00000 -bz 1M -bm dout -cf /home/pi/Downloads/sonoff-UK.bin ssid Vendor: Espressif Inc. Connect to the device webpage (http://[sonoff-ip]/cn) MQTT Javascript https://github.com/arendst/Sonoff-Tasmota/wiki/MQTT-Overview
MQTT Raspberry pi https://www.instructables.com/id/Installing-MQTT-BrokerMosquitto-on-Raspberry-Pi/
Nathan Sonoff pow https://nathan.chantrell.net/20170524/itead-sonoff-pow-wi-fi-mains-switching-power-monitoring-module-with-mqtt-esp8266/
======================== MQTT sudo apt-get update sudo apt-get install mosquitto sudo apt-get install mosquitto-clients ======================== mosquitto_pub -h 127.0.0.1 -t cmnd/sonoff-basement-heating/ipaddress1 -m 0 mosquitto_sub -h 127.0.0.1 -t stat/sonoff-basement-heating/RESULT -v stat/sonoff-basement-heating/RESULT {"IPAddress1":"0.0.0.0 (192.168.0.100)"} mosquitto_pub -h 127.0.0.1 -t cmnd/sonoff-vfast/status -m 5 mosquitto_sub -h 127.0.0.1 -t stat/sonoff-vfast/STATUS5 -v stat/sonoff-vfast/STATUS5 {"StatusNET":{"Hostname":"sonoff-vfast-5856","IPAddress":"192.168.0.109","Gateway":"192.168.0.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.0.1","Mac":"84:F3:EB:4B:D6:E0","Webserver":2,"WifiConfig":2}} mosquitto_pub -h 127.0.0.1 -t cmnd/sonoff-BB1/power -m off mosquitto_pub -h 127.0.0.1 -t cmnd/sonoff-BB1/power -m on ======================== ======================== https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool pip install esptool esptool.py --port COM5 erase_flash esptool.py --port COM4 write_flash 0x1000 my_app-0x01000.bin esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 sonoff.bin https://github.com/arendst/Sonoff-Tasmota/releases ========================