Browse Source

Update documentation for Sonoff Dual and Electrodragon board

fastled
Xose Pérez 8 years ago
parent
commit
d7ccde2782
8 changed files with 65 additions and 20 deletions
  1. +6
    -3
      README.md
  2. +3
    -11
      code/platformio.custom.ini
  3. +4
    -4
      code/platformio.ini
  4. +4
    -2
      docs/Firmware.md
  5. +40
    -0
      docs/Hardware.md
  6. +8
    -0
      docs/Troubleshooting.md
  7. BIN
      docs/images/electrodragon-flash.jpg
  8. BIN
      docs/images/sonoff-dual-flash.jpg

+ 6
- 3
README.md View File

@ -1,6 +1,7 @@
# ESPurna # ESPurna
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 ## 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) * **Flashing firmware Over-The-Air** (OTA)
* Up to **3 configurable WIFI networks**, connects to the strongest signal * Up to **3 configurable WIFI networks**, connects to the strongest signal
* **MQTT support** with configurable host and topic * **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) * Manual switch ON/OFF with button (single click the button)
* AP mode backup (double 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 * Visual status of the connection via the LED
* **Alexa** integration (Amazon Echo or Dot) by emulating a Belkin WeMo switch * **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 **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 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]) * Support for **current monitoring** through the [EmonLiteESP Library][3] using a non-intrusive current sensor ([requires some hacking][4])
* Command line configuration * Command line configuration


+ 3
- 11
code/platformio.custom.ini View File

@ -49,7 +49,6 @@ include = common
board = nodemcuv2 board = nodemcuv2
platform = espressif8266 platform = espressif8266
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial
lib_ignore =
[env:node-debug-ota] [env:node-debug-ota]
include = env:node-debug,ota include = env:node-debug,ota
@ -89,14 +88,6 @@ build_flags = ${def.build_flags_debug} -DSONOFF_DUAL
include = env:sonoff-dual-debug,ota include = env:sonoff-dual-debug,ota
build_flags = ${def.build_flags_ota} -DSONOFF_DUAL build_flags = ${def.build_flags_ota} -DSONOFF_DUAL
[env:sonoff-dual-debug]
include = common
board = esp12e
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_DUAL
[env:sonoff-dual-debug-ota]
include = env:sonoff-dual-debug,ota
[env:slampher-debug] [env:slampher-debug]
include = common include = common
board = esp01_1m board = esp01_1m
@ -118,10 +109,11 @@ build_flags = ${def.build_flags_ota} -DS20
[env:electrodragon-debug] [env:electrodragon-debug]
include = common include = common
board = esp12e board = esp12e
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DESP_RELAY_BOARD
build_flags = -g -DDEBUG_PORT=Serial -DESP_RELAY_BOARD -DENABLE_FAUXMO=1 -DENABLE_DHT=1
[env:electrodragon-debug-ota]
[env:electrodragon-ota]
include = env:electrodragon-debug,ota include = env:electrodragon-debug,ota
build_flags = -DESP_RELAY_BOARD -DENABLE_FAUXMO=1 -DENABLE_DHT=1
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------


+ 4
- 4
code/platformio.ini View File

@ -113,7 +113,7 @@ board = esp01_1m
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DSONOFF_DUAL
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DSONOFF_DUAL
[env:sonoff-dual-debug-ota] [env:sonoff-dual-debug-ota]
platform = espressif8266 platform = espressif8266
@ -122,7 +122,7 @@ board = esp01_1m
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DSONOFF_DUAL
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DSONOFF_DUAL
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -176,7 +176,7 @@ board = esp12e
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -DDEBUG_PORT=Serial -DDEBUG_PORT=Serial -DESP_RELAY_BOARD
build_flags = -g -DDEBUG_PORT=Serial -DDEBUG_PORT=Serial -DESP_RELAY_BOARD -DENABLE_DHT=1
[env:electrodragon-debug-ota] [env:electrodragon-debug-ota]
platform = espressif8266 platform = espressif8266
@ -185,7 +185,7 @@ board = esp12e
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore} lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -DDEBUG_PORT=Serial -DDEBUG_PORT=Serial -DESP_RELAY_BOARD
build_flags = -g -DDEBUG_PORT=Serial -DDEBUG_PORT=Serial -DESP_RELAY_BOARD -DENABLE_DHT=1
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266


+ 4
- 2
docs/Firmware.md View File

@ -14,9 +14,11 @@ If you are using PlatformIO /strongly recommended) it will take care of the libr
* Marvin Roger's [AyncMqttClient](https://github.com/marvinroger/async-mqtt-client) * Marvin Roger's [AyncMqttClient](https://github.com/marvinroger/async-mqtt-client)
* Adafruit's [DHT Sensor Library](https://github.com/adafruit/DHT-sensor-library) (required if compiling with DHT support: -DENABLE_DHT) * Adafruit's [DHT Sensor Library](https://github.com/adafruit/DHT-sensor-library) (required if compiling with DHT support: -DENABLE_DHT)
* Adafruit's [Unified Sensor Library](https://github.com/adafruit/Adafruit_Sensor) (required if compiling with DHT support: -DENABLE_DHT) * Adafruit's [Unified Sensor Library](https://github.com/adafruit/Adafruit_Sensor) (required if compiling with DHT support: -DENABLE_DHT)
* Paul Stoffregen (et al.) [OneWire](https://github.com/PaulStoffregen/OneWire)
* Miles Burton (et al.) [DallasTemperature](https://github.com/milesburton/Arduino-Temperature-Control-Library)
* The PatternAgents (et al.) [Embedis](https://github.com/thingSoC/embedis) * The PatternAgents (et al.) [Embedis](https://github.com/thingSoC/embedis)
* German Martin's [NtpCLientLib](https://github.com/gmag11/NtpClient) * German Martin's [NtpCLientLib](https://github.com/gmag11/NtpClient)
* Michael Maregolis & Paul Stoffregen's [Time](https://github.com/PaulStoffregen/Time)
* Michael Maregolis & Paul Stoffregen's [Time](https://github.com/PaulStoffregen/Time)
* Randy Simons' [RemoteSwitch](https://github.com/jccprj/RemoteSwitch-arduino-library) (required if using custom RF module: -DENABLE_RF) * Randy Simons' [RemoteSwitch](https://github.com/jccprj/RemoteSwitch-arduino-library) (required if using custom RF module: -DENABLE_RF)
And my own libraries: And my own libraries:
@ -45,7 +47,7 @@ Wire your board (check the [Hardware page](Hardware.md)) and flash the firmware
> pio run -t upload -e sonoff > pio run -t upload -e sonoff
``` ```
(or any other environment, depending on the board you are woring with).
(or any other environment, depending on the board you are working with).
Library dependencies are automatically managed via PlatformIO Library Manager or included via submodules and linked from the "lib" folder. Library dependencies are automatically managed via PlatformIO Library Manager or included via submodules and linked from the "lib" folder.


+ 40
- 0
docs/Hardware.md View File

@ -8,8 +8,10 @@ This is the official list of supported hardware for the ESPurna firmware. The ha
* [IteadStudio Sonoff RF](#iteadstudio-sonoff-rf) * [IteadStudio Sonoff RF](#iteadstudio-sonoff-rf)
* [IteadStudio Sonoff TH](#iteadstudio-sonoff-th) * [IteadStudio Sonoff TH](#iteadstudio-sonoff-th)
* [IteadStudio Sonoff POW](#iteadstudio-sonoff-pow) * [IteadStudio Sonoff POW](#iteadstudio-sonoff-pow)
* [IteadStudio Sonoff DUAL](#iteadstudio-sonoff-dual)
* [IteadStudio Slampher](#iteadstudio-slampher) * [IteadStudio Slampher](#iteadstudio-slampher)
* [IteadStudio S20](#iteadstudio-s20) * [IteadStudio S20](#iteadstudio-s20)
* [Electrodragon ESP Relay Board](#electrodragon-esp-relay-board)
## IteadStudio Sonoff ## IteadStudio Sonoff
@ -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. 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 ## IteadStudio Slampher
|Property|Value| |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. 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
|Property|Value|
|---|---|
|Manufacturer|Electrodragon|
|Web page|http://www.electrodragon.com/product/wifi-iot-relay-board-based-esp8266/|
|Build flag|ESP_RELAY_BOARD|
### Flashing
![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
[1]: https://www.itead.cc/sonoff-wifi-wireless-switch.html [1]: https://www.itead.cc/sonoff-wifi-wireless-switch.html
[2]: https://www.itead.cc/sonoff-rf.html [2]: https://www.itead.cc/sonoff-rf.html
[2]: https://www.itead.cc/sonoff-th.html [2]: https://www.itead.cc/sonoff-th.html


+ 8
- 0
docs/Troubleshooting.md View File

@ -1,5 +1,13 @@
# Troubleshooting # Troubleshooting
## Problems resetting the board
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. 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.
[1]: https://github.com/esp8266/Arduino/issues/1017 [1]: https://github.com/esp8266/Arduino/issues/1017
[2]: https://bitbucket.org/xoseperez/fauxmoesp

BIN
docs/images/electrodragon-flash.jpg View File

Before After
Width: 800  |  Height: 533  |  Size: 247 KiB

BIN
docs/images/sonoff-dual-flash.jpg View File

Before After
Width: 800  |  Height: 533  |  Size: 228 KiB

Loading…
Cancel
Save