From 0b499cceea65aa347b75d1498004ada6eb5ef3af Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Fri, 15 Nov 2019 15:38:58 +0100 Subject: [PATCH 01/15] [PIO] Cleanup platformio.ini and move to core 2.6.1 as default (#2742) Fixes: #2742 --- before_deploy | 43 +++-- dist/README.txt | 7 +- platformio.ini | 374 +++++++------------------------------------- pre_extra_script.py | 1 - 4 files changed, 81 insertions(+), 344 deletions(-) diff --git a/before_deploy b/before_deploy index 7a99597dac..b0afa79069 100755 --- a/before_deploy +++ b/before_deploy @@ -40,37 +40,34 @@ fi mkdir -p ${TMP_DIST}/memstats for ENV in \ + custom_ESP32_4M316k\ custom_ESP8266_4M1M\ + custom_ESP8266_4M2M\ + dev_ESP8266_4M1M\ esp-wrover-kit_test_4M316k\ esp32test_4M316k\ - normal_ESP8266_1M\ - normal_ESP8266_1M_VCC\ - normal_ESP8285_1M\ - normal_core_241_ESP8266_1M\ - normal_WROOM02_2M\ - normal_core_252_WROOM02_2M256\ - normal_ESP8266_4M1M\ - normal_core_241_ESP8266_4M1M\ - normal_core_252_ESP8266_16M\ - normal_core_260_sdk222_alpha_ESP8266_4M1M\ - normal_core_260_sdk222_alpha_ESP8266_16M\ - minimal_core_242_ESP8266_1M_OTA\ - minimal_core_242_ESP8285_1M_OTA\ - minimal_core_252_ESP8266_1M_OTA\ - minimal_core_252_ESP8285_1M_OTA\ + hard_SONOFF_POW_4M1M\ + hard_Shelly_1_2M256\ + hard_Ventus_W266\ + hard_other_POW_ESP8285_1M\ minimal_IRext_ESP8266_1M\ minimal_IRext_ESP8266_4M1M\ minimal_IRext_ESP8266_4M2M\ + minimal_core_242_ESP8266_1M_OTA\ + minimal_core_242_ESP8285_1M_OTA\ + minimal_core_261_ESP8266_1M_OTA\ + minimal_core_261_ESP8285_1M_OTA\ + normal_ESP8266_16M\ + normal_ESP8266_1M\ + normal_ESP8266_1M_VCC\ + normal_ESP8266_4M1M\ + normal_ESP8285_1M\ normal_IRext_no_rx_ESP8266_4M2M\ - test_core_260_sdk222_alpha_ESP8266_4M1M\ - test_core_260_sdk3_alpha_ESP8266_4M1M\ - test_core_260_sdk222_alpha_ESP8266_16M\ + normal_WROOM02_2M256\ + normal_WROOM02_2M\ test_ESP8266_4M_VCC\ - dev_ESP8266_4M1M\ - hard_SONOFF_POW_4M1M\ - hard_other_POW_ESP8285_1M\ - hard_Shelly_1_2M256\ - hard_Ventus_W266;\ + test_beta_ESP8266_16M\ + test_beta_ESP8266_4M1M;\ do MAX_FILESIZE=1044464 if [[ ${ENV} == *"_1M"* ]]; then diff --git a/dist/README.txt b/dist/README.txt index bfa6678e97..dcc7cf1490 100644 --- a/dist/README.txt +++ b/dist/README.txt @@ -23,11 +23,8 @@ There is also a number of special builds: - normal_IR => "Normal" + IR receiver/transmitter plugins and library - hard_xxxxx => Special builds for some off-the-shelf hardware. - minimal_ESP82xx_1M_OTA => Minimum number of plugins and a limited set of controllers included to be able to perform a 2-step OTA on 1 MB flash nodes. -- normal_core_241 => "Normal" using core 2.4.1, since 2.4.2 has issues with PWM -- xxx_core_260_sdk2_alpha -> core 2.6.0 alpha version (under development) using SDK 2.2.1 -- xxx_core_260_sdk222_alpha -> core 2.6.0 alpha version (under development) using SDK 2.2.2 -- xxx_core_260_sdk3_alpha -> core 2.6.0 alpha version (under development) using SDK 3.0.0-dev (under development too) - +- normal_core_xxx => "Normal" using core xxx (e.g. 2.4.1) +- normal_beta => "Normal" using the staged (beta) branch of the esp8266/Arduino repository. Chip can be: - ESP8266 => Most likely option diff --git a/platformio.ini b/platformio.ini index a3f5e5ed15..7f32104ca7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -116,26 +116,26 @@ build_flags = ${esp82xx_2_5_x.build_flags} -DCORE_POST_2_6_0 -[core_2_3_0] -platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.5.0_Puya -build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' - -DNDEBUG - -DVTABLES_IN_FLASH - -fno-exceptions - -DPUYA_SUPPORT=1 - -DARDUINO_ESP8266_RELEASE_2_3_0 - -DFORCE_PRE_2_5_0 -lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR +;[core_2_3_0] +;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.5.0_Puya +;build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' +; -DNDEBUG +; -DVTABLES_IN_FLASH +; -fno-exceptions +; -DPUYA_SUPPORT=1 +; -DARDUINO_ESP8266_RELEASE_2_3_0 +; -DFORCE_PRE_2_5_0 +;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR -[core_2_4_0] -platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.6.0_Puya -build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_0 -DFORCE_PRE_2_5_0 -lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR +;[core_2_4_0] +;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.6.0_Puya +;build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_0 -DFORCE_PRE_2_5_0 +;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR -[core_2_4_1] -platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.7.3_Puya -build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_1 -DFORCE_PRE_2_5_0 -lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR +;[core_2_4_1] +;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.7.3_Puya +;build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_1 -DFORCE_PRE_2_5_0 +;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR [core_2_4_2] @@ -143,60 +143,38 @@ platform = https://github.com/TD-er/platform-espressif8266.git# build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_2 -DFORCE_PRE_2_5_0 lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR -[core_2_5_0] -platform = espressif8266@2.0.4 -build_flags = ${esp82xx_2_5_x.build_flags} +;[core_2_5_0] +;platform = espressif8266@2.0.4 +;build_flags = ${esp82xx_2_5_x.build_flags} -[core_2_5_2] -platform = espressif8266@2.2.3 -build_flags = ${esp82xx_2_5_x.build_flags} +;[core_2_5_2] +;platform = espressif8266@2.2.3 +;build_flags = ${esp82xx_2_5_x.build_flags} [core_2_6_0] platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_0 build_flags = ${esp82xx_2_6_x.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 +[core_2_6_1] +platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_1 +build_flags = ${esp82xx_2_6_x.build_flags} + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 + [core_stage] platform = https://github.com/platformio/platform-espressif8266.git#feature/stage -build_flags = ${esp82xx_2_6_x.build_flags} -DARDUINO_ESP8266_RELEASE='"2.6.0-dev stage"' - - -[core_esp32_0_12_0] -platform = espressif32@0.12.0 -lib_deps = "ESP32WebServer" - -[core_esp32_1_2_0] -platform = espressif32@1.2.0 - -[core_esp32_1_3_0] -platform = espressif32@1.3.0 - -[core_esp32_1_4_0] -platform = espressif32@1.4.0 - -[core_esp32_1_5_0] -platform = espressif32@1.5.0 - -[core_esp32_1_6_0] -platform = espressif32@1.6.0 - -[core_esp32_1_7_0] -platform = espressif32@1.7.0 - -[core_esp32_1_8_0] -platform = espressif32@1.8.0 - -[core_esp32_1_9_0] -platform = espressif32@1.9.0 +build_flags = ${esp82xx_2_6_x.build_flags} + -DARDUINO_ESP8266_RELEASE='"2.7.0-dev stage"' + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 -[core_esp32_1_10_0] -platform = espressif32@1.10.0 +[core_esp32_1_11_1] +platform = espressif32@1.11.1 [core_esp32_stage] platform = https://github.com/platformio/platform-espressif32.git#feature/stage [core_esp32] -platform = ${core_esp32_1_10_0.platform} +platform = ${core_esp32_1_11_1.platform} build_unflags = -Wall build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' -DCONFIG_FREERTOS_ASSERT_DISABLE @@ -242,13 +220,13 @@ targets = ${common.targets} [regular_platform] build_unflags = -build_flags = ${core_2_5_2.build_flags} ${common.build_flags} -platform = ${core_2_5_2.platform} +build_flags = ${core_2_6_1.build_flags} ${common.build_flags} +platform = ${core_2_6_1.platform} [beta_platform] build_unflags = -build_flags = ${core_2_6_0.build_flags} ${common.build_flags} -platform = ${core_2_6_0.platform} +build_flags = ${core_stage.build_flags} ${common.build_flags} +platform = ${core_stage.platform} @@ -256,25 +234,6 @@ platform = ${core_2_6_0.platform} platform = ${regular_platform.platform} build_flags = ${regular_platform.build_flags} -[normal_240] -platform = ${core_2_4_0.platform} -build_flags = ${core_2_4_0.build_flags} ${common.build_flags} -lib_ignore = ${core_2_4_0.lib_ignore} - -[normal_241] -platform = ${core_2_4_1.platform} -build_flags = ${core_2_4_1.build_flags} ${common.build_flags} -lib_ignore = ${core_2_4_1.lib_ignore} - -[normal_242] -platform = ${core_2_4_2.platform} -build_flags = ${core_2_4_2.build_flags} ${common.build_flags} -lib_ignore = ${core_2_4_2.lib_ignore} - -[normal_252] -platform = ${core_2_5_2.platform} -build_flags = ${core_2_5_2.build_flags} ${common.build_flags} - [normal_beta] platform = ${beta_platform.platform} build_flags = ${beta_platform.build_flags} @@ -285,14 +244,9 @@ platform = ${core_2_4_2.platform} build_flags = ${core_2_4_2.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA board_upload.maximum_size = 616448 -[normal_252_ota] -platform = ${core_2_5_2.platform} -build_flags = ${core_2_5_2.build_flags} ${common.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA -board_upload.maximum_size = ${normal_242_ota.board_upload.maximum_size} - -[normal_260_ota] -platform = ${core_2_6_0.platform} -build_flags = ${core_2_6_0.build_flags} ${common.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA +[normal_261_ota] +platform = ${core_2_6_1.platform} +build_flags = ${core_2_6_1.build_flags} ${common.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA board_upload.maximum_size = ${normal_242_ota.board_upload.maximum_size} [normal_beta_ota] @@ -303,7 +257,7 @@ board_upload.maximum_size = ${normal_242_ota.board_upload.maximum_size} [ir] platform = ${regular_platform.platform} build_flags = ${regular_platform.build_flags} -lib_ignore = ESP32_ping, ESP32WebServer +lib_ignore = ESP32_ping, ESP32WebServer, SD(esp8266), SDFS [minimal_ir] platform = ${ir.platform} @@ -334,14 +288,6 @@ lib_ignore = ${ir.lib_ignore} platform = ${regular_platform.platform} build_flags = ${regular_platform.build_flags} -DPLUGIN_BUILD_TESTING -[testing_242] -platform = ${core_2_4_2.platform} -build_flags = ${core_2_4_2.build_flags} ${common.build_flags} -DPLUGIN_BUILD_TESTING - -[testing_252] -platform = ${core_2_5_2.platform} -build_flags = ${core_2_5_2.build_flags} ${common.build_flags} -DPLUGIN_BUILD_TESTING - [testing_beta] platform = ${beta_platform.platform} build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_TESTING @@ -590,18 +536,6 @@ board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} build_unflags = ${esp8285_1M.build_unflags} -[env:normal_core_241_ESP8266_1M] -platform = ${normal_241.platform} -build_flags = ${normal_241.build_flags} ${esp8266_1M.build_flags} -lib_ignore = ${normal_241.lib_ignore} -board = ${esp8266_1M.board} -board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -build_unflags = ${esp8266_1M.build_unflags} - - - ; NORMAL: 2048k WROOM02 version -------------------------- [env:normal_WROOM02_2M] platform = ${normal.platform} @@ -616,8 +550,8 @@ build_unflags = ${espWroom2M.build_unflags} ; NORMAL: 2048k WROOM02 version 256k SPIFFS -------------------------- -[env:normal_core_252_WROOM02_2M256] -platform = ${normal_252.platform} +[env:normal_WROOM02_2M256] +platform = ${normal.platform} build_flags = ${espWroom2M256.build_flags} ${normal_252.build_flags} board = ${espWroom2M256.board} board_upload.maximum_size = ${espWroom2M256.board_upload.maximum_size} @@ -639,42 +573,15 @@ board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} build_unflags = ${esp8266_4M1M.build_unflags} -[env:normal_core_241_ESP8266_4M1M] -platform = ${normal_241.platform} -build_flags = ${normal_241.build_flags} ${esp8266_4M1M.build_flags} -lib_ignore = ${normal_241.lib_ignore} -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} - - -[env:normal_core_252_ESP8266_16M] -platform = ${normal_252.platform} -build_flags = ${normal_252.build_flags} ${esp8266_16M.build_flags} +[env:normal_ESP8266_16M] +platform = ${normal.platform} +build_flags = ${normal.build_flags} ${esp8266_16M.build_flags} board = ${esp8266_16M.board} board_build.f_cpu = ${esp8266_16M.board_build.f_cpu} board_build.flash_mode = ${esp8266_16M.board_build.flash_mode} build_unflags = ${esp8266_16M.build_unflags} -[env:normal_core_260_sdk222_alpha_ESP8266_4M1M] -platform = ${testing_beta.platform} -build_flags = ${esp8266_4M1M.build_flags} ${normal_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} - - -[env:normal_core_260_sdk222_alpha_ESP8266_16M] -platform = ${testing_beta.platform} -build_flags = ${esp8266_16M.build_flags} ${normal_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y -board = ${esp8266_16M.board} -board_build.f_cpu = ${esp8266_16M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_16M.board_build.flash_mode} -build_unflags = ${esp8266_16M.build_unflags} - ;;; Minimal *********************************************************** @@ -703,47 +610,25 @@ build_unflags = ${esp8285_1M.build_unflags} build_flags = ${esp8285_1M.build_flags} ${normal_242_ota.build_flags} - -[env:minimal_core_252_ESP8266_1M_OTA] -platform = ${normal_252_ota.platform} -board_upload.maximum_size = ${normal_252_ota.board_upload.maximum_size} -board = ${esp8266_1M.board} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -build_unflags = ${esp8266_1M.build_unflags} -build_flags = ${esp8266_1M.build_flags} ${normal_252_ota.build_flags} - - - -[env:minimal_core_252_ESP8285_1M_OTA] -platform = ${normal_252_ota.platform} -board_upload.maximum_size = ${normal_252_ota.board_upload.maximum_size} -board = ${esp8285_1M.board} -board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -build_unflags = ${esp8285_1M.build_unflags} -build_flags = ${esp8285_1M.build_flags} ${normal_252_ota.build_flags} - - -[env:minimal_core_260_ESP8266_1M_OTA] -platform = ${normal_260_ota.platform} -board_upload.maximum_size = ${normal_260_ota.board_upload.maximum_size} +[env:minimal_core_261_ESP8266_1M_OTA] +platform = ${normal_261_ota.platform} +board_upload.maximum_size = ${normal_261_ota.board_upload.maximum_size} board = ${esp8266_1M.board} board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} build_unflags = ${esp8266_1M.build_unflags} -build_flags = ${esp8266_1M.build_flags} ${normal_260_ota.build_flags} +build_flags = ${esp8266_1M.build_flags} ${normal_261_ota.build_flags} -[env:minimal_core_260_ESP8285_1M_OTA] -platform = ${normal_260_ota.platform} -board_upload.maximum_size = ${normal_260_ota.board_upload.maximum_size} +[env:minimal_core_261_ESP8285_1M_OTA] +platform = ${normal_261_ota.platform} +board_upload.maximum_size = ${normal_261_ota.board_upload.maximum_size} board = ${esp8285_1M.board} board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} build_unflags = ${esp8285_1M.build_unflags} -build_flags = ${esp8285_1M.build_flags} ${normal_260_ota.build_flags} +build_flags = ${esp8285_1M.build_flags} ${normal_261_ota.build_flags} @@ -803,92 +688,17 @@ board_build.f_cpu = ${esp8266_4M2M.board_build.f_cpu} board_build.flash_mode = ${esp8266_4M2M.board_build.flash_mode} -; - - - - - -; TESTING ************************************************************* -; additional plugins (and dependend code) that are in test-stadium -; ********************************************************************* - -; TEST: 1024k version ---------------------------- -;[env:test_ESP8266_1M] -;platform = ${testing.platform} -;build_flags = ${esp8266_1M.build_flags} ${testing.build_flags} -;board = ${esp8266_1M.board} -;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;build_unflags = ${esp8266_1M.build_unflags} - -; - - -; TEST: 1024k for esp8285 ------------------------ -;[env:test_ESP8285_1M] -;platform = ${testing.platform} -;build_flags = ${esp8285_1M.build_flags} ${testing.build_flags} -;board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size} -;board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -;board = ${esp8285_1M.board} -;build_unflags = ${esp8285_1M.build_unflags} - -; - - - -; TEST: 4096k version ---------------------------- -;[env:test_core_242_ESP8266_4M1M] -;platform = ${testing_242.platform} -;build_flags = ${esp8266_4M1M.build_flags} ${testing_242.build_flags} -;board = ${esp8266_4M1M.board} -;board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -;build_unflags = ${esp8266_4M1M.build_unflags} - - - -;[env:test_core_252_ESP8266_4M1M] -;platform = ${testing_252.platform} -;build_flags = ${esp8266_4M1M.build_flags} ${testing_252.build_flags} -;board = ${esp8266_4M1M.board} -;board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -;build_unflags = ${esp8266_4M1M.build_unflags} - - -[env:test_core_260_sdk222_alpha_ESP8266_4M1M] +[env:test_beta_ESP8266_4M1M] platform = ${testing_beta.platform} -build_flags = ${esp8266_4M1M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y +build_flags = ${esp8266_4M1M.build_flags} ${testing_beta.build_flags} board = ${esp8266_4M1M.board} board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} build_unflags = ${esp8266_4M1M.build_unflags} -[env:test_core_260_sdk3_alpha_ESP8266_4M1M] -platform = ${testing_beta.platform} -build_flags = ${esp8266_4M1M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} - - -;[env:test_core_252_ESP8266_16M] -;platform = ${testing_252.platform} -;build_flags = ${esp8266_16M.build_flags} ${testing_252.build_flags} -;board = ${esp8266_16M.board} -;board_build.f_cpu = ${esp8266_16M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_16M.board_build.flash_mode} -;build_unflags = ${esp8266_16M.build_unflags} - - -[env:test_core_260_sdk222_alpha_ESP8266_16M] +[env:test_beta_ESP8266_16M] platform = ${testing_beta.platform} build_flags = ${esp8266_16M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y board = ${esp8266_16M.board} @@ -897,29 +707,6 @@ board_build.flash_mode = ${esp8266_16M.board_build.flash_mode} build_unflags = ${esp8266_16M.build_unflags} - - -;[env:test_core_260_sdk3_alpha_ESP8266_16M] -;platform = ${testing_beta.platform} -;build_flags = ${esp8266_16M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 -;board = ${esp8266_16M.board} -;board_build.f_cpu = ${esp8266_16M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_16M.board_build.flash_mode} -;build_unflags = ${esp8266_16M.build_unflags} - - - -; TEST: 1024k version + FEATURE_ADC_VCC ---------- -;[env:test_ESP8266_1M_VCC] -;platform = ${testing.platform} -;build_flags = ${esp8266_1M.build_flags} ${testing.build_flags} -D FEATURE_ADC_VCC=true -;board = ${common.board} -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;build_unflags = ${esp8266_1M.build_unflags} - - - ; TEST: 4096k version + FEATURE_ADC_VCC ---------- [env:test_ESP8266_4M_VCC] platform = ${testing.platform} @@ -938,28 +725,6 @@ build_unflags = ${esp8266_4M1M.build_unflags} ; additional plugins (and dependend code) that is in development (probably broken or incomplete) ; ********************************************************************* -; DEV : 1024k version ---------------------------- -;[env:dev_ESP8266_1M] -;platform = ${dev.platform} -;build_flags = ${esp8266_1M.build_flags} ${dev.build_flags} -;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size} -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;board = ${esp8266_1M.board} -;build_unflags = ${esp8266_1M.build_unflags} - - -; DEV: 1024k for esp8285 ------------------------- -;[env:dev_ESP8285_1M] -;platform = ${dev.platform} -;build_flags = ${esp8285_1M.build_flags} ${dev.build_flags} -;board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size} -;board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -;board = ${esp8285_1M.board} -;build_unflags = ${esp8285_1M.build_unflags} - - ; DEV : 4096k version ---------------------------- [env:dev_ESP8266_4M1M] platform = ${dev.platform} @@ -1022,18 +787,6 @@ board = ${esp8266_4M1M.board} build_unflags = ${esp8266_4M1M.build_unflags} - - -;[env:hard_core_252_SONOFF_POW_4M1M] -;platform = ${normal_252.platform} -;build_flags = ${normal_252.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW -;board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -;board = ${esp8266_4M1M.board} -;build_unflags = ${esp8266_4M1M.build_unflags} - - - ; Build including power measurement plugins for those devices that have only 1M flash. ; For example those made by BlitzWolf SHP [env:hard_other_POW_ESP8285_1M] @@ -1046,15 +799,6 @@ build_unflags = ${esp8285_1M.build_unflags} -;[env:hard_core_252_other_POW_ESP8285_1M] -;platform = ${normal_252.platform} -;build_flags = ${normal_252.build_flags} ${esp8285_1M.build_flags} -D PLUGIN_SET_SONOFF_POW -;board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -;board = ${esp8285_1M.board} -;build_unflags = ${esp8285_1M.build_unflags} - - ; ITEAD / SONOFF S20 version -------------------- ;[env:hard_SONOFF_S20] ;platform = ${esp8266_1M.platform} diff --git a/pre_extra_script.py b/pre_extra_script.py index 6a40f52644..74b70ab83f 100644 --- a/pre_extra_script.py +++ b/pre_extra_script.py @@ -13,7 +13,6 @@ # - frameworks # - dependent libraries env.Append(CPPDEFINES=[ - "PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y" # ,"NO_HTTP_UPDATER" # ,("WEBSERVER_RULES_DEBUG", "0") ]) From ae0143b8cb27063c77b9d6754f7f36ed42829ce7 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Sat, 16 Nov 2019 10:30:34 +0100 Subject: [PATCH 02/15] [PIO] Update .travis.yml with new env names --- .travis.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81c4fbba37..d263bce66d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,31 +33,34 @@ script: # - cppcheck --enable=warning src/*.ino -q --force -I src --include=src/ESPEasy.ino --error-exitcode=1 # - ./memanalyzer.py ~/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-objdump # - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run --target clean + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP32_4M316k - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP8266_4M1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP8266_4M2M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e dev_ESP8266_4M1M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e esp-wrover-kit_test_4M316k - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e esp32test_4M316k + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_SONOFF_POW_4M1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_Shelly_1_2M256 + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_Ventus_W266 + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_other_POW_ESP8285_1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_IRext_ESP8266_1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_IRext_ESP8266_4M1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_IRext_ESP8266_4M2M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_242_ESP8266_1M_OTA + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_242_ESP8285_1M_OTA + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_261_ESP8266_1M_OTA + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_261_ESP8285_1M_OTA + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8266_16M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8266_1M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8266_1M_VCC - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8285_1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_core_241_ESP8266_1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_WROOM02_2M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_core_252_WROOM02_2M256 - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8266_4M1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_core_241_ESP8266_4M1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_core_260_sdk222_alpha_ESP8266_4M1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_242_ESP8266_1M_OTA - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_242_ESP8285_1M_OTA - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_252_ESP8266_1M_OTA - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_252_ESP8285_1M_OTA - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_IRext_ESP8266_1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_IRext_ESP8266_4M2M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8285_1M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_IRext_no_rx_ESP8266_4M2M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_core_260_sdk222_alpha_ESP8266_4M1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_core_260_sdk3_alpha_ESP8266_4M1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_WROOM02_2M256 + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_WROOM02_2M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_ESP8266_4M_VCC - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e dev_ESP8266_4M1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_SONOFF_POW_4M1M - + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_beta_ESP8266_16M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_beta_ESP8266_4M1M before_deploy: - ./before_deploy From 761dac1f0d10337c7a003925e3761db1ff34e5b3 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Sat, 16 Nov 2019 17:02:37 +0100 Subject: [PATCH 03/15] [Cleanup] Make timing stats optional to reduce size --- platformio.ini | 1 - src/Controller.ino | 71 ++++++++++++++ src/ESPEasy-Globals.h | 30 ------ src/ESPEasy.ino | 70 +------------- src/ESPEasyStatistics.ino | 7 ++ src/WebServer.ino | 2 + src/WebServer_JSON.ino | 2 + src/define_plugin_sets.h | 21 +++++ src/src/DataStructs/TimingStats.cpp | 3 + src/src/DataStructs/TimingStats.h | 139 ++++++++++++++++------------ 10 files changed, 187 insertions(+), 159 deletions(-) diff --git a/platformio.ini b/platformio.ini index 7f32104ca7..136e25cbe1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -197,7 +197,6 @@ build_flags = ${debug_flags.build_flags} ${mqtt_flags.build_flags} build_unflags = -DDEBUG_ESP_PORT lib_deps = https://github.com/TD-er/ESPEasySerial.git lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR, SD(esp8266), SDFS -;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR lib_ldf_mode = chain lib_archive = false upload_speed = 115200 diff --git a/src/Controller.ino b/src/Controller.ino index 6872659895..62bdeb3256 100644 --- a/src/Controller.ino +++ b/src/Controller.ino @@ -419,3 +419,74 @@ void MQTTStatus(const String& status) } } #endif //USES_MQTT + + + +/*********************************************************************************************\ + * send all sensordata +\*********************************************************************************************/ +// void SensorSendAll() +// { +// for (taskIndex_t x = 0; x < TASKS_MAX; x++) +// { +// SensorSendTask(x); +// } +// } + + +/*********************************************************************************************\ + * send specific sensor task data +\*********************************************************************************************/ +void SensorSendTask(taskIndex_t TaskIndex) +{ + if (!validTaskIndex(TaskIndex)) return; + checkRAM(F("SensorSendTask")); + if (Settings.TaskDeviceEnabled[TaskIndex]) + { + byte varIndex = TaskIndex * VARS_PER_TASK; + + bool success = false; + const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(TaskIndex); + if (!validDeviceIndex(DeviceIndex)) return; + + LoadTaskSettings(TaskIndex); + + struct EventStruct TempEvent; + TempEvent.TaskIndex = TaskIndex; + TempEvent.BaseVarIndex = varIndex; + // TempEvent.idx = Settings.TaskDeviceID[TaskIndex]; todo check + TempEvent.sensorType = Device[DeviceIndex].VType; + + float preValue[VARS_PER_TASK]; // store values before change, in case we need it in the formula + for (byte varNr = 0; varNr < VARS_PER_TASK; varNr++) + preValue[varNr] = UserVar[varIndex + varNr]; + + if(Settings.TaskDeviceDataFeed[TaskIndex] == 0) // only read local connected sensorsfeeds + { + String dummy; + success = PluginCall(PLUGIN_READ, &TempEvent, dummy); + } + else + success = true; + + if (success) + { + START_TIMER; + for (byte varNr = 0; varNr < VARS_PER_TASK; varNr++) + { + if (ExtraTaskSettings.TaskDeviceFormula[varNr][0] != 0) + { + String formula = ExtraTaskSettings.TaskDeviceFormula[varNr]; + formula.replace(F("%pvalue%"), String(preValue[varNr])); + formula.replace(F("%value%"), String(UserVar[varIndex + varNr])); + float result = 0; + byte error = Calculate(formula.c_str(), &result); + if (error == 0) + UserVar[varIndex + varNr] = result; + } + } + STOP_TIMER(COMPUTE_FORMULA_STATS); + sendData(&TempEvent); + } + } +} \ No newline at end of file diff --git a/src/ESPEasy-Globals.h b/src/ESPEasy-Globals.h index 2016330dac..e216a9463d 100644 --- a/src/ESPEasy-Globals.h +++ b/src/ESPEasy-Globals.h @@ -356,36 +356,6 @@ extern boolean UseRTOSMultitasking; // void (*MainLoopCall_ptr)(void); //FIXME TD-er: No idea what this does. -/* -String getLogLine(const TimingStats& stats) { - unsigned long minVal, maxVal; - unsigned int c = stats.getMinMax(minVal, maxVal); - String log; - log.reserve(64); - log += F("Count: "); - log += c; - log += F(" Avg/min/max "); - log += stats.getAvg(); - log += '/'; - log += minVal; - log += '/'; - log += maxVal; - log += F(" usec"); - return log; -} -*/ - - - - - - - - - - - - #include "src/DataStructs/DeviceModel.h" diff --git a/src/ESPEasy.ino b/src/ESPEasy.ino index 20870e26e7..7b6c2fd695 100644 --- a/src/ESPEasy.ino +++ b/src/ESPEasy.ino @@ -476,7 +476,9 @@ void updateLoopStats() { return; } const long usecSince = usecPassedSince(lastLoopStart); + #ifdef USES_TIMING_STATS miscStats[LOOP_STATS].add(usecSince); + #endif loop_usec_duration_total += usecSince; lastLoopStart = micros(); @@ -881,74 +883,6 @@ void runEach30Seconds() } -/*********************************************************************************************\ - * send all sensordata -\*********************************************************************************************/ -// void SensorSendAll() -// { -// for (taskIndex_t x = 0; x < TASKS_MAX; x++) -// { -// SensorSendTask(x); -// } -// } - - -/*********************************************************************************************\ - * send specific sensor task data -\*********************************************************************************************/ -void SensorSendTask(taskIndex_t TaskIndex) -{ - if (!validTaskIndex(TaskIndex)) return; - checkRAM(F("SensorSendTask")); - if (Settings.TaskDeviceEnabled[TaskIndex]) - { - byte varIndex = TaskIndex * VARS_PER_TASK; - - bool success = false; - const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(TaskIndex); - if (!validDeviceIndex(DeviceIndex)) return; - - LoadTaskSettings(TaskIndex); - - struct EventStruct TempEvent; - TempEvent.TaskIndex = TaskIndex; - TempEvent.BaseVarIndex = varIndex; - // TempEvent.idx = Settings.TaskDeviceID[TaskIndex]; todo check - TempEvent.sensorType = Device[DeviceIndex].VType; - - float preValue[VARS_PER_TASK]; // store values before change, in case we need it in the formula - for (byte varNr = 0; varNr < VARS_PER_TASK; varNr++) - preValue[varNr] = UserVar[varIndex + varNr]; - - if(Settings.TaskDeviceDataFeed[TaskIndex] == 0) // only read local connected sensorsfeeds - { - String dummy; - success = PluginCall(PLUGIN_READ, &TempEvent, dummy); - } - else - success = true; - - if (success) - { - START_TIMER; - for (byte varNr = 0; varNr < VARS_PER_TASK; varNr++) - { - if (ExtraTaskSettings.TaskDeviceFormula[varNr][0] != 0) - { - String formula = ExtraTaskSettings.TaskDeviceFormula[varNr]; - formula.replace(F("%pvalue%"), String(preValue[varNr])); - formula.replace(F("%value%"), String(UserVar[varIndex + varNr])); - float result = 0; - byte error = Calculate(formula.c_str(), &result); - if (error == 0) - UserVar[varIndex + varNr] = result; - } - } - STOP_TIMER(COMPUTE_FORMULA_STATS); - sendData(&TempEvent); - } - } -} /*********************************************************************************************\ diff --git a/src/ESPEasyStatistics.ino b/src/ESPEasyStatistics.ino index cf722535f4..73bf6cd8af 100644 --- a/src/ESPEasyStatistics.ino +++ b/src/ESPEasyStatistics.ino @@ -1,3 +1,7 @@ +#include "define_plugin_sets.h" + +#ifdef USES_TIMING_STATS + /* void logStatistics(byte loglevel, bool clearStats) { if (loglevelActiveFor(loglevel)) { @@ -91,3 +95,6 @@ void jsonStatistics(bool clearStats) { stream_json_end_object_element(true); // end "plugin" object stream_json_end_array_element(true); // end "plugin" array } + + +#endif \ No newline at end of file diff --git a/src/WebServer.ino b/src/WebServer.ino index 13d579f0e4..c850ddee4f 100644 --- a/src/WebServer.ino +++ b/src/WebServer.ino @@ -317,10 +317,12 @@ void sendHeadandTail(const String& tmplName, boolean Tail = false, boolean reboo // This function is called twice per serving a web page. // So it must keep track of the timer longer than the scope of this function. // Therefore use a local static variable. + #ifdef USES_TIMING_STATS static unsigned statisticsTimerStart = 0; if (!Tail) { statisticsTimerStart = micros(); } + #endif String pageTemplate = ""; String fileName = tmplName; diff --git a/src/WebServer_JSON.ino b/src/WebServer_JSON.ino index ed0f5df026..aa4551576b 100644 --- a/src/WebServer_JSON.ino +++ b/src/WebServer_JSON.ino @@ -287,7 +287,9 @@ void stream_json_end_object_element(bool isLast) { void handle_timingstats_json() { TXBuffer.startJsonStream(); TXBuffer += '{'; + #ifdef USES_TIMING_STATS jsonStatistics(false); + #endif TXBuffer += '}'; TXBuffer.endStream(); } diff --git a/src/define_plugin_sets.h b/src/define_plugin_sets.h index 35e2e9066c..c0304920c1 100644 --- a/src/define_plugin_sets.h +++ b/src/define_plugin_sets.h @@ -110,8 +110,13 @@ To create/register a plugin, you have to : #ifndef USES_SSDP #define USES_SSDP #endif + #ifndef USES_TIMING_STATS + #define USES_TIMING_STATS + #endif #endif + + #ifdef MEMORY_ANALYSIS #ifdef MQTT_ONLY #define USES_C002 // Domoticz MQTT @@ -237,6 +242,9 @@ To create/register a plugin, you have to : #undef USE_SETTINGS_ARCHIVE #endif // USE_SETTINGS_ARCHIVE + #ifdef USES_TIMING_STATS + #undef USES_TIMING_STATS + #endif #ifndef USES_P001 #define USES_P001 // switch @@ -981,4 +989,17 @@ To create/register a plugin, you have to : #endif #endif + + +// Timing stats page needs timing stats +#if defined(WEBSERVER_TIMINGSTATS) && !defined(USES_TIMING_STATS) + #define USES_TIMING_STATS +#endif + +// If timing stats page is not included, there is no need in collecting the stats +#if !defined(WEBSERVER_TIMINGSTATS) && defined(USES_TIMING_STATS) + #undef USES_TIMING_STATS +#endif + + #endif // DEFINE_PLUGIN_SETS_H \ No newline at end of file diff --git a/src/src/DataStructs/TimingStats.cpp b/src/src/DataStructs/TimingStats.cpp index ffcd426f0b..5263a17695 100644 --- a/src/src/DataStructs/TimingStats.cpp +++ b/src/src/DataStructs/TimingStats.cpp @@ -3,6 +3,7 @@ #include "../../ESPEasy_plugindefs.h" #include "../../_CPlugin_Helper.h" +#ifdef USES_TIMING_STATS std::map pluginStats; @@ -225,3 +226,5 @@ String getMiscStatsName(int stat) { } return getUnknownString(); } + +#endif \ No newline at end of file diff --git a/src/src/DataStructs/TimingStats.h b/src/src/DataStructs/TimingStats.h index c1b218d8ce..b19171b513 100644 --- a/src/src/DataStructs/TimingStats.h +++ b/src/src/DataStructs/TimingStats.h @@ -1,8 +1,12 @@ #ifndef DATASTRUCTS_TIMINGSTATS_H #define DATASTRUCTS_TIMINGSTATS_H -#include -#include +#include "../../define_plugin_sets.h" + +#ifdef USES_TIMING_STATS + +# include +# include /*********************************************************************************************\ @@ -10,60 +14,60 @@ \*********************************************************************************************/ -#define LOADFILE_STATS 0 -#define SAVEFILE_STATS 1 -#define LOOP_STATS 2 -#define PLUGIN_CALL_50PS 3 -#define PLUGIN_CALL_10PS 4 -#define PLUGIN_CALL_10PSU 5 -#define PLUGIN_CALL_1PS 6 -#define SENSOR_SEND_TASK 7 -#define SEND_DATA_STATS 8 -#define COMPUTE_FORMULA_STATS 9 -#define PROC_SYS_TIMER 10 -#define SET_NEW_TIMER 11 -#define TIME_DIFF_COMPUTE 12 -#define MQTT_DELAY_QUEUE 13 -#define C001_DELAY_QUEUE 14 -#define C002_DELAY_QUEUE 15 -#define C003_DELAY_QUEUE 16 -#define C004_DELAY_QUEUE 17 -#define C005_DELAY_QUEUE 18 -#define C006_DELAY_QUEUE 19 -#define C007_DELAY_QUEUE 20 -#define C008_DELAY_QUEUE 21 -#define C009_DELAY_QUEUE 22 -#define C010_DELAY_QUEUE 23 -#define C011_DELAY_QUEUE 24 -#define C012_DELAY_QUEUE 25 -#define C013_DELAY_QUEUE 26 -#define C014_DELAY_QUEUE 27 -#define C015_DELAY_QUEUE 28 -#define C016_DELAY_QUEUE 29 -#define C017_DELAY_QUEUE 30 -#define C018_DELAY_QUEUE 31 -#define C019_DELAY_QUEUE 32 -#define C020_DELAY_QUEUE 33 -#define TRY_CONNECT_HOST_TCP 34 -#define TRY_CONNECT_HOST_UDP 35 -#define HOST_BY_NAME_STATS 36 -#define CONNECT_CLIENT_STATS 37 -#define LOAD_CUSTOM_TASK_STATS 38 -#define WIFI_ISCONNECTED_STATS 39 -#define WIFI_NOTCONNECTED_STATS 40 -#define LOAD_TASK_SETTINGS 41 -#define TRY_OPEN_FILE 42 -#define SPIFFS_GC_SUCCESS 43 -#define SPIFFS_GC_FAIL 44 -#define PARSE_SYSVAR 45 -#define PARSE_SYSVAR_NOCHANGE 46 -#define PARSE_TEMPLATE 47 -#define RULES_PROCESSING 48 -#define GRAT_ARP_STATS 49 -#define BACKGROUND_TASKS 50 -#define HANDLE_SCHEDULER_IDLE 51 -#define HANDLE_SCHEDULER_TASK 52 -#define HANDLE_SERVING_WEBPAGE 53 +# define LOADFILE_STATS 0 +# define SAVEFILE_STATS 1 +# define LOOP_STATS 2 +# define PLUGIN_CALL_50PS 3 +# define PLUGIN_CALL_10PS 4 +# define PLUGIN_CALL_10PSU 5 +# define PLUGIN_CALL_1PS 6 +# define SENSOR_SEND_TASK 7 +# define SEND_DATA_STATS 8 +# define COMPUTE_FORMULA_STATS 9 +# define PROC_SYS_TIMER 10 +# define SET_NEW_TIMER 11 +# define TIME_DIFF_COMPUTE 12 +# define MQTT_DELAY_QUEUE 13 +# define C001_DELAY_QUEUE 14 +# define C002_DELAY_QUEUE 15 +# define C003_DELAY_QUEUE 16 +# define C004_DELAY_QUEUE 17 +# define C005_DELAY_QUEUE 18 +# define C006_DELAY_QUEUE 19 +# define C007_DELAY_QUEUE 20 +# define C008_DELAY_QUEUE 21 +# define C009_DELAY_QUEUE 22 +# define C010_DELAY_QUEUE 23 +# define C011_DELAY_QUEUE 24 +# define C012_DELAY_QUEUE 25 +# define C013_DELAY_QUEUE 26 +# define C014_DELAY_QUEUE 27 +# define C015_DELAY_QUEUE 28 +# define C016_DELAY_QUEUE 29 +# define C017_DELAY_QUEUE 30 +# define C018_DELAY_QUEUE 31 +# define C019_DELAY_QUEUE 32 +# define C020_DELAY_QUEUE 33 +# define TRY_CONNECT_HOST_TCP 34 +# define TRY_CONNECT_HOST_UDP 35 +# define HOST_BY_NAME_STATS 36 +# define CONNECT_CLIENT_STATS 37 +# define LOAD_CUSTOM_TASK_STATS 38 +# define WIFI_ISCONNECTED_STATS 39 +# define WIFI_NOTCONNECTED_STATS 40 +# define LOAD_TASK_SETTINGS 41 +# define TRY_OPEN_FILE 42 +# define SPIFFS_GC_SUCCESS 43 +# define SPIFFS_GC_FAIL 44 +# define PARSE_SYSVAR 45 +# define PARSE_SYSVAR_NOCHANGE 46 +# define PARSE_TEMPLATE 47 +# define RULES_PROCESSING 48 +# define GRAT_ARP_STATS 49 +# define BACKGROUND_TASKS 50 +# define HANDLE_SCHEDULER_IDLE 51 +# define HANDLE_SCHEDULER_TASK 52 +# define HANDLE_SERVING_WEBPAGE 53 class TimingStats { public: @@ -99,13 +103,28 @@ extern std::map controllerStats; extern std::map miscStats; extern unsigned long timingstats_last_reset; -#define START_TIMER const unsigned statisticsTimerStart(micros()); -#define STOP_TIMER_TASK(T, F) \ +# define START_TIMER const unsigned statisticsTimerStart(micros()); +# define STOP_TIMER_TASK(T, F) \ if (mustLogFunction(F)) pluginStats[(T) * 256 + (F)].add(usecPassedSince(statisticsTimerStart)); -#define STOP_TIMER_CONTROLLER(T, F) \ +# define STOP_TIMER_CONTROLLER(T, F) \ if (mustLogCFunction(F)) controllerStats[(T) * 256 + (F)].add(usecPassedSince(statisticsTimerStart)); // #define STOP_TIMER_LOADFILE miscStats[LOADFILE_STATS].add(usecPassedSince(statisticsTimerStart)); -#define STOP_TIMER(L) miscStats[L].add(usecPassedSince(statisticsTimerStart)); +# define STOP_TIMER(L) miscStats[L].add(usecPassedSince(statisticsTimerStart)); + +#else // ifdef USES_TIMING_STATS + +# define START_TIMER +# define STOP_TIMER_TASK(T, F) ; +# define STOP_TIMER_CONTROLLER(T, F) ; +# define STOP_TIMER(L) ; + + +// FIXME TD-er: This class is used as a parameter in functions defined in .ino files. +// The Arduino build process tries to forward declare all functions it can find, regardless of defines. +// Meaning we must make sure the forward declaration of the TimingStats class is made, since it is used as an argument in some function. +class TimingStats; + +#endif // ifdef USES_TIMING_STATS #endif // DATASTRUCTS_TIMINGSTATS_H From 588b551017c85cb147b1234d40c11e0462d31244 Mon Sep 17 00:00:00 2001 From: TD-er Date: Mon, 18 Nov 2019 00:33:35 +0100 Subject: [PATCH 04/15] [PIO] Reduce platformio.ini complexity by using extends --- .gitignore | 2 + platformio.ini | 312 ++++++++++++++++--------------------------------- 2 files changed, 101 insertions(+), 213 deletions(-) diff --git a/.gitignore b/.gitignore index 38b67aeb0e..fe9bf03c63 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ tools/vagrant/.vagrant/ tools/vagrant/build/ tools/vagrant/Custom.h + +.buildcache/ diff --git a/platformio.ini b/platformio.ini index 136e25cbe1..3ed9a071f7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,7 @@ ;env_default = normal_ESP8266_1024 ;env_default = normal_ESP8266_4096 ; ..etc - +build_cache_dir = $PROJECT_DIR\.buildcache ;minimal version for esps with 512K or less flash (only has minimal plugin set) @@ -191,7 +191,12 @@ build_flags = [mqtt_flags] build_flags = -DMQTT_MAX_PACKET_SIZE=1024 -[common] +[debug_pio] +build_type = debug +check_tool = clangtidy + + +[esp82xx_common] board_build.f_cpu = 80000000L build_flags = ${debug_flags.build_flags} ${mqtt_flags.build_flags} -DHTTPCLIENT_1_1_COMPATIBLE=0 build_unflags = -DDEBUG_ESP_PORT @@ -206,6 +211,10 @@ monitor_speed = 115200 ;targets = size, checkprogsize targets = + +[common] +extends = esp82xx_common + [env] framework = ${common.framework} lib_ldf_mode = ${common.lib_ldf_mode} @@ -238,21 +247,6 @@ platform = ${beta_platform.platform} build_flags = ${beta_platform.build_flags} -[normal_242_ota] -platform = ${core_2_4_2.platform} -build_flags = ${core_2_4_2.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA -board_upload.maximum_size = 616448 - -[normal_261_ota] -platform = ${core_2_6_1.platform} -build_flags = ${core_2_6_1.build_flags} ${common.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA -board_upload.maximum_size = ${normal_242_ota.board_upload.maximum_size} - -[normal_beta_ota] -platform = ${beta_platform.platform} -build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA -board_upload.maximum_size = ${normal_242_ota.board_upload.maximum_size} - [ir] platform = ${regular_platform.platform} build_flags = ${regular_platform.build_flags} @@ -296,36 +290,50 @@ platform = ${beta_platform.platform} build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_DEV - -[esp8266_1M] -board = esp01_1m +[esp82xx_1M] +extends = esp82xx_common board_build.flash_mode = dout -board_build.f_cpu = ${common.board_build.f_cpu} board_upload.maximum_size = 786432 -build_unflags = ${regular_platform.build_unflags} build_flags = -Wl,-Tesp8266.flash.1m128.ld -DSIZE_1M -DBUILD_NO_DEBUG +[esp8266_1M] +extends = esp82xx_1M +board = esp01_1m + [esp8285_1M] +extends = esp82xx_1M +board = esp8285 +build_flags = ${esp8266_1M.build_flags} -DESP8285 + + +[esp82xx_1M_OTA] +extends = esp82xx_common +board_build.flash_mode = dout +board_upload.maximum_size = 616448 +build_flags = -Wl,-Tesp8266.flash.1m128.ld -DSIZE_1M -DBUILD_NO_DEBUG -DPLUGIN_BUILD_MINIMAL_OTA + + +[esp8266_1M_OTA] +extends = esp82xx_1M_OTA +board = esp01_1m + +[esp8285_1M_OTA] +extends = esp82xx_1M_OTA board = esp8285 -board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -build_unflags = ${esp8266_1M.build_unflags} build_flags = ${esp8266_1M.build_flags} -DESP8285 [esp8266_2M256] +extends = esp82xx_common board = esp12e board_build.flash_mode = dio -board_build.f_cpu = ${common.board_build.f_cpu} -build_unflags = ${regular_platform.build_unflags} +board_upload.maximum_size = 1044464 build_flags = -Wl,-Tesp8266.flash.2m256.ld [espWroom2M] -board_build.flash_mode = dout -board_build.f_cpu = ${common.board_build.f_cpu} +extends = esp82xx_common +board = esp12e +board_build.flash_mode = dio board_upload.maximum_size = 1044464 -board = esp_wroom_02 -build_unflags = ${common.build_unflags} build_flags = -Wl,-Tesp8266.flash.2m.ld [espWroom2M256] @@ -337,19 +345,17 @@ build_unflags = ${common.build_unflags} build_flags = -Wl,-Tesp8266.flash.2m256.ld [esp8266_4M1M] +extends = esp82xx_common board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 -board_build.f_cpu = ${common.board_build.f_cpu} -build_unflags = ${regular_platform.build_unflags} build_flags = -Wl,-Tesp8266.flash.4m1m.ld [esp8266_4M2M] +extends = esp82xx_common board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 -board_build.f_cpu = ${common.board_build.f_cpu} -build_unflags = ${regular_platform.build_unflags} build_flags = -Wl,-Tesp8266.flash.4m2m.ld @@ -358,49 +364,35 @@ build_flags = -Wl,-Tesp8266.flash.4m2m.ld ; Performance of 14M SPIFFS is really slow. ; See https://github.com/esp8266/Arduino/issues/5932 [esp8266_16M] +extends = esp82xx_common board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 -board_build.f_cpu = ${common.board_build.f_cpu} -build_unflags = ${regular_platform.build_unflags} build_flags = -Wl,-Tesp8266.flash.16m14m.ld -DSPIFFS_MAX_OPEN_FILES=20 ; Custom: 4M1M version -------------------------- [env:custom_ESP8266_4M1M] +extends = esp8266_4M1M platform = ${beta_platform.platform} -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM lib_ignore = ESP32_ping, ESP32WebServer - extra_scripts = pre:pre_extra_script.py [env:debug_custom_ESP8266_4M1M] -build_type = debug -check_tool = clangtidy +extends = esp8266_4M1M, debug_pio platform = ${beta_platform.platform} -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM -lib_ignore = ESP32_ping, ESP32WebServer - +;lib_ignore = ESP32_ping, ESP32WebServer extra_scripts = pre:pre_extra_script.py + ; Custom: 4M2M version -------------------------- [env:custom_ESP8266_4M2M] +extends = esp8266_4M2M platform = ${beta_platform.platform} -board = ${esp8266_4M2M.board} -board_build.f_cpu = ${esp8266_4M2M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M2M.board_build.flash_mode} -build_unflags = ${esp8266_4M2M.build_unflags} -build_flags = ${esp8266_4M2M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM +build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM lib_ignore = ESP32_ping, ESP32WebServer - extra_scripts = pre:pre_extra_script.py @@ -440,13 +432,10 @@ extra_scripts = pre:pre_custom_esp32.py ; This may generate builds which cannot be run, so do not upload to a node. ; Has the same lib_ignore as the IR builds, or else those cannot be built for testing [env:memanalyze_ESP8266] -platform = ${normal_252.platform} +extends = esp8266_4M1M +platform = ${regular.platform} lib_ignore = ESP32_ping, ESP32WebServer -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} -build_flags = ${esp8266_4M1M.build_flags} ${normal_252.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24 +build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24 extra_scripts = pre:pre_memanalyze.py @@ -505,130 +494,74 @@ board_upload.maximum_size = 1900544 ; NORMAL: 1024k version -------------------------- [env:normal_ESP8266_1M] -platform = ${normal.platform} -board = ${esp8266_1M.board} -board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -build_unflags = ${esp8266_1M.build_unflags} -build_flags = ${esp8266_1M.build_flags} ${normal.build_flags} +extends = esp8266_1M +platform = ${regular.platform} +build_flags = ${esp8266_1M.build_flags} [env:normal_ESP8266_1M_VCC] -platform = ${normal.platform} -board = ${esp8266_1M.board} -board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -build_unflags = ${esp8266_1M.build_unflags} -build_flags = ${esp8266_1M.build_flags} ${normal.build_flags} -D FEATURE_ADC_VCC=true +extends = esp8266_1M +platform = ${regular.platform} +build_flags = ${esp8266_1M.build_flags} -D FEATURE_ADC_VCC=true ; NORMAL: 1024k for esp8285 ---------------------- [env:normal_ESP8285_1M] -platform = ${normal.platform} -build_flags = ${esp8285_1M.build_flags} ${normal.build_flags} -board = ${esp8285_1M.board} -board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size} -board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -build_unflags = ${esp8285_1M.build_unflags} +extends = esp8285_1M +platform = ${regular.platform} +build_flags = ${esp8285_1M.build_flags} ; NORMAL: 2048k WROOM02 version -------------------------- [env:normal_WROOM02_2M] -platform = ${normal.platform} -build_flags = ${espWroom2M.build_flags} ${normal.build_flags} -board = ${espWroom2M.board} -board_upload.maximum_size = ${espWroom2M.board_upload.maximum_size} -board_build.f_cpu = ${espWroom2M.board_build.f_cpu} -board_build.flash_mode = ${espWroom2M.board_build.flash_mode} -build_unflags = ${espWroom2M.build_unflags} - - +extends = espWroom2M +platform = ${regular.platform} +build_flags = ${espWroom2M.build_flags} ${regular.build_flags} ; NORMAL: 2048k WROOM02 version 256k SPIFFS -------------------------- [env:normal_WROOM02_2M256] -platform = ${normal.platform} -build_flags = ${espWroom2M256.build_flags} ${normal_252.build_flags} -board = ${espWroom2M256.board} -board_upload.maximum_size = ${espWroom2M256.board_upload.maximum_size} -board_build.f_cpu = ${espWroom2M256.board_build.f_cpu} -board_build.flash_mode = ${espWroom2M256.board_build.flash_mode} -build_unflags = ${espWroom2M256.build_unflags} - - - +extends = espWroom2M256 +platform = ${regular.platform} +build_flags = ${espWroom2M256.build_flags} ${regular.build_flags} ; NORMAL: 4096k version -------------------------- [env:normal_ESP8266_4M1M] -platform = ${normal.platform} -build_flags = ${esp8266_4M1M.build_flags} ${normal.build_flags} -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} +extends = esp8266_4M1M +platform = ${regular.platform} +build_flags = ${esp8266_4M1M.build_flags} ${regular.build_flags} [env:normal_ESP8266_16M] -platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8266_16M.build_flags} -board = ${esp8266_16M.board} -board_build.f_cpu = ${esp8266_16M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_16M.board_build.flash_mode} -build_unflags = ${esp8266_16M.build_unflags} - - +extends = esp8266_16M +platform = ${regular.platform} +build_flags = ${esp8266_16M.build_flags} ${regular.build_flags} ;;; Minimal *********************************************************** ; Minimal build size for OTA ; ; ********************************************************************* - [env:minimal_core_242_ESP8266_1M_OTA] -platform = ${normal_242_ota.platform} -board_upload.maximum_size = ${normal_242_ota.board_upload.maximum_size} -board = ${esp8266_1M.board} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -build_unflags = ${esp8266_1M.build_unflags} -build_flags = ${esp8266_1M.build_flags} ${normal_242_ota.build_flags} - - +extends = esp8266_1M_OTA +platform = ${core_2_4_2.platform} +build_flags = ${esp8266_1M_OTA.build_flags} ${core_2_4_2.build_flags} [env:minimal_core_242_ESP8285_1M_OTA] -platform = ${normal_242_ota.platform} -board_upload.maximum_size = ${normal_242_ota.board_upload.maximum_size} -board = ${esp8285_1M.board} -board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -build_unflags = ${esp8285_1M.build_unflags} -build_flags = ${esp8285_1M.build_flags} ${normal_242_ota.build_flags} - +extends = esp8285_1M_OTA +platform = ${core_2_4_2.platform} +build_flags = ${esp8285_1M_OTA.build_flags} ${core_2_4_2.build_flags} [env:minimal_core_261_ESP8266_1M_OTA] -platform = ${normal_261_ota.platform} -board_upload.maximum_size = ${normal_261_ota.board_upload.maximum_size} -board = ${esp8266_1M.board} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -build_unflags = ${esp8266_1M.build_unflags} -build_flags = ${esp8266_1M.build_flags} ${normal_261_ota.build_flags} - - +extends = esp8266_1M_OTA +platform = ${regular.platform} +build_flags = ${esp8266_1M_OTA.build_flags} ${regular.build_flags} [env:minimal_core_261_ESP8285_1M_OTA] -platform = ${normal_261_ota.platform} -board_upload.maximum_size = ${normal_261_ota.board_upload.maximum_size} -board = ${esp8285_1M.board} -board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -build_unflags = ${esp8285_1M.build_unflags} -build_flags = ${esp8285_1M.build_flags} ${normal_261_ota.build_flags} - +extends = esp8285_1M_OTA +platform = ${regular.platform} +build_flags = ${esp8285_1M_OTA.build_flags} ${regular.build_flags} @@ -642,79 +575,57 @@ build_flags = ${esp8285_1M.build_flags} ${normal_261_ota.build_fla ; Build including IR libraries, including extended AC commands ; Minimal set of other plugins [env:minimal_IRext_ESP8266_1M] +extends = esp8266_1M platform = ${minimal_ir_extended.platform} lib_ignore = ${minimal_ir_extended.lib_ignore} build_flags = ${minimal_ir_extended.build_flags} ${esp8266_1M.build_flags} build_unflags = ${esp8266_1M.build_unflags} -DPLUGIN_BUILD_NORMAL_IR -board = ${esp8266_1M.board} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} - ; Minimal IR: 4096k version -------------------------- ; Build including IR libraries, INCLUDING extended AC commands ; Includes Extended IR AC commands (takes a lot more program space) [env:minimal_IRext_ESP8266_4M1M] +extends = esp8266_4M1M platform = ${minimal_ir_extended.platform} lib_ignore = ${minimal_ir_extended.lib_ignore} build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M1M.build_flags} -build_unflags = ${esp8266_4M1M.build_unflags} -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} + [env:minimal_IRext_ESP8266_4M2M] +extends = esp8266_4M2M platform = ${minimal_ir_extended.platform} lib_ignore = ${minimal_ir_extended.lib_ignore} build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M2M.build_flags} -build_unflags = ${esp8266_4M2M.build_unflags} -board = ${esp8266_4M2M.board} -board_build.f_cpu = ${esp8266_4M2M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M2M.board_build.flash_mode} ; NORMAL IR: 4096k version -------------------------- ; Build including IR libraries, INCLUDING extended AC commands ; Includes Extended IR AC commands (takes a lot more program space) [env:normal_IRext_no_rx_ESP8266_4M2M] +extends = esp8266_4M2M platform = ${normal_ir_extended_no_rx.platform} lib_ignore = ${normal_ir_extended_no_rx.lib_ignore} build_flags = ${normal_ir_extended_no_rx.build_flags} ${esp8266_4M2M.build_flags} -build_unflags = ${esp8266_4M2M.build_unflags} -board = ${esp8266_4M2M.board} -board_build.f_cpu = ${esp8266_4M2M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M2M.board_build.flash_mode} [env:test_beta_ESP8266_4M1M] +extends = esp8266_4M1M platform = ${testing_beta.platform} build_flags = ${esp8266_4M1M.build_flags} ${testing_beta.build_flags} -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} - [env:test_beta_ESP8266_16M] +extends = esp8266_16M platform = ${testing_beta.platform} build_flags = ${esp8266_16M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y -board = ${esp8266_16M.board} -board_build.f_cpu = ${esp8266_16M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_16M.board_build.flash_mode} -build_unflags = ${esp8266_16M.build_unflags} ; TEST: 4096k version + FEATURE_ADC_VCC ---------- [env:test_ESP8266_4M_VCC] +extends = esp8266_4M1M platform = ${testing.platform} build_flags = ${esp8266_4M1M.build_flags} ${testing.build_flags} -D FEATURE_ADC_VCC=true -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} - @@ -726,14 +637,9 @@ build_unflags = ${esp8266_4M1M.build_unflags} ; DEV : 4096k version ---------------------------- [env:dev_ESP8266_4M1M] +extends = esp8266_4M1M platform = ${dev.platform} build_flags = ${esp8266_4M1M.build_flags} ${dev.build_flags} -board = ${esp8266_4M1M.board} -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -build_unflags = ${esp8266_4M1M.build_unflags} - - @@ -778,24 +684,17 @@ build_unflags = ${esp8266_4M1M.build_unflags} ; GPIO12 Red Led and Relay (0 = Off, 1 = On) ; GPIO13 Blue Led (0 = On, 1 = Off) [env:hard_SONOFF_POW_4M1M] +extends = esp8266_4M1M platform = ${normal.platform} build_flags = ${normal.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW -board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode} -board = ${esp8266_4M1M.board} -build_unflags = ${esp8266_4M1M.build_unflags} ; Build including power measurement plugins for those devices that have only 1M flash. ; For example those made by BlitzWolf SHP [env:hard_other_POW_ESP8285_1M] +extends = esp8285_1M platform = ${normal.platform} build_flags = ${normal.build_flags} ${esp8285_1M.build_flags} -D PLUGIN_SET_SONOFF_POW -board_build.f_cpu = ${esp8285_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8285_1M.board_build.flash_mode} -board = ${esp8285_1M.board} -build_unflags = ${esp8285_1M.build_unflags} - ; ITEAD / SONOFF S20 version -------------------- @@ -835,26 +734,13 @@ build_unflags = ${esp8285_1M.build_unflags} ; GPIO04 Relay (non inverted) ; GPIO05 Button [env:hard_Shelly_1_2M256] +extends = esp8266_2M256 platform = ${normal.platform} build_flags = ${normal.build_flags} ${esp8266_2M256.build_flags} -D PLUGIN_SET_SHELLY_1 -board_build.f_cpu = ${esp8266_2M256.board_build.f_cpu} -board_build.flash_mode = ${esp8266_2M256.board_build.flash_mode} -board = ${esp8266_2M256.board} -build_unflags = ${esp8266_2M256.build_unflags} - - - - - - ; Ventus W266 weather station ; https://www.letscontrolit.com/wiki/index.php/VentusW266 [env:hard_Ventus_W266] +extends = esp8266_1M platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_VENTUS_W266 -board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size} -board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -board = ${esp8266_1M.board} -build_unflags = ${esp8266_1M.build_unflags} +build_flags = ${normal.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_VENTUS_W266 \ No newline at end of file From 77b774d786e9625350f420acf753795653ee4038 Mon Sep 17 00:00:00 2001 From: TD-er Date: Mon, 18 Nov 2019 00:46:55 +0100 Subject: [PATCH 05/15] [PIO] Disable build cache dir (Windows/Unix slash in path) Build cache dir is not really platform independent. --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 3ed9a071f7..fca91bbb47 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,7 @@ ;env_default = normal_ESP8266_1024 ;env_default = normal_ESP8266_4096 ; ..etc -build_cache_dir = $PROJECT_DIR\.buildcache +;build_cache_dir = $PROJECT_DIR\.buildcache ;minimal version for esps with 512K or less flash (only has minimal plugin set) From 58faac8ded0e7e9a5287a23624b19cd9f3300f40 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Mon, 18 Nov 2019 10:03:21 +0100 Subject: [PATCH 06/15] [PIO] Fix using wrong name for regular_platform --- platformio.ini | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/platformio.ini b/platformio.ini index fca91bbb47..c0565648d9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -310,7 +310,7 @@ build_flags = ${esp8266_1M.build_flags} -DESP8285 extends = esp82xx_common board_build.flash_mode = dout board_upload.maximum_size = 616448 -build_flags = -Wl,-Tesp8266.flash.1m128.ld -DSIZE_1M -DBUILD_NO_DEBUG -DPLUGIN_BUILD_MINIMAL_OTA +build_flags = ${esp82xx_1M.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA [esp8266_1M_OTA] @@ -320,7 +320,7 @@ board = esp01_1m [esp8285_1M_OTA] extends = esp82xx_1M_OTA board = esp8285 -build_flags = ${esp8266_1M.build_flags} -DESP8285 +build_flags = ${esp82xx_1M_OTA.build_flags} -DESP8285 [esp8266_2M256] extends = esp82xx_common @@ -433,7 +433,7 @@ extra_scripts = pre:pre_custom_esp32.py ; Has the same lib_ignore as the IR builds, or else those cannot be built for testing [env:memanalyze_ESP8266] extends = esp8266_4M1M -platform = ${regular.platform} +platform = ${regular_platform.platform} lib_ignore = ESP32_ping, ESP32WebServer build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24 extra_scripts = pre:pre_memanalyze.py @@ -495,48 +495,48 @@ board_upload.maximum_size = 1900544 ; NORMAL: 1024k version -------------------------- [env:normal_ESP8266_1M] extends = esp8266_1M -platform = ${regular.platform} +platform = ${regular_platform.platform} build_flags = ${esp8266_1M.build_flags} [env:normal_ESP8266_1M_VCC] extends = esp8266_1M -platform = ${regular.platform} +platform = ${regular_platform.platform} build_flags = ${esp8266_1M.build_flags} -D FEATURE_ADC_VCC=true ; NORMAL: 1024k for esp8285 ---------------------- [env:normal_ESP8285_1M] extends = esp8285_1M -platform = ${regular.platform} +platform = ${regular_platform.platform} build_flags = ${esp8285_1M.build_flags} ; NORMAL: 2048k WROOM02 version -------------------------- [env:normal_WROOM02_2M] extends = espWroom2M -platform = ${regular.platform} -build_flags = ${espWroom2M.build_flags} ${regular.build_flags} +platform = ${regular_platform.platform} +build_flags = ${espWroom2M.build_flags} ${regular_platform.build_flags} ; NORMAL: 2048k WROOM02 version 256k SPIFFS -------------------------- [env:normal_WROOM02_2M256] extends = espWroom2M256 -platform = ${regular.platform} -build_flags = ${espWroom2M256.build_flags} ${regular.build_flags} +platform = ${regular_platform.platform} +build_flags = ${espWroom2M256.build_flags} ${regular_platform.build_flags} ; NORMAL: 4096k version -------------------------- [env:normal_ESP8266_4M1M] extends = esp8266_4M1M -platform = ${regular.platform} -build_flags = ${esp8266_4M1M.build_flags} ${regular.build_flags} +platform = ${regular_platform.platform} +build_flags = ${esp8266_4M1M.build_flags} ${regular_platform.build_flags} [env:normal_ESP8266_16M] extends = esp8266_16M -platform = ${regular.platform} -build_flags = ${esp8266_16M.build_flags} ${regular.build_flags} +platform = ${regular_platform.platform} +build_flags = ${esp8266_16M.build_flags} ${regular_platform.build_flags} ;;; Minimal *********************************************************** @@ -555,13 +555,13 @@ build_flags = ${esp8285_1M_OTA.build_flags} ${core_2_4_2.build_fla [env:minimal_core_261_ESP8266_1M_OTA] extends = esp8266_1M_OTA -platform = ${regular.platform} -build_flags = ${esp8266_1M_OTA.build_flags} ${regular.build_flags} +platform = ${regular_platform.platform} +build_flags = ${esp8266_1M_OTA.build_flags} ${regular_platform.build_flags} [env:minimal_core_261_ESP8285_1M_OTA] extends = esp8285_1M_OTA -platform = ${regular.platform} -build_flags = ${esp8285_1M_OTA.build_flags} ${regular.build_flags} +platform = ${regular_platform.platform} +build_flags = ${esp8285_1M_OTA.build_flags} ${regular_platform.build_flags} From 7ee8d9fa3ad6ddde82c2f1177ed0e944e86da6b8 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Mon, 18 Nov 2019 15:59:57 +0100 Subject: [PATCH 07/15] [PIO] Cleanup ESP32 environments by using extends --- platformio.ini | 180 +++++++++++++++++++------------------------------ 1 file changed, 69 insertions(+), 111 deletions(-) diff --git a/platformio.ini b/platformio.ini index c0565648d9..b5d51fe251 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,10 +11,11 @@ ; *********************************************************************; [platformio] -;env_default = esp32dev -;env_default = dev_ESP8266_4096 -;env_default = normal_ESP8266_1024 -;env_default = normal_ESP8266_4096 +description = Firmware for ESP82xx/ESP32 for easy IoT deployment of sensors. +env_default = custom_ESP8266_4M1M, custom_ESP32_4M316k +;env_default = dev_ESP8266_4M1M +;env_default = normal_ESP8266_4M1M +;env_default = test_beta_ESP8266_4M1M ; ..etc ;build_cache_dir = $PROJECT_DIR\.buildcache @@ -173,17 +174,7 @@ platform = espressif32@1.11.1 [core_esp32_stage] platform = https://github.com/platformio/platform-espressif32.git#feature/stage -[core_esp32] -platform = ${core_esp32_1_11_1.platform} -build_unflags = -Wall -build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' - -DCONFIG_FREERTOS_ASSERT_DISABLE - -DCONFIG_LWIP_ESP_GRATUITOUS_ARP - -DCONFIG_LWIP_GARP_TMR_INTERVAL=30 -lib_ignore = AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, ESP32_ping, HeatpumpIR -lib_deps = https://github.com/TD-er/ESPEasySerial.git -monitor_speed = 115200 [debug_flags] build_flags = @@ -196,34 +187,46 @@ build_type = debug check_tool = clangtidy +[common] +lib_ldf_mode = chain +lib_archive = false +framework = arduino +upload_speed = 115200 +monitor_speed = 115200 +;targets = size, checkprogsize +targets = + + +[env] +extends = common + + [esp82xx_common] +extends = common board_build.f_cpu = 80000000L build_flags = ${debug_flags.build_flags} ${mqtt_flags.build_flags} -DHTTPCLIENT_1_1_COMPATIBLE=0 build_unflags = -DDEBUG_ESP_PORT lib_deps = https://github.com/TD-er/ESPEasySerial.git lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR, SD(esp8266), SDFS -lib_ldf_mode = chain -lib_archive = false -upload_speed = 115200 -framework = arduino board = esp12e -monitor_speed = 115200 -;targets = size, checkprogsize -targets = -[common] -extends = esp82xx_common +[esp32_common] +extends = common +platform = ${core_esp32_1_11_1.platform} +lib_ignore = AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, ESP32_ping, HeatpumpIR +lib_deps = https://github.com/TD-er/ESPEasySerial.git +board_build.f_flash = 80000000L +board_build.flash_mode = dout +board_upload.maximum_size = 1900544 +board_build.partitions = esp32_partition_app1810k_spiffs316k.csv +build_unflags = -Wall +build_flags = ${mqtt_flags.build_flags} + -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' + -DCONFIG_FREERTOS_ASSERT_DISABLE + -DCONFIG_LWIP_ESP_GRATUITOUS_ARP + -DCONFIG_LWIP_GARP_TMR_INTERVAL=30 -[env] -framework = ${common.framework} -lib_ldf_mode = ${common.lib_ldf_mode} -lib_archive = ${common.lib_archive} -lib_deps = ${common.lib_deps} -lib_ignore = ${common.lib_ignore} -upload_speed = ${common.upload_speed} -monitor_speed = ${common.monitor_speed} -targets = ${common.targets} [regular_platform] @@ -253,29 +256,24 @@ build_flags = ${regular_platform.build_flags} lib_ignore = ESP32_ping, ESP32WebServer, SD(esp8266), SDFS [minimal_ir] -platform = ${ir.platform} +extends = ir build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IR -lib_ignore = ${ir.lib_ignore} [minimal_ir_extended] -platform = ${ir.platform} +extends = ir build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IRext -lib_ignore = ${ir.lib_ignore} [normal_ir] -platform = ${ir.platform} +extends = ir build_flags = ${ir.build_flags} -DPLUGIN_BUILD_NORMAL_IR -lib_ignore = ${ir.lib_ignore} [normal_ir_extended] -platform = ${ir.platform} +extends = ir build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED -lib_ignore = ${ir.lib_ignore} [normal_ir_extended_no_rx] -platform = ${ir.platform} +extends = ir build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED_NO_RX -lib_ignore = ${ir.lib_ignore} [testing] platform = ${regular_platform.platform} @@ -337,11 +335,10 @@ board_upload.maximum_size = 1044464 build_flags = -Wl,-Tesp8266.flash.2m.ld [espWroom2M256] +extends = esp82xx_common board_build.flash_mode = dout -board_build.f_cpu = ${common.board_build.f_cpu} board_upload.maximum_size = 1044464 board = esp_wroom_02 -build_unflags = ${common.build_unflags} build_flags = -Wl,-Tesp8266.flash.2m256.ld [esp8266_4M1M] @@ -398,93 +395,41 @@ extra_scripts = pre:pre_extra_script.py ; Custom: 4096k version -------------------------- [env:debug_custom_ESP32_4M316k] -build_type = debug -platform = ${core_esp32.platform} -build_unflags = ${core_esp32.build_unflags} -build_flags = ${core_esp32.build_flags} -DPLUGIN_BUILD_CUSTOM -lib_deps = ${core_esp32.lib_deps} -lib_ignore = ${core_esp32.lib_ignore} +extends = esp32_common, debug_pio +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_BUILD_CUSTOM board = esp32dev -board_build.partitions = esp32_partition_app1810k_spiffs316k.csv -board_build.f_flash = 80000000L -board_build.flash_mode = dout -board_upload.maximum_size = 1900544 - extra_scripts = pre:pre_custom_esp32.py + [env:custom_ESP32_4M316k] -platform = ${core_esp32.platform} -build_unflags = ${core_esp32.build_unflags} -build_flags = ${core_esp32.build_flags} -DPLUGIN_BUILD_CUSTOM -lib_deps = ${core_esp32.lib_deps} -lib_ignore = ${core_esp32.lib_ignore} +extends = esp32_common +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_BUILD_CUSTOM board = esp32dev -board_build.partitions = esp32_partition_app1810k_spiffs316k.csv -board_build.f_flash = 80000000L -board_build.flash_mode = dout -board_upload.maximum_size = 1900544 - extra_scripts = pre:pre_custom_esp32.py - -; Special env for memory analysis -; This may generate builds which cannot be run, so do not upload to a node. -; Has the same lib_ignore as the IR builds, or else those cannot be built for testing -[env:memanalyze_ESP8266] -extends = esp8266_4M1M -platform = ${regular_platform.platform} -lib_ignore = ESP32_ping, ESP32WebServer -build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24 -extra_scripts = pre:pre_memanalyze.py - - - ;;; ESP32 pre-alpha test build ; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;;; ; Very limited build for ESP32, to start testing regular building for ESP32. ; ; Will probably not work, not tested and guaranteed to take a few hours time of some ; ; still trying to build the version without reading this warning. ; ; ********************************************************************* [env:esp-wrover-kit_test_4M316k] -platform = ${core_esp32.platform} -build_unflags = ${core_esp32.build_unflags} -build_flags = ${core_esp32.build_flags} -DPLUGIN_SET_TEST_ESP32 -lib_deps = ${core_esp32.lib_deps} -lib_ignore = ${core_esp32.lib_ignore} +extends = esp32_common +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_SET_TEST_ESP32 board = esp-wrover-kit -board_build.partitions = esp32_partition_app1810k_spiffs316k.csv -board_build.f_flash = 80000000L -board_build.flash_mode = dout -board_upload.maximum_size = 1900544 upload_protocol = ftdi debug_tool = ftdi debug_extra_cmds = break Misc.ino:3011 - -; 2018-02-17 TD-er -; Disabled for now, since it does no longer fit in the default sketch partition size -;[env:esp32dev] -;board = esp32dev -;platform = ${core_esp32.platform} -;build_unflags = ${core_esp32.build_unflags} -;build_flags = ${core_esp32.build_flags} -DPLUGIN_SET_GENERIC_ESP32 -;lib_deps = ${core_esp32.lib_deps} -;lib_ignore = ${core_esp32.lib_ignore} - [env:esp32test_4M316k] -platform = ${core_esp32.platform} -build_unflags = ${core_esp32.build_unflags} -build_flags = ${core_esp32.build_flags} -DPLUGIN_SET_TEST_ESP32 -lib_deps = ${core_esp32.lib_deps} -lib_ignore = ${core_esp32.lib_ignore} +extends = esp32_common +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_SET_TEST_ESP32 board = esp32dev -board_build.partitions = esp32_partition_app1810k_spiffs316k.csv -board_build.f_flash = 80000000L -board_build.flash_mode = dout -board_upload.maximum_size = 1900544 - - @@ -579,7 +524,7 @@ extends = esp8266_1M platform = ${minimal_ir_extended.platform} lib_ignore = ${minimal_ir_extended.lib_ignore} build_flags = ${minimal_ir_extended.build_flags} ${esp8266_1M.build_flags} -build_unflags = ${esp8266_1M.build_unflags} -DPLUGIN_BUILD_NORMAL_IR +build_unflags = ${esp8266_1M_OTA.build_unflags} -DPLUGIN_BUILD_NORMAL_IR ; Minimal IR: 4096k version -------------------------- @@ -743,4 +688,17 @@ build_flags = ${normal.build_flags} ${esp8266_2M256.build_flags} - [env:hard_Ventus_W266] extends = esp8266_1M platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_VENTUS_W266 \ No newline at end of file +build_flags = ${normal.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_VENTUS_W266 + + + + +; Special env for memory analysis +; This may generate builds which cannot be run, so do not upload to a node. +; Has the same lib_ignore as the IR builds, or else those cannot be built for testing +[env:memanalyze_ESP8266] +extends = esp8266_4M1M +platform = ${regular_platform.platform} +lib_ignore = ESP32_ping, ESP32WebServer +build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24 +extra_scripts = pre:pre_memanalyze.py From f8c06d2ecfb363f18815be28c6b07da5e0009328 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Mon, 18 Nov 2019 23:37:27 +0100 Subject: [PATCH 08/15] [PIO] Fix building hardware specific builds --- platformio.ini | 69 ++++++++++++++++++++++++---------------- src/define_plugin_sets.h | 1 + 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/platformio.ini b/platformio.ini index b5d51fe251..6850e5a36a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -175,6 +175,26 @@ platform = espressif32@1.11.1 platform = https://github.com/platformio/platform-espressif32.git#feature/stage +[common] +lib_ldf_mode = chain +lib_archive = false +framework = arduino +upload_speed = 115200 +monitor_speed = 115200 +;targets = size, checkprogsize +targets = + + +[regular_platform] +build_unflags = +build_flags = ${core_2_6_1.build_flags} ${common.build_flags} +platform = ${core_2_6_1.platform} + +[beta_platform] +build_unflags = +build_flags = ${core_stage.build_flags} ${common.build_flags} +platform = ${core_stage.platform} + [debug_flags] build_flags = @@ -187,16 +207,6 @@ build_type = debug check_tool = clangtidy -[common] -lib_ldf_mode = chain -lib_archive = false -framework = arduino -upload_speed = 115200 -monitor_speed = 115200 -;targets = size, checkprogsize -targets = - - [env] extends = common @@ -228,16 +238,11 @@ build_flags = ${mqtt_flags.build_flags} -DCONFIG_LWIP_GARP_TMR_INTERVAL=30 - -[regular_platform] -build_unflags = -build_flags = ${core_2_6_1.build_flags} ${common.build_flags} -platform = ${core_2_6_1.platform} - -[beta_platform] -build_unflags = -build_flags = ${core_stage.build_flags} ${common.build_flags} -platform = ${core_stage.platform} +[hard_esp82xx] +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} + -DBUILD_NO_DEBUG + -DPLUGIN_BUILD_CUSTOM @@ -292,7 +297,10 @@ build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_DEV extends = esp82xx_common board_build.flash_mode = dout board_upload.maximum_size = 786432 -build_flags = -Wl,-Tesp8266.flash.1m128.ld -DSIZE_1M -DBUILD_NO_DEBUG +build_flags = -Wl,-Tesp8266.flash.1m128.ld + -DSIZE_1M + -DBUILD_NO_DEBUG + ${esp82xx_common.build_flags} [esp8266_1M] extends = esp82xx_1M @@ -326,6 +334,7 @@ board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 build_flags = -Wl,-Tesp8266.flash.2m256.ld + ${esp82xx_common.build_flags} [espWroom2M] extends = esp82xx_common @@ -333,6 +342,7 @@ board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 build_flags = -Wl,-Tesp8266.flash.2m.ld + ${esp82xx_common.build_flags} [espWroom2M256] extends = esp82xx_common @@ -340,6 +350,7 @@ board_build.flash_mode = dout board_upload.maximum_size = 1044464 board = esp_wroom_02 build_flags = -Wl,-Tesp8266.flash.2m256.ld + ${esp82xx_common.build_flags} [esp8266_4M1M] extends = esp82xx_common @@ -347,6 +358,7 @@ board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 build_flags = -Wl,-Tesp8266.flash.4m1m.ld + ${esp82xx_common.build_flags} [esp8266_4M2M] extends = esp82xx_common @@ -354,6 +366,7 @@ board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 build_flags = -Wl,-Tesp8266.flash.4m2m.ld + ${esp82xx_common.build_flags} ; Configuration for the Wemos D1 mini pro (16M) @@ -365,7 +378,9 @@ extends = esp82xx_common board = esp12e board_build.flash_mode = dio board_upload.maximum_size = 1044464 -build_flags = -Wl,-Tesp8266.flash.16m14m.ld -DSPIFFS_MAX_OPEN_FILES=20 +build_flags = -Wl,-Tesp8266.flash.16m14m.ld + -DSPIFFS_MAX_OPEN_FILES=20 + ${esp82xx_common.build_flags} ; Custom: 4M1M version -------------------------- [env:custom_ESP8266_4M1M] @@ -630,16 +645,16 @@ build_flags = ${esp8266_4M1M.build_flags} ${dev.build_flags} ; GPIO13 Blue Led (0 = On, 1 = Off) [env:hard_SONOFF_POW_4M1M] extends = esp8266_4M1M -platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW +platform = ${hard_esp82xx.platform} +build_flags = ${hard_esp82xx.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW ; Build including power measurement plugins for those devices that have only 1M flash. ; For example those made by BlitzWolf SHP [env:hard_other_POW_ESP8285_1M] extends = esp8285_1M -platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8285_1M.build_flags} -D PLUGIN_SET_SONOFF_POW +platform = ${hard_esp82xx.platform} +build_flags = ${hard_esp82xx.build_flags} ${esp8285_1M.build_flags} -D PLUGIN_SET_SONOFF_POW ; ITEAD / SONOFF S20 version -------------------- @@ -688,7 +703,7 @@ build_flags = ${normal.build_flags} ${esp8266_2M256.build_flags} - [env:hard_Ventus_W266] extends = esp8266_1M platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_VENTUS_W266 +build_flags = ${normal.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_VENTUS_W266 diff --git a/src/define_plugin_sets.h b/src/define_plugin_sets.h index c0304920c1..689ac74197 100644 --- a/src/define_plugin_sets.h +++ b/src/define_plugin_sets.h @@ -378,6 +378,7 @@ To create/register a plugin, you have to : #ifdef PLUGIN_SET_SONOFF_POW #define PLUGIN_DESCR "Sonoff POW R1/R2" + #define CONTROLLER_SET_STABLE #define PLUGIN_SET_ONLY_SWITCH #define USES_P076 // HWL8012 in POW r1 // Needs CSE7766 Energy sensor, via Serial RXD 4800 baud 8E1 (GPIO1), TXD (GPIO3) From b931a4742481ba62f21bbb90da21a2f8a684e338 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Tue, 19 Nov 2019 01:55:41 +0100 Subject: [PATCH 09/15] [PIO] Fix empty build_flags --- platformio.ini | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/platformio.ini b/platformio.ini index 6850e5a36a..056f447a29 100644 --- a/platformio.ini +++ b/platformio.ini @@ -175,6 +175,13 @@ platform = espressif32@1.11.1 platform = https://github.com/platformio/platform-espressif32.git#feature/stage +[debug_flags] +build_flags = + +[mqtt_flags] +build_flags = -DMQTT_MAX_PACKET_SIZE=1024 + + [common] lib_ldf_mode = chain lib_archive = false @@ -187,20 +194,15 @@ targets = [regular_platform] build_unflags = -build_flags = ${core_2_6_1.build_flags} ${common.build_flags} +build_flags = ${core_2_6_1.build_flags} platform = ${core_2_6_1.platform} [beta_platform] build_unflags = -build_flags = ${core_stage.build_flags} ${common.build_flags} +build_flags = ${core_stage.build_flags} platform = ${core_stage.platform} -[debug_flags] -build_flags = - -[mqtt_flags] -build_flags = -DMQTT_MAX_PACKET_SIZE=1024 [debug_pio] build_type = debug @@ -644,7 +646,7 @@ build_flags = ${esp8266_4M1M.build_flags} ${dev.build_flags} ; GPIO12 Red Led and Relay (0 = Off, 1 = On) ; GPIO13 Blue Led (0 = On, 1 = Off) [env:hard_SONOFF_POW_4M1M] -extends = esp8266_4M1M +extends = esp8266_4M1M, hard_esp82xx platform = ${hard_esp82xx.platform} build_flags = ${hard_esp82xx.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW @@ -652,7 +654,7 @@ build_flags = ${hard_esp82xx.build_flags} ${esp8266_4M1M.build_fla ; Build including power measurement plugins for those devices that have only 1M flash. ; For example those made by BlitzWolf SHP [env:hard_other_POW_ESP8285_1M] -extends = esp8285_1M +extends = esp8285_1M, hard_esp82xx platform = ${hard_esp82xx.platform} build_flags = ${hard_esp82xx.build_flags} ${esp8285_1M.build_flags} -D PLUGIN_SET_SONOFF_POW From 07187db5bf037d8e830189b59e1453cf2fb7a0a0 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Tue, 19 Nov 2019 10:37:10 +0100 Subject: [PATCH 10/15] [PIO] Only build needed environments --- .travis.yml | 1 + before_deploy | 1 + platformio.ini | 8 ++++---- tools/build_ESPeasy.sh | 36 ++++++++++++++++++++++++++++++++++-- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d263bce66d..114f8c3069 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ script: # - cppcheck --enable=warning src/*.ino -q --force -I src --include=src/ESPEasy.ino --error-exitcode=1 # - ./memanalyzer.py ~/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-objdump # - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run --target clean + # Same list as in tools/build_ESPeasy.sh and before_deploy - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP32_4M316k - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP8266_4M1M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP8266_4M2M diff --git a/before_deploy b/before_deploy index b0afa79069..5a4bb29623 100755 --- a/before_deploy +++ b/before_deploy @@ -39,6 +39,7 @@ fi mkdir -p ${TMP_DIST}/memstats +# Same list in .travis.yml and tools/build_ESPeasy.sh for ENV in \ custom_ESP32_4M316k\ custom_ESP8266_4M1M\ diff --git a/platformio.ini b/platformio.ini index 056f447a29..1e8a304caa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,10 +12,10 @@ [platformio] description = Firmware for ESP82xx/ESP32 for easy IoT deployment of sensors. -env_default = custom_ESP8266_4M1M, custom_ESP32_4M316k -;env_default = dev_ESP8266_4M1M -;env_default = normal_ESP8266_4M1M -;env_default = test_beta_ESP8266_4M1M +default_envs = custom_ESP8266_4M1M, custom_ESP32_4M316k +;default_envs = dev_ESP8266_4M1M +;default_envs = normal_ESP8266_4M1M +;default_envs = test_beta_ESP8266_4M1M ; ..etc ;build_cache_dir = $PROJECT_DIR\.buildcache diff --git a/tools/build_ESPeasy.sh b/tools/build_ESPeasy.sh index 72a5bf0829..ba79b32910 100755 --- a/tools/build_ESPeasy.sh +++ b/tools/build_ESPeasy.sh @@ -75,8 +75,40 @@ platformio run --target clean cd ${SRC}/patches; ./check_puya_patch; cd ${SRC} -# Build all targets in the platformio.ini file. -PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run +# Build all targets in the platformio.ini file. (same as in .travis.yml and before_deploy) +for ENV in \ + custom_ESP32_4M316k\ + custom_ESP8266_4M1M\ + custom_ESP8266_4M2M\ + dev_ESP8266_4M1M\ + esp-wrover-kit_test_4M316k\ + esp32test_4M316k\ + hard_SONOFF_POW_4M1M\ + hard_Shelly_1_2M256\ + hard_Ventus_W266\ + hard_other_POW_ESP8285_1M\ + minimal_IRext_ESP8266_1M\ + minimal_IRext_ESP8266_4M1M\ + minimal_IRext_ESP8266_4M2M\ + minimal_core_242_ESP8266_1M_OTA\ + minimal_core_242_ESP8285_1M_OTA\ + minimal_core_261_ESP8266_1M_OTA\ + minimal_core_261_ESP8285_1M_OTA\ + normal_ESP8266_16M\ + normal_ESP8266_1M\ + normal_ESP8266_1M_VCC\ + normal_ESP8266_4M1M\ + normal_ESP8285_1M\ + normal_IRext_no_rx_ESP8266_4M2M\ + normal_WROOM02_2M256\ + normal_WROOM02_2M\ + test_ESP8266_4M_VCC\ + test_beta_ESP8266_16M\ + test_beta_ESP8266_4M1M;\ +do + PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e ${ENV} +done + #for ENV in `grep "^\[env:" platformio.ini |cut -d':' -f2|cut -d']' -f1`; #do From b3d5eb77d333548c5d359d7d0b81e451f47f8625 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Wed, 20 Nov 2019 13:49:40 +0100 Subject: [PATCH 11/15] [PIO] Split platformio.ini into separate files + cleanup. --- .travis.yml | 4 +- before_deploy | 6 +- dist/README.txt | 2 +- platformio.ini | 657 +------------------ platformio_core_defs.ini | 115 ++++ platformio_esp32_envs.ini | 52 ++ platformio_esp82xx_base.ini | 207 ++++++ platformio_esp82xx_envs.ini | 287 ++++++++ platformio_special_envs.ini | 45 ++ pre_extra_script.py => pre_custom_esp82xx.py | 0 pre_default_check.py | 23 + tools/build_ESPeasy.sh | 6 +- 12 files changed, 747 insertions(+), 657 deletions(-) create mode 100644 platformio_core_defs.ini create mode 100644 platformio_esp32_envs.ini create mode 100644 platformio_esp82xx_base.ini create mode 100644 platformio_esp82xx_envs.ini create mode 100644 platformio_special_envs.ini rename pre_extra_script.py => pre_custom_esp82xx.py (100%) create mode 100644 pre_default_check.py diff --git a/.travis.yml b/.travis.yml index 114f8c3069..4e7801494d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,8 +38,6 @@ script: - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP8266_4M1M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_ESP8266_4M2M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e dev_ESP8266_4M1M - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e esp-wrover-kit_test_4M316k - - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e esp32test_4M316k - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_SONOFF_POW_4M1M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_Shelly_1_2M256 - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e hard_Ventus_W266 @@ -62,6 +60,8 @@ script: - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_ESP8266_4M_VCC - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_beta_ESP8266_16M - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_beta_ESP8266_4M1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_ESP32_4M316k + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_ESP32-wrover-kit_4M316k before_deploy: - ./before_deploy diff --git a/before_deploy b/before_deploy index 5a4bb29623..526557a339 100755 --- a/before_deploy +++ b/before_deploy @@ -45,8 +45,6 @@ for ENV in \ custom_ESP8266_4M1M\ custom_ESP8266_4M2M\ dev_ESP8266_4M1M\ - esp-wrover-kit_test_4M316k\ - esp32test_4M316k\ hard_SONOFF_POW_4M1M\ hard_Shelly_1_2M256\ hard_Ventus_W266\ @@ -68,7 +66,9 @@ for ENV in \ normal_WROOM02_2M\ test_ESP8266_4M_VCC\ test_beta_ESP8266_16M\ - test_beta_ESP8266_4M1M;\ + test_beta_ESP8266_4M1M\ + test_ESP32_4M316k\ + test_ESP32-wrover-kit_4M316k;\ do MAX_FILESIZE=1044464 if [[ ${ENV} == *"_1M"* ]]; then diff --git a/dist/README.txt b/dist/README.txt index dcc7cf1490..3b0cfebdc9 100644 --- a/dist/README.txt +++ b/dist/README.txt @@ -53,7 +53,7 @@ Special memory partitioning: ESP32 now has 3 builds: - esp32test_4M316k Larger sketch partition (1.8MB) smaller SPIFFS (316 kB) -- esp-wrover-kit_test_4M316k A build for ESP32 including build flags for the official WRover test kit. +- test_ESP32-wrover-kit_4M316k A build for ESP32 including build flags for the official WRover test kit. Please note that changing between those versions will destroy the settings! The SPIFFS partition will be lost and that contains all settings. diff --git a/platformio.ini b/platformio.ini index 1e8a304caa..2f7464dc9c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,6 +12,12 @@ [platformio] description = Firmware for ESP82xx/ESP32 for easy IoT deployment of sensors. +extra_configs = + platformio_core_defs.ini + platformio_esp82xx_base.ini + platformio_esp82xx_envs.ini + platformio_esp32_envs.ini + platformio_special_envs.ini default_envs = custom_ESP8266_4M1M, custom_ESP32_4M316k ;default_envs = dev_ESP8266_4M1M ;default_envs = normal_ESP8266_4M1M @@ -20,14 +26,6 @@ default_envs = custom_ESP8266_4M1M, custom_ESP32_4M316k ;build_cache_dir = $PROJECT_DIR\.buildcache -;minimal version for esps with 512K or less flash (only has minimal plugin set) -; [env:mini_512] -; platform = ${common.platform} -; -; board = esp01 -; -; build_flags = !echo -Wl,-Tesp8266.flash.512k64.ld -D BUILD_GIT=\'\"$(git describe)\"\' -; ; upload_port = /dev/ttyUSB0 ; add these: ; -Werror -Wall -Wextra -pedantic -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op @@ -35,8 +33,8 @@ default_envs = custom_ESP8266_4M1M, custom_ESP32_4M316k ; -Wstrict-overflow=5 -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option ; thanks @chouffe103 [compiler_warnings] -build_flags = - -Wall -Wno-parentheses -fdiagnostics-show-option +build_flags = -Wall -Wno-parentheses -fdiagnostics-show-option + [minimal_size] build_flags = @@ -58,121 +56,6 @@ upload_flags_esp32 = build_flags = -DFEATURE_ARDUINO_OTA upload_port = 192.168.1.152 -; ********************************************************************* - -; **** Definition cheat sheet: -; board_build.flash_mode in terms of performance: QIO > QOUT > DIO > DOUT -; for lib_ldf_mode, see http://docs.platformio.org/en/latest/librarymanager/ldf.html;ldf - -; **** Frequently used build flags: -; Use custom.h file to override default settings for ESPeasy: -D USE_CUSTOM_H -; Set VCC mode to measure Vcc of ESP chip : -D FEATURE_ADC_VCC=true - -; Build Flags: -; -DUSE_CONFIG_OVERRIDE -; lwIP 1.4 (Default) -; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH -; lwIP 2 - Low Memory -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -; lwIP 2 - Higher Bandwitdh -; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -; VTABLES in Flash (default) -; -DVTABLES_IN_FLASH -; VTABLES in Heap -; -DVTABLES_IN_DRAM -; VTABLES in IRAM -; -DVTABLES_IN_IRAM -; NO_EXTRA_4K_HEAP - this forces the default NONOS-SDK user's heap location -; Default currently overlaps cont stack (Arduino) with sys stack (System) -; to save up-to 4 kB of heap. (starting core_2.4.2) -; ESP8266_DISABLE_EXTRA4K - Calls disable_extra4k_at_link_time() from setup -; to force the linker keep user's stack in user ram. -; CONT_STACKSIZE to set the 'cont' (Arduino) stack size. Default = 4096 -; -mtarget-align see: https://github.com/arendst/Sonoff-Tasmota/issues/3678#issuecomment-419712437 - -[esp82xx_defaults] -build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' - -D NDEBUG - -lstdc++ -lsupc++ - -mtarget-align - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DVTABLES_IN_FLASH - -DPUYA_SUPPORT=1 - -[esp82xx_2_5_x] -build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' - -DNDEBUG - -mtarget-align - -DVTABLES_IN_FLASH - -fno-exceptions - -lstdc++ - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH - -DPUYA_SUPPORT=1 - -DCORE_POST_2_5_0 - -[esp82xx_2_6_x] -build_flags = ${esp82xx_2_5_x.build_flags} - -O2 - -DBEARSSL_SSL_BASIC - -DCORE_POST_2_6_0 - - -;[core_2_3_0] -;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.5.0_Puya -;build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' -; -DNDEBUG -; -DVTABLES_IN_FLASH -; -fno-exceptions -; -DPUYA_SUPPORT=1 -; -DARDUINO_ESP8266_RELEASE_2_3_0 -; -DFORCE_PRE_2_5_0 -;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR - -;[core_2_4_0] -;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.6.0_Puya -;build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_0 -DFORCE_PRE_2_5_0 -;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR - -;[core_2_4_1] -;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.7.3_Puya -;build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_1 -DFORCE_PRE_2_5_0 -;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR - - -[core_2_4_2] -platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.8.0_Puya -build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_2 -DFORCE_PRE_2_5_0 -lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR - -;[core_2_5_0] -;platform = espressif8266@2.0.4 -;build_flags = ${esp82xx_2_5_x.build_flags} - -;[core_2_5_2] -;platform = espressif8266@2.2.3 -;build_flags = ${esp82xx_2_5_x.build_flags} - -[core_2_6_0] -platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_0 -build_flags = ${esp82xx_2_6_x.build_flags} - -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 - -[core_2_6_1] -platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_1 -build_flags = ${esp82xx_2_6_x.build_flags} - -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 - -[core_stage] -platform = https://github.com/platformio/platform-espressif8266.git#feature/stage -build_flags = ${esp82xx_2_6_x.build_flags} - -DARDUINO_ESP8266_RELEASE='"2.7.0-dev stage"' - -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 - -[core_esp32_1_11_1] -platform = espressif32@1.11.1 - -[core_esp32_stage] -platform = https://github.com/platformio/platform-espressif32.git#feature/stage [debug_flags] @@ -190,532 +73,10 @@ upload_speed = 115200 monitor_speed = 115200 ;targets = size, checkprogsize targets = - - -[regular_platform] -build_unflags = -build_flags = ${core_2_6_1.build_flags} -platform = ${core_2_6_1.platform} - -[beta_platform] -build_unflags = -build_flags = ${core_stage.build_flags} -platform = ${core_stage.platform} - - - -[debug_pio] -build_type = debug -check_tool = clangtidy +extra_scripts = pre:pre_default_check.py [env] extends = common -[esp82xx_common] -extends = common -board_build.f_cpu = 80000000L -build_flags = ${debug_flags.build_flags} ${mqtt_flags.build_flags} -DHTTPCLIENT_1_1_COMPATIBLE=0 -build_unflags = -DDEBUG_ESP_PORT -lib_deps = https://github.com/TD-er/ESPEasySerial.git -lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR, SD(esp8266), SDFS -board = esp12e - - -[esp32_common] -extends = common -platform = ${core_esp32_1_11_1.platform} -lib_ignore = AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, ESP32_ping, HeatpumpIR -lib_deps = https://github.com/TD-er/ESPEasySerial.git -board_build.f_flash = 80000000L -board_build.flash_mode = dout -board_upload.maximum_size = 1900544 -board_build.partitions = esp32_partition_app1810k_spiffs316k.csv -build_unflags = -Wall -build_flags = ${mqtt_flags.build_flags} - -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' - -DCONFIG_FREERTOS_ASSERT_DISABLE - -DCONFIG_LWIP_ESP_GRATUITOUS_ARP - -DCONFIG_LWIP_GARP_TMR_INTERVAL=30 - - -[hard_esp82xx] -platform = ${regular_platform.platform} -build_flags = ${regular_platform.build_flags} - -DBUILD_NO_DEBUG - -DPLUGIN_BUILD_CUSTOM - - - -[normal] -platform = ${regular_platform.platform} -build_flags = ${regular_platform.build_flags} - -[normal_beta] -platform = ${beta_platform.platform} -build_flags = ${beta_platform.build_flags} - - -[ir] -platform = ${regular_platform.platform} -build_flags = ${regular_platform.build_flags} -lib_ignore = ESP32_ping, ESP32WebServer, SD(esp8266), SDFS - -[minimal_ir] -extends = ir -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IR - -[minimal_ir_extended] -extends = ir -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IRext - -[normal_ir] -extends = ir -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_NORMAL_IR - -[normal_ir_extended] -extends = ir -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED - -[normal_ir_extended_no_rx] -extends = ir -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED_NO_RX - -[testing] -platform = ${regular_platform.platform} -build_flags = ${regular_platform.build_flags} -DPLUGIN_BUILD_TESTING - -[testing_beta] -platform = ${beta_platform.platform} -build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_TESTING - -[dev] -platform = ${beta_platform.platform} -build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_DEV - - -[esp82xx_1M] -extends = esp82xx_common -board_build.flash_mode = dout -board_upload.maximum_size = 786432 -build_flags = -Wl,-Tesp8266.flash.1m128.ld - -DSIZE_1M - -DBUILD_NO_DEBUG - ${esp82xx_common.build_flags} - -[esp8266_1M] -extends = esp82xx_1M -board = esp01_1m - -[esp8285_1M] -extends = esp82xx_1M -board = esp8285 -build_flags = ${esp8266_1M.build_flags} -DESP8285 - - -[esp82xx_1M_OTA] -extends = esp82xx_common -board_build.flash_mode = dout -board_upload.maximum_size = 616448 -build_flags = ${esp82xx_1M.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA - - -[esp8266_1M_OTA] -extends = esp82xx_1M_OTA -board = esp01_1m - -[esp8285_1M_OTA] -extends = esp82xx_1M_OTA -board = esp8285 -build_flags = ${esp82xx_1M_OTA.build_flags} -DESP8285 - -[esp8266_2M256] -extends = esp82xx_common -board = esp12e -board_build.flash_mode = dio -board_upload.maximum_size = 1044464 -build_flags = -Wl,-Tesp8266.flash.2m256.ld - ${esp82xx_common.build_flags} - -[espWroom2M] -extends = esp82xx_common -board = esp12e -board_build.flash_mode = dio -board_upload.maximum_size = 1044464 -build_flags = -Wl,-Tesp8266.flash.2m.ld - ${esp82xx_common.build_flags} - -[espWroom2M256] -extends = esp82xx_common -board_build.flash_mode = dout -board_upload.maximum_size = 1044464 -board = esp_wroom_02 -build_flags = -Wl,-Tesp8266.flash.2m256.ld - ${esp82xx_common.build_flags} - -[esp8266_4M1M] -extends = esp82xx_common -board = esp12e -board_build.flash_mode = dio -board_upload.maximum_size = 1044464 -build_flags = -Wl,-Tesp8266.flash.4m1m.ld - ${esp82xx_common.build_flags} - -[esp8266_4M2M] -extends = esp82xx_common -board = esp12e -board_build.flash_mode = dio -board_upload.maximum_size = 1044464 -build_flags = -Wl,-Tesp8266.flash.4m2m.ld - ${esp82xx_common.build_flags} - - -; Configuration for the Wemos D1 mini pro (16M) -; This configuration can only be used with core versions 2.5.0 or newer. -; Performance of 14M SPIFFS is really slow. -; See https://github.com/esp8266/Arduino/issues/5932 -[esp8266_16M] -extends = esp82xx_common -board = esp12e -board_build.flash_mode = dio -board_upload.maximum_size = 1044464 -build_flags = -Wl,-Tesp8266.flash.16m14m.ld - -DSPIFFS_MAX_OPEN_FILES=20 - ${esp82xx_common.build_flags} - -; Custom: 4M1M version -------------------------- -[env:custom_ESP8266_4M1M] -extends = esp8266_4M1M -platform = ${beta_platform.platform} -build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM -lib_ignore = ESP32_ping, ESP32WebServer -extra_scripts = pre:pre_extra_script.py - - -[env:debug_custom_ESP8266_4M1M] -extends = esp8266_4M1M, debug_pio -platform = ${beta_platform.platform} -build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM -;lib_ignore = ESP32_ping, ESP32WebServer -extra_scripts = pre:pre_extra_script.py - - -; Custom: 4M2M version -------------------------- -[env:custom_ESP8266_4M2M] -extends = esp8266_4M2M -platform = ${beta_platform.platform} -build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM -lib_ignore = ESP32_ping, ESP32WebServer -extra_scripts = pre:pre_extra_script.py - - -; Custom: 4096k version -------------------------- -[env:debug_custom_ESP32_4M316k] -extends = esp32_common, debug_pio -platform = ${esp32_common.platform} -build_flags = ${esp32_common.build_flags} -DPLUGIN_BUILD_CUSTOM -board = esp32dev -extra_scripts = pre:pre_custom_esp32.py - - -[env:custom_ESP32_4M316k] -extends = esp32_common -platform = ${esp32_common.platform} -build_flags = ${esp32_common.build_flags} -DPLUGIN_BUILD_CUSTOM -board = esp32dev -extra_scripts = pre:pre_custom_esp32.py - - -;;; ESP32 pre-alpha test build ; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;;; -; Very limited build for ESP32, to start testing regular building for ESP32. ; -; Will probably not work, not tested and guaranteed to take a few hours time of some ; -; still trying to build the version without reading this warning. ; -; ********************************************************************* -[env:esp-wrover-kit_test_4M316k] -extends = esp32_common -platform = ${esp32_common.platform} -build_flags = ${esp32_common.build_flags} -DPLUGIN_SET_TEST_ESP32 -board = esp-wrover-kit -upload_protocol = ftdi -debug_tool = ftdi -debug_extra_cmds = break Misc.ino:3011 - - -[env:esp32test_4M316k] -extends = esp32_common -platform = ${esp32_common.platform} -build_flags = ${esp32_common.build_flags} -DPLUGIN_SET_TEST_ESP32 -board = esp32dev - - - -;;; NORMAL (STABLE) *************************************************** -; normal version with stable plugins ; -; ********************************************************************* - -; NORMAL: 1024k version -------------------------- -[env:normal_ESP8266_1M] -extends = esp8266_1M -platform = ${regular_platform.platform} -build_flags = ${esp8266_1M.build_flags} - - - -[env:normal_ESP8266_1M_VCC] -extends = esp8266_1M -platform = ${regular_platform.platform} -build_flags = ${esp8266_1M.build_flags} -D FEATURE_ADC_VCC=true - -; NORMAL: 1024k for esp8285 ---------------------- -[env:normal_ESP8285_1M] -extends = esp8285_1M -platform = ${regular_platform.platform} -build_flags = ${esp8285_1M.build_flags} - - -; NORMAL: 2048k WROOM02 version -------------------------- -[env:normal_WROOM02_2M] -extends = espWroom2M -platform = ${regular_platform.platform} -build_flags = ${espWroom2M.build_flags} ${regular_platform.build_flags} - - -; NORMAL: 2048k WROOM02 version 256k SPIFFS -------------------------- -[env:normal_WROOM02_2M256] -extends = espWroom2M256 -platform = ${regular_platform.platform} -build_flags = ${espWroom2M256.build_flags} ${regular_platform.build_flags} - - -; NORMAL: 4096k version -------------------------- -[env:normal_ESP8266_4M1M] -extends = esp8266_4M1M -platform = ${regular_platform.platform} -build_flags = ${esp8266_4M1M.build_flags} ${regular_platform.build_flags} - - -[env:normal_ESP8266_16M] -extends = esp8266_16M -platform = ${regular_platform.platform} -build_flags = ${esp8266_16M.build_flags} ${regular_platform.build_flags} - - -;;; Minimal *********************************************************** -; Minimal build size for OTA ; -; ********************************************************************* - -[env:minimal_core_242_ESP8266_1M_OTA] -extends = esp8266_1M_OTA -platform = ${core_2_4_2.platform} -build_flags = ${esp8266_1M_OTA.build_flags} ${core_2_4_2.build_flags} - -[env:minimal_core_242_ESP8285_1M_OTA] -extends = esp8285_1M_OTA -platform = ${core_2_4_2.platform} -build_flags = ${esp8285_1M_OTA.build_flags} ${core_2_4_2.build_flags} - -[env:minimal_core_261_ESP8266_1M_OTA] -extends = esp8266_1M_OTA -platform = ${regular_platform.platform} -build_flags = ${esp8266_1M_OTA.build_flags} ${regular_platform.build_flags} - -[env:minimal_core_261_ESP8285_1M_OTA] -extends = esp8285_1M_OTA -platform = ${regular_platform.platform} -build_flags = ${esp8285_1M_OTA.build_flags} ${regular_platform.build_flags} - - - - -;;; IR *********************************************************** -; IR builds ; -; ********************************************************************* - - -; Minimal IR: 1024k version -------------------------- -; Build including IR libraries, including extended AC commands -; Minimal set of other plugins -[env:minimal_IRext_ESP8266_1M] -extends = esp8266_1M -platform = ${minimal_ir_extended.platform} -lib_ignore = ${minimal_ir_extended.lib_ignore} -build_flags = ${minimal_ir_extended.build_flags} ${esp8266_1M.build_flags} -build_unflags = ${esp8266_1M_OTA.build_unflags} -DPLUGIN_BUILD_NORMAL_IR - - -; Minimal IR: 4096k version -------------------------- -; Build including IR libraries, INCLUDING extended AC commands -; Includes Extended IR AC commands (takes a lot more program space) -[env:minimal_IRext_ESP8266_4M1M] -extends = esp8266_4M1M -platform = ${minimal_ir_extended.platform} -lib_ignore = ${minimal_ir_extended.lib_ignore} -build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M1M.build_flags} - - -[env:minimal_IRext_ESP8266_4M2M] -extends = esp8266_4M2M -platform = ${minimal_ir_extended.platform} -lib_ignore = ${minimal_ir_extended.lib_ignore} -build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M2M.build_flags} - - -; NORMAL IR: 4096k version -------------------------- -; Build including IR libraries, INCLUDING extended AC commands -; Includes Extended IR AC commands (takes a lot more program space) -[env:normal_IRext_no_rx_ESP8266_4M2M] -extends = esp8266_4M2M -platform = ${normal_ir_extended_no_rx.platform} -lib_ignore = ${normal_ir_extended_no_rx.lib_ignore} -build_flags = ${normal_ir_extended_no_rx.build_flags} ${esp8266_4M2M.build_flags} - - -[env:test_beta_ESP8266_4M1M] -extends = esp8266_4M1M -platform = ${testing_beta.platform} -build_flags = ${esp8266_4M1M.build_flags} ${testing_beta.build_flags} - - -[env:test_beta_ESP8266_16M] -extends = esp8266_16M -platform = ${testing_beta.platform} -build_flags = ${esp8266_16M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y - - -; TEST: 4096k version + FEATURE_ADC_VCC ---------- -[env:test_ESP8266_4M_VCC] -extends = esp8266_4M1M -platform = ${testing.platform} -build_flags = ${esp8266_4M1M.build_flags} ${testing.build_flags} -D FEATURE_ADC_VCC=true - - - - - -;;; DEV ************************************************************** -; additional plugins (and dependend code) that is in development (probably broken or incomplete) -; ********************************************************************* - -; DEV : 4096k version ---------------------------- -[env:dev_ESP8266_4M1M] -extends = esp8266_4M1M -platform = ${dev.platform} -build_flags = ${esp8266_4M1M.build_flags} ${dev.build_flags} - - - -;;; HARDWARE SPECIFIC VERSIONS *********************************************************** -; versions specially designed to fit, and contents only needed plugins for each hardware ; -; **************************************************************************************** - -; ITEAD Products ; ****; ****; ****; ****; ****;; - -; ITEAD / SONOFF BASIC version ------------------ -;[env:hard_SONOFF_BASIC] -;platform = ${esp8266_1M.platform} -;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_BASIC -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;board = ${esp8266_1M.board} -;build_unflags = ${esp8266_1M.build_unflags} - - -; ITEAD / SONOFF TH10/TH16 version ------------------- -;[env:hard_SONOFF_TH1x] -;platform = ${esp8266_1M.platform} -;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_TH1x -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;board = ${esp8266_1M.board} -;build_unflags = ${esp8266_1M.build_unflags} - -; ITEAD / SONOFF POW & POW R2 version -------------------- -; Sonoff Pow (ESP8266 - HLW8012) -; GPIO00 Button -; GPIO05 HLW8012 Sel output -; GPIO12 Red Led and Relay (0 = Off, 1 = On) -; GPIO13 HLW8012 CF1 voltage / current -; GPIO14 HLW8012 CF power -; GPIO15 Blue Led (0 = On, 1 = Off) - -; Sonoff Pow R2 (ESP8266 4M flash - CSE7766) -; GPIO00 Button -; GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor -; GPIO03 Serial TXD -; GPIO12 Red Led and Relay (0 = Off, 1 = On) -; GPIO13 Blue Led (0 = On, 1 = Off) -[env:hard_SONOFF_POW_4M1M] -extends = esp8266_4M1M, hard_esp82xx -platform = ${hard_esp82xx.platform} -build_flags = ${hard_esp82xx.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW - - -; Build including power measurement plugins for those devices that have only 1M flash. -; For example those made by BlitzWolf SHP -[env:hard_other_POW_ESP8285_1M] -extends = esp8285_1M, hard_esp82xx -platform = ${hard_esp82xx.platform} -build_flags = ${hard_esp82xx.build_flags} ${esp8285_1M.build_flags} -D PLUGIN_SET_SONOFF_POW - - -; ITEAD / SONOFF S20 version -------------------- -;[env:hard_SONOFF_S20] -;platform = ${esp8266_1M.platform} -;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_S2x -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;board = ${esp8266_1M.board} -;build_unflags = ${esp8266_1M.build_unflags} - - -; ITEAD / SONOFF 4CH version -------------------- -;[env:hard_SONOFF_4CH] -;platform = ${esp8266_1M.platform} -;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_4CH -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;board = ${esp8266_1M.board} -;build_unflags = ${esp8266_1M.build_unflags} - - - -; ITEAD / SONOFF TOUCH version ------------------ -;[env:hard_SONOFF_TOUCH] -;platform = ${esp8266_1M.platform} -;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_TOUCH -;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu} -;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode} -;board = ${esp8266_1M.board} -;build_unflags = ${esp8266_1M.build_unflags} -; - - -; Shelly1 Open Source (ESP8266-2MB) -; https://shelly.cloud/shelly1-open-source/ -; GPIO04 Relay (non inverted) -; GPIO05 Button -[env:hard_Shelly_1_2M256] -extends = esp8266_2M256 -platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8266_2M256.build_flags} -D PLUGIN_SET_SHELLY_1 - -; Ventus W266 weather station -; https://www.letscontrolit.com/wiki/index.php/VentusW266 -[env:hard_Ventus_W266] -extends = esp8266_1M -platform = ${normal.platform} -build_flags = ${normal.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_VENTUS_W266 - - - - -; Special env for memory analysis -; This may generate builds which cannot be run, so do not upload to a node. -; Has the same lib_ignore as the IR builds, or else those cannot be built for testing -[env:memanalyze_ESP8266] -extends = esp8266_4M1M -platform = ${regular_platform.platform} -lib_ignore = ESP32_ping, ESP32WebServer -build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24 -extra_scripts = pre:pre_memanalyze.py diff --git a/platformio_core_defs.ini b/platformio_core_defs.ini new file mode 100644 index 0000000000..9a1a9a519b --- /dev/null +++ b/platformio_core_defs.ini @@ -0,0 +1,115 @@ +; ********************************************************************* + +; **** Definition cheat sheet: +; board_build.flash_mode in terms of performance: QIO > QOUT > DIO > DOUT +; for lib_ldf_mode, see http://docs.platformio.org/en/latest/librarymanager/ldf.html;ldf + +; **** Frequently used build flags: +; Use custom.h file to override default settings for ESPeasy: -D USE_CUSTOM_H +; Set VCC mode to measure Vcc of ESP chip : -D FEATURE_ADC_VCC=true + +; Build Flags: +; -DUSE_CONFIG_OVERRIDE +; lwIP 1.4 (Default) +; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH +; lwIP 2 - Low Memory +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY +; lwIP 2 - Higher Bandwitdh +; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH +; VTABLES in Flash (default) +; -DVTABLES_IN_FLASH +; VTABLES in Heap +; -DVTABLES_IN_DRAM +; VTABLES in IRAM +; -DVTABLES_IN_IRAM +; NO_EXTRA_4K_HEAP - this forces the default NONOS-SDK user's heap location +; Default currently overlaps cont stack (Arduino) with sys stack (System) +; to save up-to 4 kB of heap. (starting core_2.4.2) +; ESP8266_DISABLE_EXTRA4K - Calls disable_extra4k_at_link_time() from setup +; to force the linker keep user's stack in user ram. +; CONT_STACKSIZE to set the 'cont' (Arduino) stack size. Default = 4096 +; -mtarget-align see: https://github.com/arendst/Sonoff-Tasmota/issues/3678#issuecomment-419712437 + +[esp82xx_defaults] +build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' + -D NDEBUG + -lstdc++ -lsupc++ + -mtarget-align + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DVTABLES_IN_FLASH + -DPUYA_SUPPORT=1 + +[esp82xx_2_5_x] +build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' + -DNDEBUG + -mtarget-align + -DVTABLES_IN_FLASH + -fno-exceptions + -lstdc++ + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH + -DPUYA_SUPPORT=1 + -DCORE_POST_2_5_0 + +[esp82xx_2_6_x] +build_flags = ${esp82xx_2_5_x.build_flags} + -O2 + -DBEARSSL_SSL_BASIC + -DCORE_POST_2_6_0 + + +;[core_2_3_0] +;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.5.0_Puya +;build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' +; -DNDEBUG +; -DVTABLES_IN_FLASH +; -fno-exceptions +; -DPUYA_SUPPORT=1 +; -DARDUINO_ESP8266_RELEASE_2_3_0 +; -DFORCE_PRE_2_5_0 +;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR + +;[core_2_4_0] +;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.6.0_Puya +;build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_0 -DFORCE_PRE_2_5_0 +;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR + +;[core_2_4_1] +;platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.7.3_Puya +;build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_1 -DFORCE_PRE_2_5_0 +;lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR + + +[core_2_4_2] +platform = https://github.com/TD-er/platform-espressif8266.git#patch/v1.8.0_Puya +build_flags = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_2 -DFORCE_PRE_2_5_0 +lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR + +;[core_2_5_0] +;platform = espressif8266@2.0.4 +;build_flags = ${esp82xx_2_5_x.build_flags} + +;[core_2_5_2] +;platform = espressif8266@2.2.3 +;build_flags = ${esp82xx_2_5_x.build_flags} + +[core_2_6_0] +platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_0 +build_flags = ${esp82xx_2_6_x.build_flags} + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 + +[core_2_6_1] +platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_1 +build_flags = ${esp82xx_2_6_x.build_flags} + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 + +[core_stage] +platform = https://github.com/platformio/platform-espressif8266.git#feature/stage +build_flags = ${esp82xx_2_6_x.build_flags} + -DARDUINO_ESP8266_RELEASE='"2.7.0-dev stage"' + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 + +[core_esp32_1_11_1] +platform = espressif32@1.11.1 + +[core_esp32_stage] +platform = https://github.com/platformio/platform-espressif32.git#feature/stage diff --git a/platformio_esp32_envs.ini b/platformio_esp32_envs.ini new file mode 100644 index 0000000000..278b047b5b --- /dev/null +++ b/platformio_esp32_envs.ini @@ -0,0 +1,52 @@ +;;; ESP32 test build ********************************************************************; +; Status of the ESP32 support is still considered "beta" ; +; Most plugins work just fine on ESP32. ; +; Especially some plugins using serial may not run very well (GPS does run fine). ; +; ***************************************************************************************; + + + +[esp32_common] +extends = common +platform = ${core_esp32_1_11_1.platform} +lib_ignore = AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, ESP32_ping, HeatpumpIR +lib_deps = https://github.com/TD-er/ESPEasySerial.git +board_build.f_flash = 80000000L +board_build.flash_mode = dout +board_upload.maximum_size = 1900544 +board_build.partitions = esp32_partition_app1810k_spiffs316k.csv +build_unflags = -Wall +build_flags = ${mqtt_flags.build_flags} + -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' + -DCONFIG_FREERTOS_ASSERT_DISABLE + -DCONFIG_LWIP_ESP_GRATUITOUS_ARP + -DCONFIG_LWIP_GARP_TMR_INTERVAL=30 + + + +; Custom: 4096k version -------------------------- +[env:custom_ESP32_4M316k] +extends = esp32_common +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_BUILD_CUSTOM +board = esp32dev +extra_scripts = pre:pre_custom_esp32.py + + +[env:test_ESP32_4M316k] +extends = esp32_common +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_SET_TEST_ESP32 +board = esp32dev + + +[env:test_ESP32-wrover-kit_4M316k] +extends = esp32_common +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_SET_TEST_ESP32 +board = esp-wrover-kit +upload_protocol = ftdi +debug_tool = ftdi +debug_extra_cmds = break Misc.ino:3011 + + diff --git a/platformio_esp82xx_base.ini b/platformio_esp82xx_base.ini new file mode 100644 index 0000000000..189fdbe33a --- /dev/null +++ b/platformio_esp82xx_base.ini @@ -0,0 +1,207 @@ +;;; ESP82xx base definitions******************************************* +; Basic definitions used in ESP82xx environments ; +; ********************************************************************* + + + +[regular_platform] +build_unflags = +build_flags = ${core_2_6_1.build_flags} +platform = ${core_2_6_1.platform} + +[beta_platform] +build_unflags = +build_flags = ${core_stage.build_flags} +platform = ${core_stage.platform} + + + +[esp82xx_common] +extends = common +board_build.f_cpu = 80000000L +build_flags = ${debug_flags.build_flags} ${mqtt_flags.build_flags} -DHTTPCLIENT_1_1_COMPATIBLE=0 +build_unflags = -DDEBUG_ESP_PORT +lib_deps = https://github.com/TD-er/ESPEasySerial.git +lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR, SD(esp8266), SDFS +board = esp12e + + + +;;; NORMAL (STABLE) *************************************************** +; normal version with stable plugins ; +; ********************************************************************* + +[normal] +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} + +[normal_beta] +platform = ${beta_platform.platform} +build_flags = ${beta_platform.build_flags} + + +;;; TEST ************************************************************* +; additional plugins (and dependend code) that is marked as TESTING ; +; Includes "normal" + "testing" plugins ; +; ********************************************************************* + +[testing] +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} -DPLUGIN_BUILD_TESTING + +[testing_beta] +platform = ${beta_platform.platform} +build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_TESTING + + +;;; DEV ************************************************************** +; additional plugins (and dependend code) that is in development ; +; (probably broken or incomplete) ; +; ********************************************************************* + +[dev] +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} -DPLUGIN_BUILD_DEV + + +;;; IR *********************************************************** +; IR builds ; +; ********************************************************************* + +[ir] +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} +lib_ignore = ESP32_ping, ESP32WebServer, SD(esp8266), SDFS + +[minimal_ir] +extends = ir +build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IR + +[minimal_ir_extended] +extends = ir +build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IRext + +[normal_ir] +extends = ir +build_flags = ${ir.build_flags} -DPLUGIN_BUILD_NORMAL_IR + +[normal_ir_extended] +extends = ir +build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED + +[normal_ir_extended_no_rx] +extends = ir +build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED_NO_RX + + + +;;; 1MB flash nodes ************************************************** +; Layout for 1M flash nodes ; +; ********************************************************************* +[esp82xx_1M] +extends = esp82xx_common +board_build.flash_mode = dout +board_upload.maximum_size = 786432 +build_flags = -Wl,-Tesp8266.flash.1m128.ld + -DSIZE_1M + -DBUILD_NO_DEBUG + ${esp82xx_common.build_flags} + +[esp8266_1M] +extends = esp82xx_1M +board = esp01_1m + +[esp8285_1M] +extends = esp82xx_1M +board = esp8285 +build_flags = ${esp8266_1M.build_flags} -DESP8285 + + +;;; Minimal *********************************************************** +; Minimal build size for OTA ; +; ********************************************************************* +[esp82xx_1M_OTA] +extends = esp82xx_common +board_build.flash_mode = dout +board_upload.maximum_size = 616448 +build_flags = ${esp82xx_1M.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA + + +[esp8266_1M_OTA] +extends = esp82xx_1M_OTA +board = esp01_1m + +[esp8285_1M_OTA] +extends = esp82xx_1M_OTA +board = esp8285 +build_flags = ${esp82xx_1M_OTA.build_flags} -DESP8285 + + +;;; 2MB flash nodes ************************************************** +; Layout for 2M flash nodes ; +; ********************************************************************* + +[esp8266_2M256] +extends = esp82xx_common +board = esp12e +board_build.flash_mode = dio +board_upload.maximum_size = 1044464 +build_flags = -Wl,-Tesp8266.flash.2m256.ld + ${esp82xx_common.build_flags} + +[espWroom2M] +extends = esp82xx_common +board = esp12e +board_build.flash_mode = dio +board_upload.maximum_size = 1044464 +build_flags = -Wl,-Tesp8266.flash.2m.ld + ${esp82xx_common.build_flags} + +[espWroom2M256] +extends = esp82xx_common +board_build.flash_mode = dout +board_upload.maximum_size = 1044464 +board = esp_wroom_02 +build_flags = -Wl,-Tesp8266.flash.2m256.ld + ${esp82xx_common.build_flags} + + +;;; 4MB flash nodes ************************************************** +; Layout for 4M flash nodes ; +; ********************************************************************* + +[esp8266_4M1M] +extends = esp82xx_common +board = esp12e +board_build.flash_mode = dio +board_upload.maximum_size = 1044464 +build_flags = -Wl,-Tesp8266.flash.4m1m.ld + ${esp82xx_common.build_flags} + +[esp8266_4M2M] +extends = esp82xx_common +board = esp12e +board_build.flash_mode = dio +board_upload.maximum_size = 1044464 +build_flags = -Wl,-Tesp8266.flash.4m2m.ld + ${esp82xx_common.build_flags} + + + +;;; 16MB flash nodes ************************************************* +; Layout for 16M flash nodes ; +; ********************************************************************* + +; Configuration for the Wemos D1 mini pro (16M) +; This configuration can only be used with core versions 2.5.0 or newer. +; Performance of 14M SPIFFS is really slow. +; See https://github.com/esp8266/Arduino/issues/5932 +[esp8266_16M] +extends = esp82xx_common +board = esp12e +board_build.flash_mode = dio +board_upload.maximum_size = 1044464 +build_flags = -Wl,-Tesp8266.flash.16m14m.ld + -DSPIFFS_MAX_OPEN_FILES=20 + ${esp82xx_common.build_flags} + diff --git a/platformio_esp82xx_envs.ini b/platformio_esp82xx_envs.ini new file mode 100644 index 0000000000..4c7947c4ad --- /dev/null +++ b/platformio_esp82xx_envs.ini @@ -0,0 +1,287 @@ +;;; Custom builds ***************************************************** +; Use either the plugins defined in ; +; pre_custom_esp82xx.py or Custom.h ; +; ********************************************************************* + + +[hard_esp82xx] +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} + -DBUILD_NO_DEBUG + -DPLUGIN_BUILD_CUSTOM + + +; Custom: 4M1M version -------------------------- +[env:custom_ESP8266_4M1M] +extends = esp8266_4M1M +platform = ${beta_platform.platform} +build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + +; Custom: 4M2M version -------------------------- +[env:custom_ESP8266_4M2M] +extends = esp8266_4M2M +platform = ${beta_platform.platform} +build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + + + +;;; NORMAL (STABLE) *************************************************** +; normal version with stable plugins ; +; ********************************************************************* + +; NORMAL: 1024k version -------------------------- +[env:normal_ESP8266_1M] +extends = esp8266_1M +platform = ${regular_platform.platform} +build_flags = ${esp8266_1M.build_flags} + + +[env:normal_ESP8266_1M_VCC] +extends = esp8266_1M +platform = ${regular_platform.platform} +build_flags = ${esp8266_1M.build_flags} -D FEATURE_ADC_VCC=true + + +; NORMAL: 1024k for esp8285 ---------------------- +[env:normal_ESP8285_1M] +extends = esp8285_1M +platform = ${regular_platform.platform} +build_flags = ${esp8285_1M.build_flags} + + +; NORMAL: 2048k WROOM02 version -------------------------- +[env:normal_WROOM02_2M] +extends = espWroom2M +platform = ${regular_platform.platform} +build_flags = ${espWroom2M.build_flags} ${regular_platform.build_flags} + + +; NORMAL: 2048k WROOM02 version 256k SPIFFS -------------------------- +[env:normal_WROOM02_2M256] +extends = espWroom2M256 +platform = ${regular_platform.platform} +build_flags = ${espWroom2M256.build_flags} ${regular_platform.build_flags} + + +; NORMAL: 4096k version -------------------------- +[env:normal_ESP8266_4M1M] +extends = esp8266_4M1M +platform = ${regular_platform.platform} +build_flags = ${esp8266_4M1M.build_flags} ${regular_platform.build_flags} + +; NORMAL: 16M version -------------------------- +[env:normal_ESP8266_16M] +extends = esp8266_16M +platform = ${regular_platform.platform} +build_flags = ${esp8266_16M.build_flags} ${regular_platform.build_flags} + + +;;; Minimal *********************************************************** +; Minimal build size for OTA ; +; ********************************************************************* + +[env:minimal_core_242_ESP8266_1M_OTA] +extends = esp8266_1M_OTA +platform = ${core_2_4_2.platform} +build_flags = ${esp8266_1M_OTA.build_flags} ${core_2_4_2.build_flags} + +[env:minimal_core_242_ESP8285_1M_OTA] +extends = esp8285_1M_OTA +platform = ${core_2_4_2.platform} +build_flags = ${esp8285_1M_OTA.build_flags} ${core_2_4_2.build_flags} + +[env:minimal_core_261_ESP8266_1M_OTA] +extends = esp8266_1M_OTA +platform = ${regular_platform.platform} +build_flags = ${esp8266_1M_OTA.build_flags} ${regular_platform.build_flags} + +[env:minimal_core_261_ESP8285_1M_OTA] +extends = esp8285_1M_OTA +platform = ${regular_platform.platform} +build_flags = ${esp8285_1M_OTA.build_flags} ${regular_platform.build_flags} + + + + +;;; IR *********************************************************** +; IR builds ; +; ********************************************************************* + + +; Minimal IR: 1024k version -------------------------- +; Build including IR libraries, including extended AC commands +; Minimal set of other plugins +[env:minimal_IRext_ESP8266_1M] +extends = esp8266_1M +platform = ${minimal_ir_extended.platform} +lib_ignore = ${minimal_ir_extended.lib_ignore} +build_flags = ${minimal_ir_extended.build_flags} ${esp8266_1M.build_flags} +build_unflags = ${esp8266_1M_OTA.build_unflags} -DPLUGIN_BUILD_NORMAL_IR + + +; Minimal IR: 4096k version -------------------------- +; Build including IR libraries, INCLUDING extended AC commands +; Includes Extended IR AC commands (takes a lot more program space) +; 4M flash, 1M SPIFFS +[env:minimal_IRext_ESP8266_4M1M] +extends = esp8266_4M1M +platform = ${minimal_ir_extended.platform} +lib_ignore = ${minimal_ir_extended.lib_ignore} +build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M1M.build_flags} + +; 4M flash, 2M SPIFFS +[env:minimal_IRext_ESP8266_4M2M] +extends = esp8266_4M2M +platform = ${minimal_ir_extended.platform} +lib_ignore = ${minimal_ir_extended.lib_ignore} +build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M2M.build_flags} + + +; NORMAL IR: 4096k version -------------------------- +; Build including IR libraries, INCLUDING extended AC commands +; Includes Extended IR AC commands (takes a lot more program space) +; 4M flash, 2M SPIFFS +[env:normal_IRext_no_rx_ESP8266_4M2M] +extends = esp8266_4M2M +platform = ${normal_ir_extended_no_rx.platform} +lib_ignore = ${normal_ir_extended_no_rx.lib_ignore} +build_flags = ${normal_ir_extended_no_rx.build_flags} ${esp8266_4M2M.build_flags} + + + +;;; TEST ************************************************************* +; additional plugins (and dependend code) that is marked as TESTING ; +; Includes "normal" + "testing" plugins ; +; ********************************************************************* + + +; TEST: 4096k version + FEATURE_ADC_VCC ---------- +[env:test_ESP8266_4M_VCC] +extends = esp8266_4M1M +platform = ${testing.platform} +build_flags = ${esp8266_4M1M.build_flags} ${testing.build_flags} -D FEATURE_ADC_VCC=true + + +[env:test_beta_ESP8266_4M1M] +extends = esp8266_4M1M +platform = ${testing_beta.platform} +build_flags = ${esp8266_4M1M.build_flags} ${testing_beta.build_flags} + + +[env:test_beta_ESP8266_16M] +extends = esp8266_16M +platform = ${testing_beta.platform} +build_flags = ${esp8266_16M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y + + + + + + + +;;; DEV ************************************************************** +; additional plugins (and dependend code) that is in development ; +; (probably broken or incomplete) ; +; ********************************************************************* + +; DEV : 4096k version ---------------------------- +[env:dev_ESP8266_4M1M] +extends = esp8266_4M1M +platform = ${dev.platform} +build_flags = ${esp8266_4M1M.build_flags} ${dev.build_flags} + + + +;;; HARDWARE SPECIFIC VERSIONS *********************************************************** +; versions specially designed to fit, and contents only needed plugins for each hardware ; +; **************************************************************************************** + +; ITEAD Products + +; ITEAD / SONOFF BASIC version ------------------ +;[env:hard_SONOFF_BASIC] +;extends = esp8266_1M, hard_esp82xx +;platform = ${hard_esp82xx.platform} +;build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_BASIC + + +; ITEAD / SONOFF TH10/TH16 version ------------------- +;[env:hard_SONOFF_TH1x] +;extends = esp8266_1M, hard_esp82xx +;platform = ${hard_esp82xx.platform} +;build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_TH1x + +; ITEAD / SONOFF POW & POW R2 version -------------------- +; Sonoff Pow (ESP8266 - HLW8012) +; GPIO00 Button +; GPIO05 HLW8012 Sel output +; GPIO12 Red Led and Relay (0 = Off, 1 = On) +; GPIO13 HLW8012 CF1 voltage / current +; GPIO14 HLW8012 CF power +; GPIO15 Blue Led (0 = On, 1 = Off) + +; Sonoff Pow R2 (ESP8266 4M flash - CSE7766) +; GPIO00 Button +; GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor +; GPIO03 Serial TXD +; GPIO12 Red Led and Relay (0 = Off, 1 = On) +; GPIO13 Blue Led (0 = On, 1 = Off) +[env:hard_SONOFF_POW_4M1M] +extends = esp8266_4M1M, hard_esp82xx +platform = ${hard_esp82xx.platform} +build_flags = ${hard_esp82xx.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW + + +; Build including power measurement plugins for those devices that have only 1M flash. +; For example those made by BlitzWolf SHP +[env:hard_other_POW_ESP8285_1M] +extends = esp8266_1M_OTA, hard_esp82xx +platform = ${hard_esp82xx.platform} +build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_POW + + +; ITEAD / SONOFF S20 version -------------------- +;[env:hard_SONOFF_S20] +;extends = esp8266_1M_OTA, hard_esp82xx +;platform = ${hard_esp82xx.platform} +;build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_S2x + + +; ITEAD / SONOFF 4CH version -------------------- +;[env:hard_SONOFF_4CH] +;extends = esp8285_1M_OTA, hard_esp82xx +;platform = ${hard_esp82xx.platform} +;build_flags = ${hard_esp82xx.build_flags} ${esp8285_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_4CH + + + +; ITEAD / SONOFF TOUCH version ------------------ +;[env:hard_SONOFF_TOUCH] +;extends = esp8285_1M_OTA, hard_esp82xx +;platform = ${hard_esp82xx.platform} +;build_flags = ${hard_esp82xx.build_flags} ${esp8285_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_TOUCH + + +; Shelly1 Open Source (ESP8266-2MB) +; https://shelly.cloud/shelly1-open-source/ +; GPIO04 Relay (non inverted) +; GPIO05 Button +[env:hard_Shelly_1_2M256] +extends = esp8266_2M256, hard_esp82xx +platform = ${hard_esp82xx.platform} +build_flags = ${hard_esp82xx.build_flags} ${esp8266_2M256.build_flags} -D PLUGIN_SET_SHELLY_1 + +; Ventus W266 weather station +; https://www.letscontrolit.com/wiki/index.php/VentusW266 +[env:hard_Ventus_W266] +extends = esp8266_1M, hard_esp82xx +platform = ${hard_esp82xx.platform} +build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_VENTUS_W266 + + diff --git a/platformio_special_envs.ini b/platformio_special_envs.ini new file mode 100644 index 0000000000..d27ad5ec94 --- /dev/null +++ b/platformio_special_envs.ini @@ -0,0 +1,45 @@ +;Special build environment definitions. +;These are used for analysis and debugging. +; +;!! DO NOT LOAD THESE ONTO A MODULE !! + +[debug_pio] +build_type = debug +check_tool = clangtidy +build_flags = ${compiler_warnings.build_flags} + + +[env:debug_custom_ESP8266_4M1M] +extends = esp8266_4M1M, debug_pio +platform = ${regular_platform.platform} +build_flags = ${esp8266_4M1M.build_flags} ${regular_platform.build_flags} ${debug_pio.build_flags} -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + +[env:debug_beta_custom_ESP8266_4M1M] +extends = esp8266_4M1M, debug_pio +platform = ${beta_platform.platform} +build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} ${debug_pio.build_flags} -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + +[env:debug_custom_ESP32_4M316k] +extends = esp32_common, debug_pio +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} -DPLUGIN_BUILD_CUSTOM +board = esp32dev +extra_scripts = pre:pre_custom_esp32.py + + + +; Special env for memory analysis +; This may generate builds which cannot be run, so do not upload to a node. +; Has the same lib_ignore as the IR builds, or else those cannot be built for testing +[env:memanalyze_ESP8266] +extends = esp8266_4M1M +platform = ${regular_platform.platform} +lib_ignore = ESP32_ping, ESP32WebServer +build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24 +extra_scripts = pre:pre_memanalyze.py diff --git a/pre_extra_script.py b/pre_custom_esp82xx.py similarity index 100% rename from pre_extra_script.py rename to pre_custom_esp82xx.py diff --git a/pre_default_check.py b/pre_default_check.py new file mode 100644 index 0000000000..d620b0956a --- /dev/null +++ b/pre_default_check.py @@ -0,0 +1,23 @@ +# Simple check for the configuration of an environment. + + +Import("env") +import os + +# access to global construction environment +#print env + +# Dump construction environment (for debug purpose) +#print env.Dump() + +my_flags = env.ParseFlags(env['BUILD_FLAGS']) + + +# print the defines +print("CPPDEFINES: {}".format(my_flags.get("CPPDEFINES"))) +print("LINKFLAGS: {}".format(my_flags.get("LINKFLAGS"))) +#print(my_flags) + + +if (len(my_flags.get("CPPDEFINES")) == 0): + raise ValueError diff --git a/tools/build_ESPeasy.sh b/tools/build_ESPeasy.sh index ba79b32910..3e5a51ded1 100755 --- a/tools/build_ESPeasy.sh +++ b/tools/build_ESPeasy.sh @@ -81,8 +81,6 @@ for ENV in \ custom_ESP8266_4M1M\ custom_ESP8266_4M2M\ dev_ESP8266_4M1M\ - esp-wrover-kit_test_4M316k\ - esp32test_4M316k\ hard_SONOFF_POW_4M1M\ hard_Shelly_1_2M256\ hard_Ventus_W266\ @@ -104,7 +102,9 @@ for ENV in \ normal_WROOM02_2M\ test_ESP8266_4M_VCC\ test_beta_ESP8266_16M\ - test_beta_ESP8266_4M1M;\ + test_beta_ESP8266_4M1M\ + test_ESP32_4M316k\ + test_ESP32-wrover-kit_4M316k;\ do PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e ${ENV} done From a8776b6fc5c84615cfe67d2bf546fa55ef2f1875 Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Thu, 21 Nov 2019 10:23:30 +0100 Subject: [PATCH 12/15] [PIO] Add core 2.6.1 SDK3 builds and PIO env list for Vagrant Create a file named "pio_envlist.txt" next to the Custom.h for Vagrant with the selected env names in it, one per line. Vagrant will then build all named PIO environments. --- before_deploy | 40 ++---------- memanalyzer.py | 2 +- platformio_core_defs.ini | 8 +++ platformio_esp82xx_base.ini | 5 ++ platformio_esp82xx_envs.ini | 117 ++++++++++++++++++++++++++++-------- platformio_special_envs.ini | 8 +-- tools/build_ESPeasy.sh | 41 ++----------- tools/vagrant/bootstrap.sh | 18 +++++- 8 files changed, 133 insertions(+), 106 deletions(-) diff --git a/before_deploy b/before_deploy index 526557a339..4e5636406c 100755 --- a/before_deploy +++ b/before_deploy @@ -39,37 +39,10 @@ fi mkdir -p ${TMP_DIST}/memstats -# Same list in .travis.yml and tools/build_ESPeasy.sh -for ENV in \ - custom_ESP32_4M316k\ - custom_ESP8266_4M1M\ - custom_ESP8266_4M2M\ - dev_ESP8266_4M1M\ - hard_SONOFF_POW_4M1M\ - hard_Shelly_1_2M256\ - hard_Ventus_W266\ - hard_other_POW_ESP8285_1M\ - minimal_IRext_ESP8266_1M\ - minimal_IRext_ESP8266_4M1M\ - minimal_IRext_ESP8266_4M2M\ - minimal_core_242_ESP8266_1M_OTA\ - minimal_core_242_ESP8285_1M_OTA\ - minimal_core_261_ESP8266_1M_OTA\ - minimal_core_261_ESP8285_1M_OTA\ - normal_ESP8266_16M\ - normal_ESP8266_1M\ - normal_ESP8266_1M_VCC\ - normal_ESP8266_4M1M\ - normal_ESP8285_1M\ - normal_IRext_no_rx_ESP8266_4M2M\ - normal_WROOM02_2M256\ - normal_WROOM02_2M\ - test_ESP8266_4M_VCC\ - test_beta_ESP8266_16M\ - test_beta_ESP8266_4M1M\ - test_ESP32_4M316k\ - test_ESP32-wrover-kit_4M316k;\ -do +# Must look into all possible env definitions. +# Exclude so called "spec_" (special) builds +for ENV in `grep "^\[env:" platformio*.ini |cut -d'[' -f2|cut -d']' -f1|cut -d':' -f2|sort -n|grep -v spec_`; +do MAX_FILESIZE=1044464 if [[ ${ENV} == *"_1M"* ]]; then # max 872 kiB - 16 bytes @@ -79,14 +52,11 @@ do # max 600 kiB - 16 bytes MAX_FILESIZE=614384 fi - if [[ ${ENV} == *"esp32"* ]]; then - MAX_FILESIZE=1310720 - fi if [[ ${ENV} == *"4M316k"* ]]; then # ESP32 with 1800k of sketch space. MAX_FILESIZE=1900544 fi - if [[ ${ENV} == *"ebug_custom"* ]]; then + if [[ ${ENV} == *"debug_"* ]]; then # Debug env, used for analysis, not to be run on a node. MAX_FILESIZE=0 fi diff --git a/memanalyzer.py b/memanalyzer.py index e233f14e0d..a2a4566b70 100755 --- a/memanalyzer.py +++ b/memanalyzer.py @@ -23,7 +23,7 @@ TOTAL_IRAM = 32786; TOTAL_DRAM = 81920; -env="memanalyze_ESP8266" +env="spec_memanalyze_ESP8266" sections = OrderedDict([ ("data", "Initialized Data (RAM)"), diff --git a/platformio_core_defs.ini b/platformio_core_defs.ini index 9a1a9a519b..d1adf9b73c 100644 --- a/platformio_core_defs.ini +++ b/platformio_core_defs.ini @@ -92,6 +92,9 @@ lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, Heatpum ;platform = espressif8266@2.2.3 ;build_flags = ${esp82xx_2_5_x.build_flags} + +; See for SDK flags: https://github.com/esp8266/Arduino/blob/master/tools/platformio-build.py + [core_2_6_0] platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_0 build_flags = ${esp82xx_2_6_x.build_flags} @@ -102,6 +105,11 @@ platform = https://github.com/Jason2866/platform-espressif8266. build_flags = ${esp82xx_2_6_x.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105 +[core_2_6_1_sdk3] +platform = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_1 +build_flags = ${esp82xx_2_6_x.build_flags} + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3 + [core_stage] platform = https://github.com/platformio/platform-espressif8266.git#feature/stage build_flags = ${esp82xx_2_6_x.build_flags} diff --git a/platformio_esp82xx_base.ini b/platformio_esp82xx_base.ini index 189fdbe33a..9b5359d48b 100644 --- a/platformio_esp82xx_base.ini +++ b/platformio_esp82xx_base.ini @@ -9,6 +9,11 @@ build_unflags = build_flags = ${core_2_6_1.build_flags} platform = ${core_2_6_1.platform} +[core261_sdk3_platform] +build_unflags = +build_flags = ${core_2_6_1_sdk3.build_flags} +platform = ${core_2_6_1_sdk3.platform} + [beta_platform] build_unflags = build_flags = ${core_stage.build_flags} diff --git a/platformio_esp82xx_envs.ini b/platformio_esp82xx_envs.ini index 4c7947c4ad..888c959288 100644 --- a/platformio_esp82xx_envs.ini +++ b/platformio_esp82xx_envs.ini @@ -14,8 +14,30 @@ build_flags = ${regular_platform.build_flags} ; Custom: 4M1M version -------------------------- [env:custom_ESP8266_4M1M] extends = esp8266_4M1M +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} + ${esp8266_4M1M.build_flags} + -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + +[env:custom_sdk3_ESP8266_4M1M] +extends = esp8266_4M1M +platform = ${core261_sdk3_platform.platform} +build_flags = ${core261_sdk3_platform.build_flags} + ${esp8266_4M1M.build_flags} + -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + +[env:custom_beta_ESP8266_4M1M] +extends = esp8266_4M1M platform = ${beta_platform.platform} -build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM +build_flags = ${beta_platform.build_flags} + ${esp8266_4M1M.build_flags} + -DPLUGIN_BUILD_CUSTOM lib_ignore = ESP32_ping, ESP32WebServer extra_scripts = pre:pre_custom_esp82xx.py @@ -23,8 +45,10 @@ extra_scripts = pre:pre_custom_esp82xx.py ; Custom: 4M2M version -------------------------- [env:custom_ESP8266_4M2M] extends = esp8266_4M2M -platform = ${beta_platform.platform} -build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} + ${esp8266_4M1M.build_flags} + -DPLUGIN_BUILD_CUSTOM lib_ignore = ESP32_ping, ESP32WebServer extra_scripts = pre:pre_custom_esp82xx.py @@ -39,47 +63,55 @@ extra_scripts = pre:pre_custom_esp82xx.py [env:normal_ESP8266_1M] extends = esp8266_1M platform = ${regular_platform.platform} -build_flags = ${esp8266_1M.build_flags} +build_flags = ${regular_platform.build_flags} + ${esp8266_1M.build_flags} [env:normal_ESP8266_1M_VCC] extends = esp8266_1M platform = ${regular_platform.platform} -build_flags = ${esp8266_1M.build_flags} -D FEATURE_ADC_VCC=true +build_flags = ${regular_platform.build_flags} + ${esp8266_1M.build_flags} + -D FEATURE_ADC_VCC=true ; NORMAL: 1024k for esp8285 ---------------------- [env:normal_ESP8285_1M] extends = esp8285_1M platform = ${regular_platform.platform} -build_flags = ${esp8285_1M.build_flags} +build_flags = ${regular_platform.build_flags} + ${esp8285_1M.build_flags} ; NORMAL: 2048k WROOM02 version -------------------------- [env:normal_WROOM02_2M] extends = espWroom2M platform = ${regular_platform.platform} -build_flags = ${espWroom2M.build_flags} ${regular_platform.build_flags} +build_flags = ${regular_platform.build_flags} + ${espWroom2M.build_flags} ; NORMAL: 2048k WROOM02 version 256k SPIFFS -------------------------- [env:normal_WROOM02_2M256] extends = espWroom2M256 platform = ${regular_platform.platform} -build_flags = ${espWroom2M256.build_flags} ${regular_platform.build_flags} +build_flags = ${regular_platform.build_flags} + ${espWroom2M256.build_flags} ; NORMAL: 4096k version -------------------------- [env:normal_ESP8266_4M1M] extends = esp8266_4M1M platform = ${regular_platform.platform} -build_flags = ${esp8266_4M1M.build_flags} ${regular_platform.build_flags} +build_flags = ${regular_platform.build_flags} + ${esp8266_4M1M.build_flags} ; NORMAL: 16M version -------------------------- [env:normal_ESP8266_16M] extends = esp8266_16M platform = ${regular_platform.platform} -build_flags = ${esp8266_16M.build_flags} ${regular_platform.build_flags} +build_flags = ${regular_platform.build_flags} + ${esp8266_16M.build_flags} ;;; Minimal *********************************************************** @@ -89,23 +121,38 @@ build_flags = ${esp8266_16M.build_flags} ${regular_platform.build_ [env:minimal_core_242_ESP8266_1M_OTA] extends = esp8266_1M_OTA platform = ${core_2_4_2.platform} -build_flags = ${esp8266_1M_OTA.build_flags} ${core_2_4_2.build_flags} +build_flags = ${core_2_4_2.build_flags} + ${esp8266_1M_OTA.build_flags} [env:minimal_core_242_ESP8285_1M_OTA] extends = esp8285_1M_OTA platform = ${core_2_4_2.platform} -build_flags = ${esp8285_1M_OTA.build_flags} ${core_2_4_2.build_flags} +build_flags = ${core_2_4_2.build_flags} + ${esp8285_1M_OTA.build_flags} [env:minimal_core_261_ESP8266_1M_OTA] extends = esp8266_1M_OTA platform = ${regular_platform.platform} -build_flags = ${esp8266_1M_OTA.build_flags} ${regular_platform.build_flags} +build_flags = ${regular_platform.build_flags} + ${esp8266_1M_OTA.build_flags} [env:minimal_core_261_ESP8285_1M_OTA] extends = esp8285_1M_OTA platform = ${regular_platform.platform} -build_flags = ${esp8285_1M_OTA.build_flags} ${regular_platform.build_flags} +build_flags = ${regular_platform.build_flags} + ${esp8285_1M_OTA.build_flags} +[env:minimal_core_261_sdk3_ESP8266_1M_OTA] +extends = esp8266_1M_OTA +platform = ${core261_sdk3_platform.platform} +build_flags = ${core261_sdk3_platform.build_flags} + ${esp8266_1M_OTA.build_flags} + +[env:minimal_core_261_sdk3_ESP8285_1M_OTA] +extends = esp8285_1M_OTA +platform = ${core261_sdk3_platform.platform} +build_flags = ${core261_sdk3_platform.build_flags} + ${esp8285_1M_OTA.build_flags} @@ -121,7 +168,8 @@ build_flags = ${esp8285_1M_OTA.build_flags} ${regular_platform.bui extends = esp8266_1M platform = ${minimal_ir_extended.platform} lib_ignore = ${minimal_ir_extended.lib_ignore} -build_flags = ${minimal_ir_extended.build_flags} ${esp8266_1M.build_flags} +build_flags = ${minimal_ir_extended.build_flags} + ${esp8266_1M.build_flags} build_unflags = ${esp8266_1M_OTA.build_unflags} -DPLUGIN_BUILD_NORMAL_IR @@ -133,14 +181,16 @@ build_unflags = ${esp8266_1M_OTA.build_unflags} -DPLUGIN_BUILD_NORMA extends = esp8266_4M1M platform = ${minimal_ir_extended.platform} lib_ignore = ${minimal_ir_extended.lib_ignore} -build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M1M.build_flags} +build_flags = ${minimal_ir_extended.build_flags} + ${esp8266_4M1M.build_flags} ; 4M flash, 2M SPIFFS [env:minimal_IRext_ESP8266_4M2M] extends = esp8266_4M2M platform = ${minimal_ir_extended.platform} lib_ignore = ${minimal_ir_extended.lib_ignore} -build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M2M.build_flags} +build_flags = ${minimal_ir_extended.build_flags} + ${esp8266_4M2M.build_flags} ; NORMAL IR: 4096k version -------------------------- @@ -151,7 +201,8 @@ build_flags = ${minimal_ir_extended.build_flags} ${esp8266_4M2M.bu extends = esp8266_4M2M platform = ${normal_ir_extended_no_rx.platform} lib_ignore = ${normal_ir_extended_no_rx.lib_ignore} -build_flags = ${normal_ir_extended_no_rx.build_flags} ${esp8266_4M2M.build_flags} +build_flags = ${normal_ir_extended_no_rx.build_flags} + ${esp8266_4M2M.build_flags} @@ -165,19 +216,24 @@ build_flags = ${normal_ir_extended_no_rx.build_flags} ${esp8266_4M [env:test_ESP8266_4M_VCC] extends = esp8266_4M1M platform = ${testing.platform} -build_flags = ${esp8266_4M1M.build_flags} ${testing.build_flags} -D FEATURE_ADC_VCC=true +build_flags = ${testing.build_flags} + ${esp8266_4M1M.build_flags} + -D FEATURE_ADC_VCC=true [env:test_beta_ESP8266_4M1M] extends = esp8266_4M1M platform = ${testing_beta.platform} -build_flags = ${esp8266_4M1M.build_flags} ${testing_beta.build_flags} +build_flags = ${testing_beta.build_flags} + ${esp8266_4M1M.build_flags} [env:test_beta_ESP8266_16M] extends = esp8266_16M platform = ${testing_beta.platform} -build_flags = ${esp8266_16M.build_flags} ${testing_beta.build_flags} -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y +build_flags = ${testing_beta.build_flags} + ${esp8266_16M.build_flags} + -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y @@ -194,7 +250,8 @@ build_flags = ${esp8266_16M.build_flags} ${testing_beta.build_flag [env:dev_ESP8266_4M1M] extends = esp8266_4M1M platform = ${dev.platform} -build_flags = ${esp8266_4M1M.build_flags} ${dev.build_flags} +build_flags = ${dev.build_flags} + ${esp8266_4M1M.build_flags} @@ -235,7 +292,9 @@ build_flags = ${esp8266_4M1M.build_flags} ${dev.build_flags} [env:hard_SONOFF_POW_4M1M] extends = esp8266_4M1M, hard_esp82xx platform = ${hard_esp82xx.platform} -build_flags = ${hard_esp82xx.build_flags} ${esp8266_4M1M.build_flags} -D PLUGIN_SET_SONOFF_POW +build_flags = ${hard_esp82xx.build_flags} + ${esp8266_4M1M.build_flags} + -D PLUGIN_SET_SONOFF_POW ; Build including power measurement plugins for those devices that have only 1M flash. @@ -243,7 +302,9 @@ build_flags = ${hard_esp82xx.build_flags} ${esp8266_4M1M.build_fla [env:hard_other_POW_ESP8285_1M] extends = esp8266_1M_OTA, hard_esp82xx platform = ${hard_esp82xx.platform} -build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_POW +build_flags = ${hard_esp82xx.build_flags} + ${esp8266_1M_OTA.build_flags} + -D PLUGIN_SET_SONOFF_POW ; ITEAD / SONOFF S20 version -------------------- @@ -275,13 +336,17 @@ build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M_OTA.build_f [env:hard_Shelly_1_2M256] extends = esp8266_2M256, hard_esp82xx platform = ${hard_esp82xx.platform} -build_flags = ${hard_esp82xx.build_flags} ${esp8266_2M256.build_flags} -D PLUGIN_SET_SHELLY_1 +build_flags = ${hard_esp82xx.build_flags} + ${esp8266_2M256.build_flags} + -D PLUGIN_SET_SHELLY_1 ; Ventus W266 weather station ; https://www.letscontrolit.com/wiki/index.php/VentusW266 [env:hard_Ventus_W266] extends = esp8266_1M, hard_esp82xx platform = ${hard_esp82xx.platform} -build_flags = ${hard_esp82xx.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_VENTUS_W266 +build_flags = ${hard_esp82xx.build_flags} + ${esp8266_1M_OTA.build_flags} + -D PLUGIN_SET_VENTUS_W266 diff --git a/platformio_special_envs.ini b/platformio_special_envs.ini index d27ad5ec94..179cd55167 100644 --- a/platformio_special_envs.ini +++ b/platformio_special_envs.ini @@ -9,7 +9,7 @@ check_tool = clangtidy build_flags = ${compiler_warnings.build_flags} -[env:debug_custom_ESP8266_4M1M] +[env:spec_debug_custom_ESP8266_4M1M] extends = esp8266_4M1M, debug_pio platform = ${regular_platform.platform} build_flags = ${esp8266_4M1M.build_flags} ${regular_platform.build_flags} ${debug_pio.build_flags} -DPLUGIN_BUILD_CUSTOM @@ -17,7 +17,7 @@ lib_ignore = ESP32_ping, ESP32WebServer extra_scripts = pre:pre_custom_esp82xx.py -[env:debug_beta_custom_ESP8266_4M1M] +[env:spec_debug_beta_custom_ESP8266_4M1M] extends = esp8266_4M1M, debug_pio platform = ${beta_platform.platform} build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} ${debug_pio.build_flags} -DPLUGIN_BUILD_CUSTOM @@ -25,7 +25,7 @@ lib_ignore = ESP32_ping, ESP32WebServer extra_scripts = pre:pre_custom_esp82xx.py -[env:debug_custom_ESP32_4M316k] +[env:spec_debug_custom_ESP32_4M316k] extends = esp32_common, debug_pio platform = ${esp32_common.platform} build_flags = ${esp32_common.build_flags} -DPLUGIN_BUILD_CUSTOM @@ -37,7 +37,7 @@ extra_scripts = pre:pre_custom_esp32.py ; Special env for memory analysis ; This may generate builds which cannot be run, so do not upload to a node. ; Has the same lib_ignore as the IR builds, or else those cannot be built for testing -[env:memanalyze_ESP8266] +[env:spec_memanalyze_ESP8266] extends = esp8266_4M1M platform = ${regular_platform.platform} lib_ignore = ESP32_ping, ESP32WebServer diff --git a/tools/build_ESPeasy.sh b/tools/build_ESPeasy.sh index 3e5a51ded1..af9e300a6f 100755 --- a/tools/build_ESPeasy.sh +++ b/tools/build_ESPeasy.sh @@ -75,46 +75,13 @@ platformio run --target clean cd ${SRC}/patches; ./check_puya_patch; cd ${SRC} -# Build all targets in the platformio.ini file. (same as in .travis.yml and before_deploy) -for ENV in \ - custom_ESP32_4M316k\ - custom_ESP8266_4M1M\ - custom_ESP8266_4M2M\ - dev_ESP8266_4M1M\ - hard_SONOFF_POW_4M1M\ - hard_Shelly_1_2M256\ - hard_Ventus_W266\ - hard_other_POW_ESP8285_1M\ - minimal_IRext_ESP8266_1M\ - minimal_IRext_ESP8266_4M1M\ - minimal_IRext_ESP8266_4M2M\ - minimal_core_242_ESP8266_1M_OTA\ - minimal_core_242_ESP8285_1M_OTA\ - minimal_core_261_ESP8266_1M_OTA\ - minimal_core_261_ESP8285_1M_OTA\ - normal_ESP8266_16M\ - normal_ESP8266_1M\ - normal_ESP8266_1M_VCC\ - normal_ESP8266_4M1M\ - normal_ESP8285_1M\ - normal_IRext_no_rx_ESP8266_4M2M\ - normal_WROOM02_2M256\ - normal_WROOM02_2M\ - test_ESP8266_4M_VCC\ - test_beta_ESP8266_16M\ - test_beta_ESP8266_4M1M\ - test_ESP32_4M316k\ - test_ESP32-wrover-kit_4M316k;\ -do +# Must look into all possible env definitions. +# Exclude so called "spec_" (special) builds +for ENV in `grep "^\[env:" platformio*.ini |cut -d'[' -f2|cut -d']' -f1|cut -d':' -f2|sort -n|grep -v spec_`; +do PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e ${ENV} done - -#for ENV in `grep "^\[env:" platformio.ini |cut -d':' -f2|cut -d']' -f1`; -#do -# platformio run -e ${ENV} -#done - # Rename all built files, compute CRC and insert binaryFilename # Collect all in a zip file. if [ -z "$DESCRIPTION" ] diff --git a/tools/vagrant/bootstrap.sh b/tools/vagrant/bootstrap.sh index be4c30eaba..d0fb3059e5 100644 --- a/tools/vagrant/bootstrap.sh +++ b/tools/vagrant/bootstrap.sh @@ -11,6 +11,7 @@ DESCRIPTION="" VAGRANT_FOLDER="/vagrant" BUILD_FOLDER=`echo "${VAGRANT_FOLDER}/build"` CUSTOM_H_FILE="Custom.h" +ENV_LIST_FILE="pio_envlist.txt" while getopts p:d: option do @@ -53,15 +54,26 @@ cd ${SRC}/patches; ./check_puya_patch; cd ${SRC} VAGRANT_CUSTOM_H_FILE=`echo "${VAGRANT_FOLDER}/${CUSTOM_H_FILE}"` +VAGRANT_PIO_ENVLIST_FILE=`echo "${VAGRANT_FOLDER}/${ENV_LIST_FILE}"` SRC_CUSTOM_H_FILE=`echo "${SRC}/src/${CUSTOM_H_FILE}"` +SRC_PIO_ENVLIST_FILE=`echo "${SRC}/src/${ENV_LIST_FILE}"` if [ -f ${VAGRANT_CUSTOM_H_FILE} ]; then # replace Windows line endings with Unix line endings sed 's/\r$//g' ${VAGRANT_CUSTOM_H_FILE} > ${SRC_CUSTOM_H_FILE} echo "Copy ${VAGRANT_CUSTOM_H_FILE} > ${SRC_CUSTOM_H_FILE}" fi - -# Build custom_ESP8266_4M target in the platformio.ini file -PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e ${PIO_BUILDENV} +if [ -f ${VAGRANT_PIO_ENVLIST_FILE} ]; then + # replace Windows line endings with Unix line endings + sed 's/\r$//g' ${VAGRANT_PIO_ENVLIST_FILE} > ${SRC_PIO_ENVLIST_FILE} + input=`echo "${SRC_PIO_ENVLIST_FILE}"` + while IFS= read -r line + do + PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e $line + done < "$input" +else + # Build custom_ESP8266_4M target in the platformio.ini file + PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e ${PIO_BUILDENV} +fi # rename and check file DATE=`date +%Y%m%d` From a1ede2f6241a93b4c7b2937344e9938a903ad8ed Mon Sep 17 00:00:00 2001 From: Gijs Noorlander Date: Thu, 21 Nov 2019 13:36:42 +0100 Subject: [PATCH 13/15] [New UI] Add /buildinfo JSON to give list of included plugins/controllers For the new UI, we need to fetch some JSON representing the included plugins, controllers and notifications. --- src/Controller.ino | 4 +- src/Misc.ino | 26 ---- src/StringConverter.ino | 4 +- src/StringProvider.ino | 4 +- src/StringProviderTypes.h | 2 +- src/WebServer.ino | 101 +++++++++----- src/WebServer_ControllerPage.ino | 10 +- src/WebServer_JSON.ino | 63 ++++++++- src/WebServer_TimingStats.ino | 9 +- src/__CPlugin.ino | 83 +++++++---- src/__NPlugin.ino | 45 ++++-- src/__Plugin.ino | 227 +++++++++++++++++-------------- 12 files changed, 352 insertions(+), 226 deletions(-) diff --git a/src/Controller.ino b/src/Controller.ino index 62bdeb3256..aec3ca6f32 100644 --- a/src/Controller.ino +++ b/src/Controller.ino @@ -63,9 +63,7 @@ void sendData(struct EventStruct *event) else { if (loglevelActiveFor(LOG_LEVEL_DEBUG)) { String log = F("Invalid value detected for controller "); - String controllerName; - CPluginCall(event->ProtocolIndex, CPLUGIN_GET_DEVICENAME, event, controllerName); - log += controllerName; + log += getCPluginNameFromProtocolIndex(event->ProtocolIndex); addLog(LOG_LEVEL_DEBUG, log); } } diff --git a/src/Misc.ino b/src/Misc.ino index 5afe57b567..74f72d0147 100644 --- a/src/Misc.ino +++ b/src/Misc.ino @@ -883,32 +883,6 @@ String checkTaskSettings(taskIndex_t taskIndex) { } -/********************************************************************************************\ - Find protocol index corresponding to protocol setting - \*********************************************************************************************/ -byte getProtocolIndex(byte Number) -{ - for (byte x = 0; x <= protocolCount; x++) { - if (Protocol[x].Number == Number) { - return x; - } - } - return 0; -} - -/********************************************************************************************\ - Get notificatoin protocol index (plugin index), by NPlugin_id - \*********************************************************************************************/ -byte getNotificationProtocolIndex(byte Number) -{ - for (byte x = 0; x <= notificationCount ; x++) { - if (Notification[x].Number == Number) { - return(x); - } - } - return(NPLUGIN_NOT_FOUND); -} - /********************************************************************************************\ Find positional parameter in a char string \*********************************************************************************************/ diff --git a/src/StringConverter.ino b/src/StringConverter.ino index 80530a3670..563abfa291 100644 --- a/src/StringConverter.ino +++ b/src/StringConverter.ino @@ -375,12 +375,12 @@ bool safe_strncpy(char *dest, const char *source, size_t max_size) { } // Convert a string to lower case and replace spaces with underscores. -String to_internal_string(const String& input) { +String to_internal_string(const String& input, char replaceSpace) { String result = input; result.trim(); result.toLowerCase(); - result.replace(' ', '_'); + result.replace(' ', replaceSpace); return result; } diff --git a/src/StringProvider.ino b/src/StringProvider.ino index 9ac1046f93..9ca92af795 100644 --- a/src/StringProvider.ino +++ b/src/StringProvider.ino @@ -1,7 +1,7 @@ #include "StringProviderTypes.h" -String getInternalLabel(LabelType::Enum label) { - return to_internal_string(getLabel(label)); +String getInternalLabel(LabelType::Enum label, char replaceSpace) { + return to_internal_string(getLabel(label), replaceSpace); } String getLabel(LabelType::Enum label) { diff --git a/src/StringProviderTypes.h b/src/StringProviderTypes.h index c5873fe352..df63d70898 100644 --- a/src/StringProviderTypes.h +++ b/src/StringProviderTypes.h @@ -100,7 +100,7 @@ enum Enum : short { }; -String getInternalLabel(LabelType::Enum label); +String getInternalLabel(LabelType::Enum label, char replaceSpace = '_'); String getLabel(LabelType::Enum label); String getValue(LabelType::Enum label); String getExtendedValue(LabelType::Enum label); diff --git a/src/WebServer.ino b/src/WebServer.ino index c850ddee4f..d72328456c 100644 --- a/src/WebServer.ino +++ b/src/WebServer.ino @@ -319,10 +319,11 @@ void sendHeadandTail(const String& tmplName, boolean Tail = false, boolean reboo // Therefore use a local static variable. #ifdef USES_TIMING_STATS static unsigned statisticsTimerStart = 0; + if (!Tail) { statisticsTimerStart = micros(); } - #endif + #endif // ifdef USES_TIMING_STATS String pageTemplate = ""; String fileName = tmplName; @@ -417,7 +418,7 @@ void sendHeadandTail_stdtemplate(boolean Tail = false, boolean rebooting = false #define HTML_SYMBOL_I_O "⇔" -# define TASKS_PER_PAGE TASKS_MAX +#define TASKS_PER_PAGE TASKS_MAX #define strncpy_webserver_arg(D, N) safe_strncpy(D, WebServer.arg(N).c_str(), sizeof(D)); #define update_whenset_FormItemInt(K, V) { int tmpVal; \ @@ -521,6 +522,7 @@ void WebServerInit() #endif #ifdef WEBSERVER_NEW_UI + WebServer.on(F("/buildinfo"), handle_buildinfo); // Also part of WEBSERVER_NEW_UI WebServer.on(F("/factoryreset_json"), handle_factoryreset_json); WebServer.on(F("/filelist_json"), handle_filelist_json); WebServer.on(F("/i2cscanner_json"), handle_i2cscanner_json); @@ -536,19 +538,20 @@ void WebServerInit() #if defined(ESP8266) { - #ifndef NO_HTTP_UPDATER + # ifndef NO_HTTP_UPDATER uint32_t maxSketchSize; bool use2step; + if (OTA_possible(maxSketchSize, use2step)) { httpUpdater.setup(&WebServer); } - #endif + # endif // ifndef NO_HTTP_UPDATER } #endif // if defined(ESP8266) #if defined(ESP8266) - #ifdef USES_SSDP + # ifdef USES_SSDP if (Settings.UseSSDP) { @@ -559,8 +562,8 @@ void WebServerInit() }); SSDP_begin(); } - #endif // USES_SSDP - #endif // if defined(ESP8266) + # endif // USES_SSDP + #endif // if defined(ESP8266) } void setWebserverRunning(bool state) { @@ -871,6 +874,12 @@ void writeDefaultCSS(void) } } +// ******************************************************************************** +// Functions to stream JSON directly to TXBuffer +// FIXME TD-er: replace stream_xxx_json_object* into this code. +// N.B. handling of numerical values differs (string vs. no string) +// ******************************************************************************** + int8_t level = 0; int8_t lastLevel = -1; @@ -893,7 +902,7 @@ void json_quote_val(const String& val) { void json_open(bool arr = false, const String& name = String()) { json_quote_name(name); - TXBuffer += arr ? "[" : "{"; + TXBuffer += arr ? '[' : '{'; lastLevel = level; level++; } @@ -904,7 +913,7 @@ void json_init() { } void json_close(bool arr = false) { - TXBuffer += arr ? "]" : "}"; + TXBuffer += arr ? ']' : '}'; level--; lastLevel = level; } @@ -921,6 +930,10 @@ void json_prop(const String& name, const String& value) { lastLevel = level; } +void json_prop(LabelType::Enum label) { + json_prop(getInternalLabel(label, '-'), getValue(label)); +} + // ******************************************************************************** // Add a task select dropdown list // ******************************************************************************** @@ -936,6 +949,7 @@ void addTaskSelect(const String& name, taskIndex_t choice) { deviceName = ""; const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(x); + if (validDeviceIndex(DeviceIndex)) { if (validPluginID(DeviceIndex_to_Plugin_id[DeviceIndex])) { @@ -969,15 +983,17 @@ void addTaskSelect(const String& name, taskIndex_t choice) // ******************************************************************************** void addTaskValueSelect(const String& name, int choice, taskIndex_t TaskIndex) { - if (!validTaskIndex(TaskIndex)) return; + if (!validTaskIndex(TaskIndex)) { return; } const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(TaskIndex); - if (!validDeviceIndex(DeviceIndex)) return; + + if (!validDeviceIndex(DeviceIndex)) { return; } TXBuffer += F("