Browse Source

Merge branch 'master' into multirelay

fastled
Xose Pérez 8 years ago
parent
commit
e6e5c27093
4 changed files with 93 additions and 46 deletions
  1. +11
    -3
      code/build-all
  2. +39
    -13
      code/platformio.custom.ini
  3. +30
    -12
      code/platformio.ini
  4. +13
    -18
      code/src/nofuss.ino

+ 11
- 3
code/build-all View File

@ -1,10 +1,13 @@
#!/bin/bash #!/bin/bash
mv platformio.ini platformio.backup
cp platformio.custom.ini platformio.ini
# Environments to build # Environments to build
ENVIRONMENTS="sonoff-debug s20-debug"
ENVIRONMENTS="sonoff-debug sonoff-dht22-debug sonoff-ds18b20-debug s20-debug sonoff-pow-debug slampher-debug"
# Get current version # Get current version
version=`cat src/version.h | grep APP_VERSION | awk '{print $3}' | sed 's/"//g'`
version=`cat src/config/version.h | grep APP_VERSION | awk '{print $3}' | sed 's/"//g'`
echo $version echo $version
# Create output folder # Create output folder
@ -13,5 +16,10 @@ mkdir -p firmware
# Build all the required firmwares # Build all the required firmwares
for environment in $ENVIRONMENTS; do for environment in $ENVIRONMENTS; do
platformio run -vv -e $environment platformio run -vv -e $environment
mv .pioenvs/$environment/firmware.bin firmware/espurna-$environment-$version.bin
mv .pioenvs/$environment/firmware.bin firmware/espurna-$version-$environment.bin
done done
platformio run -vv -t uploadfs -e node-debug
mv .pioenvs/node-debug/spiffs.bin firmware/espurna-$version-spiffs.bin
mv platformio.backup platformio.ini

+ 39
- 13
code/platformio.custom.ini View File

@ -10,10 +10,10 @@
env_default = node-debug env_default = node-debug
[common] [common]
platform = espressif8266
platform = espressif8266_stage
framework = arduino framework = arduino
extra_script = pio_hooks.py extra_script = pio_hooks.py
lib_ignore = FauxmoESP, ESPAsyncUDP
#lib_ignore = FauxmoESP, ESPAsyncUDP
lib_deps = lib_deps =
DHT sensor library DHT sensor library
Adafruit Unified Sensor Adafruit Unified Sensor
@ -37,6 +37,11 @@ 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
[def]
build_flags_debug = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DENABLE_FAUXMO=1
build_flags_ota = -Wl,-Tesp8266.flash.1m128.ld -DENABLE_FAUXMO=1
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
[env:node-debug] [env:node-debug]
@ -52,18 +57,37 @@ include = env:node-debug,ota
[env:sonoff-debug] [env:sonoff-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
build_flags = ${def.build_flags_debug} -DSONOFF
[env:sonoff-debug-ota]
[env:sonoff-ota]
include = env:sonoff-debug,ota include = env:sonoff-debug,ota
build_flags = ${def.build_flags_ota} -DSONOFF
[env:sonoff-dht22-debug]
include = env:sonoff-debug
build_flags = ${def.build_flags_debug} -DSONOFF -DENABLE_DHT=1
[env:sonoff-ds18b20-debug]
include = env:sonoff-debug
build_flags = ${def.build_flags_debug} -DSONOFF -DENABLE_DS18B20=1
[env:sonoff-pow-debug] [env:sonoff-pow-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
build_flags = ${def.build_flags_debug} -DSONOFF_POW
[env:sonoff-pow-debug-ota]
[env:sonoff-pow-ota]
include = env:sonoff-pow-debug,ota include = env:sonoff-pow-debug,ota
build_flags = ${def.build_flags_ota} -DSONOFF_POW
[env:sonoff-dual-debug]
include = common
board = esp12e
build_flags = ${def.build_flags_debug} -DSONOFF_DUAL
[env:sonoff-dual-ota]
include = env:sonoff-dual-debug,ota
build_flags = ${def.build_flags_ota} -DSONOFF_DUAL
[env:sonoff-dual-debug] [env:sonoff-dual-debug]
include = common include = common
@ -76,18 +100,20 @@ include = env:sonoff-dual-debug,ota
[env:slampher-debug] [env:slampher-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
build_flags = ${def.build_flags_debug} -DSLAMPHER
[env:slampher-debug-ota]
[env:slampher-ota]
include = env:slampher-debug,ota include = env:slampher-debug,ota
build_flags = ${def.build_flags_ota} -DSLAMPHER
[env:s20-debug] [env:s20-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
build_flags = ${def.build_flags_debug} -DS20
[env:s20-debug-ota]
[env:s20-ota]
include = env:s20-debug,ota include = env:s20-debug,ota
build_flags = ${def.build_flags_ota} -DS20
[env:electrodragon-debug] [env:electrodragon-debug]
include = common include = common
@ -106,18 +132,18 @@ include = env:s20-debug-ota
[env:washer-device] [env:washer-device]
topic = /home/cellar/washer/ip topic = /home/cellar/washer/ip
include = env:sonoff-debug-ota include = env:sonoff-debug-ota
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
[env:studio-lamp-device] [env:studio-lamp-device]
topic = /home/studio/lamp/ip topic = /home/studio/lamp/ip
include = env:sonoff-debug-ota include = env:sonoff-debug-ota
platform = espressif8266_stage platform = espressif8266_stage
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
lib_ignore = lib_ignore =
[env:living-lamp-device] [env:living-lamp-device]
topic = /home/living/lamp/ip topic = /home/living/lamp/ip
include = env:s20-debug-ota include = env:s20-debug-ota
platform = espressif8266_stage platform = espressif8266_stage
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20 -DENABLE_FAUXMO=1
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DS20 -DENABLE_FAUXMO=1
lib_ignore = lib_ignore =

+ 30
- 12
code/platformio.ini View File

@ -53,7 +53,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 -DDEBUG_PORT=Serial -DSONOFF
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF
[env:sonoff-debug-ota] [env:sonoff-debug-ota]
platform = espressif8266 platform = espressif8266
@ -62,11 +62,29 @@ 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 -DDEBUG_PORT=Serial -DSONOFF
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF
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
[env:sonoff-dht22-debug]
platform = espressif8266
framework = arduino
board = esp01_1m
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_DHT=1
[env:sonoff-ds18b20-debug]
platform = espressif8266
framework = arduino
board = esp01_1m
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
extra_script = pio_hooks.py
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_DS18B20=1
[env:sonoff-pow-debug] [env:sonoff-pow-debug]
platform = espressif8266 platform = espressif8266
framework = arduino framework = arduino
@ -74,7 +92,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 -DDEBUG_PORT=Serial -DSONOFF_POW
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF_POW
[env:sonoff-pow-debug-ota] [env:sonoff-pow-debug-ota]
platform = espressif8266 platform = espressif8266
@ -83,7 +101,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 -DDEBUG_PORT=Serial -DSONOFF_POW
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF_POW
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
@ -116,7 +134,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 -DDEBUG_PORT=Serial -DSLAMPHER
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSLAMPHER
[env:slampher-debug-ota] [env:slampher-debug-ota]
platform = espressif8266 platform = espressif8266
@ -125,7 +143,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 -DDEBUG_PORT=Serial -DSLAMPHER
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSLAMPHER
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
@ -137,7 +155,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 -DDEBUG_PORT=Serial -DS20
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DS20
[env:s20-debug-ota] [env:s20-debug-ota]
platform = espressif8266 platform = espressif8266
@ -146,7 +164,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 -DDEBUG_PORT=Serial -DS20
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DS20
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
@ -182,7 +200,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 -DDEBUG_PORT=Serial -DS20
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DS20
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
@ -198,7 +216,7 @@ extra_script = pio_hooks.py
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
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
[env:studio-lamp-device] [env:studio-lamp-device]
topic = /home/studio/lamp/ip topic = /home/studio/lamp/ip
@ -208,7 +226,7 @@ board = esp01_1m
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
lib_ignore = lib_ignore =
extra_script = pio_hooks.py extra_script = pio_hooks.py
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=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
@ -221,7 +239,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 -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
build_flags = -g -Wl,-Tesp8266.flash.1m128.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=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

+ 13
- 18
code/src/nofuss.ino View File

@ -24,51 +24,46 @@ NoFUSSClient.setVersion(APP_VERSION);
NoFUSSClient.onMessage([](nofuss_t code) { NoFUSSClient.onMessage([](nofuss_t code) {
if (code == NOFUSS_START) { if (code == NOFUSS_START) {
Serial.println(F("[NoFUSS] Start"));
DEBUG_MSG("[NoFUSS] Start\n");
} }
if (code == NOFUSS_UPTODATE) { if (code == NOFUSS_UPTODATE) {
Serial.println(F("[NoFUSS] Already in the last version"));
DEBUG_MSG("[NoFUSS] Already in the last version\n");
} }
if (code == NOFUSS_PARSE_ERROR) { if (code == NOFUSS_PARSE_ERROR) {
Serial.println(F("[NoFUSS] Error parsing server response"));
DEBUG_MSG("[NoFUSS] Error parsing server response\n");
} }
if (code == NOFUSS_UPDATING) { if (code == NOFUSS_UPDATING) {
Serial.println(F("[NoFUSS] Updating"));
Serial.print( F(" New version: "));
Serial.println(NoFUSSClient.getNewVersion());
Serial.print( F(" Firmware: "));
Serial.println(NoFUSSClient.getNewFirmware());
Serial.print( F(" File System: "));
Serial.println(NoFUSSClient.getNewFileSystem());
DEBUG_MSG("[NoFUSS] Updating");
DEBUG_MSG(" New version: %s\n", (char *) NoFUSSClient.getNewVersion().c_str());
DEBUG_MSG(" Firmware: %s\n", (char *) NoFUSSClient.getNewFirmware().c_str());
DEBUG_MSG(" File System: %s", (char *) NoFUSSClient.getNewFileSystem().c_str());
} }
if (code == NOFUSS_FILESYSTEM_UPDATE_ERROR) { if (code == NOFUSS_FILESYSTEM_UPDATE_ERROR) {
Serial.print(F("[NoFUSS] File System Update Error: "));
Serial.println(NoFUSSClient.getErrorString());
DEBUG_MSG("[NoFUSS] File System Update Error: %s\n", (char *) NoFUSSClient.getErrorString().c_str());
} }
if (code == NOFUSS_FILESYSTEM_UPDATED) { if (code == NOFUSS_FILESYSTEM_UPDATED) {
Serial.println(F("[NoFUSS] File System Updated"));
DEBUG_MSG("[NoFUSS] File System Updated\n");
} }
if (code == NOFUSS_FIRMWARE_UPDATE_ERROR) { if (code == NOFUSS_FIRMWARE_UPDATE_ERROR) {
Serial.print(F("[NoFUSS] Firmware Update Error: "));
Serial.println(NoFUSSClient.getErrorString());
DEBUG_MSG("[NoFUSS] Firmware Update Error: %s\n", (char *) NoFUSSClient.getErrorString().c_str());
} }
if (code == NOFUSS_FIRMWARE_UPDATED) { if (code == NOFUSS_FIRMWARE_UPDATED) {
Serial.println(F("[NoFUSS] Firmware Updated"));
DEBUG_MSG("[NoFUSS] Firmware Updated\n");
} }
if (code == NOFUSS_RESET) { if (code == NOFUSS_RESET) {
Serial.println(F("[NoFUSS] Resetting board"));
DEBUG_MSG("[NoFUSS] Resetting board\n");
} }
if (code == NOFUSS_END) { if (code == NOFUSS_END) {
Serial.println(F("[NoFUSS] End"));
DEBUG_MSG("[NoFUSS] End\n");
} }
}); });


Loading…
Cancel
Save