ESPurna ("spark" in Catalan) is a custom C firmware for ESP8266 based smart switches. It was originally developed with the **[ITead Sonoff][1]** in mind.
ESPurna ("spark" in Catalan) is a custom C firmware for ESP8266 based smart switches.
It was originally developed with the **[ITead Sonoff][1]** in mind but now it supports a growing number of ESP8266-based boards.
## Features
@ -9,13 +10,15 @@ ESPurna ("spark" in Catalan) is a custom C firmware for ESP8266 based smart swit
* **Flashing firmware Over-The-Air** (OTA)
* Up to **3 configurable WIFI networks**, connects to the strongest signal
* **MQTT support** with configurable host and topic
* **REST API** to query and set relay statuses
* Support for **multi-relay boards** (Sonoff Dual, Electrodragon ESP Relay Board,...)
* Manual switch ON/OFF with button (single click the button)
* AP mode backup (double click the button)
* Manual reeset the board (long click the button)
* Manual reset the board (long click the button)
* Visual status of the connection via the LED
* **Alexa** integration (Amazon Echo or Dot) by emulating a Belkin WeMo switch
* Support for **automatic over-the-air updates** through the [NoFUSS Library][2]
* Support for **DHT22** sensors
* Support for **DHT22**and **DS18B20**sensors
* Support for the **HLW8012** power sensor present in the Sonoff POW
* Support for **current monitoring** through the [EmonLiteESP Library][3] using a non-intrusive current sensor ([requires some hacking][4])
@ -80,6 +82,24 @@ As in the Sonoff the button is connected to GPIO0, so to enter flash mode press
Same as for the [Sonoff TH](#iteadstudio-sonoff-th) above.
## IteadStudio Sonoff DUAL
|Property|Value|
|---|---|
|Manufacturer|Itead Studio|
|Web page|https://www.itead.cc/sonoff-dual.html|
|Build flag|SONOFF_DUAL|
### Flashing
![Sonoff DUAL - Inside back view](images/sonoff-dual-flash.jpg)
The Sonoff Dual it's a bit tricky to flash since GPIO0 is not connected to the button as in the TH or POW, but to the pin 15 in the SIL F330 chip that manages the buttons and the relays. SO you have to locate a pad connected to GPIO and short it to ground while powering the device.
In the picture above you have a location of an available and easily accessible GPIO0 pad. The other required pins are brought out in the top header. Remember it's a *3V3* device.
Once flashed use OTA to update the firmware or the filesystem.
## IteadStudio Slampher
|Property|Value|
@ -115,6 +135,26 @@ There is a labeled header in the front of the PCB and the button is connected to
Solder a 4 pin male or female header and connect it to your USB-to-UART bridge. Again, remember **it's a 3V3 device**. Then press and hold the button and connect the programmer to your computer. The microcontroller will boot into flash mode and you are ready to update the firmware.
![Electrodragon ESP Relay Board - Front view](images/electrodragon-flash.jpg)
The Electrodragon ESP Relay Board is pretty easy to flash IF you do not follow their wiki, it's all wrong. Check the picture above and note that:
* Power the board from the 5V pin, GND to GND
* The RX pin in the header should go to your programmer TX pin and
* The TX pin in the header should go to your programmer RX pin
* The button labeled BTN2 is connected to GPIO0, so hold it down while powering the board, I've had better results keeping it down until the flashing starts
After flashing the firmware via serial do a hard reset of the device (unplug & plug). There is an issue with the ESP.reset() method. Check [https://github.com/esp8266/Arduino/issues/1017][1] for more info.
## Can't find espresiff8266_stage platform
The fauxmoESP library requires the staging version of Arduino Core for ESP8266. Either you are using Arduino IDE or PlatformIO you will have to manually install this. Check the [documentation for the fauxmoESP library][2] for more info.