Revision [2784]
This is an old revision of SonoffSetup2017 made by ZorrUno on 2017-07-20 21:12:21.
Flashing and using a Sonoff with Tasmota firmware
Devices
https://www.itead.cc/sonoff-wifi-wireless-switch.html
useful youtube tutorials
https://www.youtube.com/watch?v=n4MDRm2yAJg
http://www.andremiller.net/content/programming-an-itead-sonoff-wireless-smart-switch-esp8266
Tasmota
Tasmota Firmware - clone as a zip
https://github.com/arendst/Sonoff-Tasmota
Atom Text Editor with platform i/o
- install Atom https://atom.io/
- install packages, "platform-ide"
- had issues with Clang in Ubuntu... Go to Atom's Preferences menu, click packages, autocomplete-clang, settings, and change 'Clang Command" from "clang" to clang-4.0 (or the version running on your linux)
- Open Project, click on the Sonoff-Tasmota-Master folder
Isues with USB serial
- in Ubuntu, I needed to add my user to the dialout group
Setup the firmware & flash
- Update the user_config.h with wireless SSID, Password and MQTT server details
- save
Connect Sonoff
- solder the board pins (see tutorials everywhere)
- Set up a usb ftdi/serial programmer (I got a ch340g for $8 from trademe)
- make sure you set it to 3.3V...
- connect up the sonoff in programming mode (hold button and power up, release)
- in Atom PlatformIO menu, click upload
Monitor the serial happenings
- Use Atoms inbuilt serial monitor 115200, /dev/ttyUSB0 (in my case)
- check serial data for IP of device and that it connects to wifi etc
Configure it more on its web interface if you like
- my device is at http://192.168.1.113/ - it runs a web server for config etc
- Can also add new firmware like this if needed
MQTT
- Get a MQTT client, I used MQTTlens for chrome, mqttfx was too flakey
- subscribe to stat/sonoff/power
- publish cmnd/sonoff/power toggle (or on/off)
--
CategoryMicrocontrol
CategoryHomeAutomation
CategoryLinux