diff --git a/code/build-all b/code/build-all index 375ed666..9a7cfec2 100755 --- a/code/build-all +++ b/code/build-all @@ -1,10 +1,13 @@ #!/bin/bash +mv platformio.ini platformio.backup +cp platformio.custom.ini platformio.ini + # 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 -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 # Create output folder @@ -13,5 +16,10 @@ mkdir -p firmware # Build all the required firmwares for environment in $ENVIRONMENTS; do 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 + +platformio run -vv -t uploadfs -e node-debug +mv .pioenvs/node-debug/spiffs.bin firmware/espurna-$version-spiffs.bin + +mv platformio.backup platformio.ini diff --git a/code/platformio.custom.ini b/code/platformio.custom.ini index 3b434ed2..fe5e0ebb 100644 --- a/code/platformio.custom.ini +++ b/code/platformio.custom.ini @@ -10,10 +10,10 @@ env_default = node-debug [common] -platform = espressif8266 +platform = espressif8266_stage framework = arduino extra_script = pio_hooks.py -lib_ignore = FauxmoESP, ESPAsyncUDP +#lib_ignore = FauxmoESP, ESPAsyncUDP lib_deps = DHT sensor library Adafruit Unified Sensor @@ -37,6 +37,11 @@ upload_speed = 115200 upload_port = "192.168.4.1" 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] @@ -52,34 +57,55 @@ include = env:node-debug,ota [env:sonoff-debug] include = common 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 +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] include = common 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 +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] include = common 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 +build_flags = ${def.build_flags_ota} -DSLAMPHER [env:s20-debug] include = common 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 +build_flags = ${def.build_flags_ota} -DS20 # ------------------------------------------------------------------------------ @@ -90,18 +116,18 @@ include = env:s20-debug-ota [env:washer-device] topic = /home/cellar/washer/ip 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] topic = /home/studio/lamp/ip include = env:sonoff-debug-ota 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 = [env:living-lamp-device] topic = /home/living/lamp/ip include = env:s20-debug-ota 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 = diff --git a/code/platformio.ini b/code/platformio.ini index bbe389f0..650f8c45 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -32,7 +32,7 @@ board = nodemcuv2 lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} extra_script = pio_hooks.py -build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial +build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DNOWSAUTH [env:node-debug-ota] platform = espressif8266 @@ -41,7 +41,7 @@ board = nodemcuv2 lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} extra_script = pio_hooks.py -build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial +build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DNOWSAUTH upload_speed = 115200 upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 @@ -53,7 +53,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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] platform = espressif8266 @@ -62,11 +62,29 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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_port = "192.168.4.1" 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] platform = espressif8266 framework = arduino @@ -74,7 +92,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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] platform = espressif8266 @@ -83,7 +101,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 @@ -95,7 +113,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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] platform = espressif8266 @@ -104,7 +122,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 @@ -116,7 +134,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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] platform = espressif8266 @@ -125,7 +143,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 @@ -140,7 +158,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 @@ -156,7 +174,7 @@ extra_script = pio_hooks.py upload_speed = 115200 upload_port = "192.168.4.1" 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] topic = /home/studio/lamp/ip @@ -166,7 +184,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = 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_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 @@ -179,7 +197,7 @@ board = esp01_1m lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} 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_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266