Browse Source

Declared all libraries as PlatformIO dependencies, updated documentation

fastled
Xose Pérez 8 years ago
parent
commit
b102ec52e4
15 changed files with 92 additions and 80 deletions
  1. +0
    -18
      .gitmodules
  2. +4
    -0
      code/.gitignore
  3. +0
    -1
      code/lib/EmonLiteESP
  4. +0
    -1
      code/lib/HLW8012
  5. +0
    -1
      code/lib/JustWifi
  6. +0
    -1
      code/lib/NoFUSSClient
  7. +0
    -1
      code/lib/RemoteSwitch
  8. +0
    -1
      code/lib/fauxmoESP
  9. +18
    -2
      code/platformio.custom.ini
  10. +46
    -30
      code/platformio.official.ini
  11. +3
    -3
      code/src/fauxmo.ino
  12. +0
    -1
      code/vendor/RemoteSwitch-arduino-library
  13. +0
    -1
      code/vendor/emonliteesp
  14. +0
    -1
      code/vendor/nofuss
  15. +21
    -18
      docs/Firmware.md

+ 0
- 18
.gitmodules View File

@ -1,18 +0,0 @@
[submodule "code/vendor/nofuss"]
path = code/vendor/nofuss
url = https://bitbucket.org/xoseperez/nofuss.git
[submodule "code/vendor/emonliteesp"]
path = code/vendor/emonliteesp
url = https://bitbucket.org/xoseperez/emonliteesp.git
[submodule "code/vendor/RemoteSwitch-arduino-library"]
path = code/vendor/RemoteSwitch-arduino-library
url = https://github.com/jccprj/RemoteSwitch-arduino-library
[submodule "code/lib/JustWifi"]
path = code/lib/JustWifi
url = https://bitbucket.org/xoseperez/justwifi
[submodule "code/lib/HLW8012"]
path = code/lib/HLW8012
url = https://bitbucket.org/xoseperez/hlw8012.git
[submodule "code/lib/fauxmoESP"]
path = code/lib/fauxmoESP
url = https://bitbucket.org/xoseperez/fauxmoesp.git

+ 4
- 0
code/.gitignore View File

@ -0,0 +1,4 @@
.pioenvs
.clang_complete
.gcc-flags.json
.piolibdeps

+ 0
- 1
code/lib/EmonLiteESP View File

@ -1 +0,0 @@
../vendor/emonliteesp/code/lib/EmonLiteESP

+ 0
- 1
code/lib/HLW8012

@ -1 +0,0 @@
Subproject commit 1dfa68b9e79a4a8ea96df4ed20f64e0c12ee9d26

+ 0
- 1
code/lib/JustWifi

@ -1 +0,0 @@
Subproject commit 012b9773add97ba5675b62e70f14164a38024010

+ 0
- 1
code/lib/NoFUSSClient View File

@ -1 +0,0 @@
../vendor/nofuss/client/lib/NoFUSSClient

+ 0
- 1
code/lib/RemoteSwitch View File

@ -1 +0,0 @@
../vendor/RemoteSwitch-arduino-library

+ 0
- 1
code/lib/fauxmoESP

@ -1 +0,0 @@
Subproject commit 175e4ff668be6bc4f9cb42e579b38403c3b6f063

+ 18
- 2
code/platformio.custom.ini View File

@ -12,9 +12,25 @@ env_default = node-debug
[common]
platform = espressif8266
framework = arduino
lib_install = 19,31,44,64,305,306,346,359,408,727
extra_script = pio_hooks.py
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
lib_deps =
19
31
44
64
305
306
346
359
408
727
https://bitbucket.org/xoseperez/justwifi.git
https://bitbucket.org/xoseperez/nofuss.git
https://bitbucket.org/xoseperez/hlw8012.git
https://bitbucket.org/xoseperez/emonliteesp.git
https://bitbucket.org/xoseperez/fauxmoESP.git
https://github.com/jccprj/RemoteSwitch-arduino-library
[ota]
upload_speed = 115200


+ 46
- 30
code/platformio.official.ini View File

@ -2,96 +2,112 @@
env_default = node-debug
[common]
lib_install = 19,31,44,64,305,306,346,359,408,727
lib_deps =
19
31
44
64
305
306
346
359
408
727
https://bitbucket.org/xoseperez/justwifi.git
https://bitbucket.org/xoseperez/nofuss.git
https://bitbucket.org/xoseperez/hlw8012.git
https://bitbucket.org/xoseperez/emonliteesp.git
https://bitbucket.org/xoseperez/fauxmoesp.git
https://github.com/jccprj/RemoteSwitch-arduino-library
[env:sonoff-debug]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:sonoff-debug-ota]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:sonoff-pow-debug]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:sonoff-pow-debug-ota]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:slampher-debug]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:slampher-debug-ota]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:s20-debug]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:s20-debug-ota]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
upload_speed = 115200
upload_port = "192.168.4.1"
lib_ignore = FauxmoESP
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
[env:node-debug]
platform = espressif8266_stage
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = nodemcuv2
build_flags = -DNODEMCUV2 -DDEBUG_PORT=Serial -DENABLE_FAUXMO=1
@ -99,14 +115,14 @@ build_flags = -DNODEMCUV2 -DDEBUG_PORT=Serial -DENABLE_FAUXMO=1
[env:node-debug-ota]
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = nodemcuv2
build_flags = -DNODEMCUV2 -DDEBUG_PORT=Serial
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
@ -114,50 +130,50 @@ lib_ignore = fauxmoESP
topic = /home/cellar/airconditioner/ip
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:washer-device]
topic = /home/cellar/washer/ip
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP
[env:studio-lamp-device]
topic = /home/studio/lamp/ip
platform = espressif8266
platform = espressif8266_stage
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
lib_ignore =
[env:living-lamp-device]
topic = /home/living/lamp/ip
platform = espressif8266
framework = arduino
lib_install = ${common.lib_install}
lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py
board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
lib_ignore = fauxmoESP
lib_ignore = FauxmoESP

+ 3
- 3
code/src/fauxmo.ino View File

@ -18,14 +18,14 @@ fauxmoESP fauxmo;
// -----------------------------------------------------------------------------
void fauxmoConfigure() {
fauxmo.setDeviceName(getSetting("hostname", HOSTNAME).c_str());
fauxmo.enable(getSetting("fauxmoEnabled", String(FAUXMO_ENABLED)).toInt() == 1);
}
void fauxmoSetup() {
fauxmoConfigure();
fauxmo.onMessage([](bool state) {
DEBUG_MSG("[FAUXMO] State: %s\n", state ? "ON" : "OFF");
fauxmo.addDevice(getSetting("hostname", HOSTNAME).c_str());
fauxmo.onMessage([](const char * name, bool state) {
DEBUG_MSG("[FAUXMO] %s state: %s\n", name, state ? "ON" : "OFF");
relayStatus(0, state);
});
}


+ 0
- 1
code/vendor/RemoteSwitch-arduino-library

@ -1 +0,0 @@
Subproject commit 6a382a72de81fc8a15dde391be174777d7ba80ca

+ 0
- 1
code/vendor/emonliteesp

@ -1 +0,0 @@
Subproject commit 84ab031a5e7022183a78e5e69fa84d68007952d0

+ 0
- 1
code/vendor/nofuss

@ -1 +0,0 @@
Subproject commit 49322fb1927ac465fbfe996af903daaeb3ff7845

+ 21
- 18
docs/Firmware.md View File

@ -5,24 +5,27 @@
The project is ready to be build using [PlatformIO][1].
Please refer to their web page for instructions on how to install the builder.
PlatformIO will take care of some of the library dependencies, but not all the required libraries are available in the platform library manager. Some dependencies are thus checked out as submodules in GIT. So the normal initial checkout should be:
```
git clone https://bitbucket.org/xoseperez/espurna.git
git submodule init
git submodule update
```
On linux/max systems the libraries are soft linked to the code/lib folder and you are ready to go. Windows systems do not have this feature so you will have to copy them manually like this (ONLY WINDOWS):
```
cd espurna/code
copy vendor/emonliteesp/code/lib/EmonLiteESP lib/EmonLiteESP
copy vendor/nofuss/client/lib/NoFUSSClient lib/NoFUSSClient
copy vendor/RemoteSwitch-arduino-library lib/RemoteSwitch
```
This libraries are optional at the moment and will only be linked if you set ENABLE_NOFUSS, ENABLE_EMON or ENABLE_RF from your build flag.
If you are using PlatformIO /strongly recommended) it will take care of the library dependencies. Otherwise you will have to install them manually:
* Benoit Blanchon's [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
* Hristo Gochkov's [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP)
* Hristo Gochkov's [ESPAsyncUDP](https://github.com/me-no-dev/ESPAsyncUDP)
* Hristo Gochkov's [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)
* 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 [Unified Sensor Library](https://github.com/adafruit/Adafruit_Sensor) (required if compiling with DHT support: -DENABLE_DHT)
* The PatternAgents (et al.) [Embedis](https://github.com/thingSoC/embedis)
* German Martin's [NtpCLientLib](https://github.com/gmag11/NtpClient)
* 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)
And my own libraries:
* [JustWifi](https://bitbucket.org/xoseperez/justwifi.git)
* [FauxmoESP](https://bitbucket.org/xoseperez/fauxmoesp.git) (required if compiling with WeMo emulation support: -DENABLE_FAUXMO)
* [HLW8012](https://bitbucket.org/xoseperez/hlw8012.git) (required if compiling for Sonoff POW: -DENABLE_POW)
* [EmonLiteESP](https://bitbucket.org/xoseperez/emonliteesp.git) (required if compiling with Energy Monitoring support: -DENABLE_EMON)
* [NoFUSS](https://bitbucket.org/xoseperez/nofuss.git) (required if compiling with NoFUSS Automatic OTA support: -DENABLE_NOFUSS)
Once you have all the code, you can check if it's working by:


Loading…
Cancel
Save