Browse Source

Update automated build script

fastled
Xose Pérez 8 years ago
parent
commit
681470eda5
3 changed files with 82 additions and 30 deletions
  1. +11
    -3
      code/build-all
  2. +39
    -13
      code/platformio.custom.ini
  3. +32
    -14
      code/platformio.ini

+ 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,34 +57,55 @@ 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: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
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -90,18 +116,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 =

+ 32
- 14
code/platformio.ini View File

@ -32,7 +32,7 @@ board = nodemcuv2
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 -DNODEMCUV2 -DDEBUG_PORT=Serial
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DNOWSAUTH
[env:node-debug-ota] [env:node-debug-ota]
platform = espressif8266 platform = espressif8266
@ -41,7 +41,7 @@ board = nodemcuv2
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 -DNODEMCUV2 -DDEBUG_PORT=Serial
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DNOWSAUTH
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
@ -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
@ -95,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 -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
@ -104,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 -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
@ -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 -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
@ -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 -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
@ -140,7 +158,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
@ -156,7 +174,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
@ -166,7 +184,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
@ -179,7 +197,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

Loading…
Cancel
Save