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/.travis.yml b/.travis.yml index 81c4fbba37..dcd5904483 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,31 +33,39 @@ 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 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 custom_ESP8266_4M2M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_beta_ESP8266_4M1M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e custom_sdk3_ESP8266_4M1M + - 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 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 minimal_core_261_sdk3_ESP8266_1M_OTA + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_261_sdk3_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_2M + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_WROOM02_2M256 + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_ESP32-wrover-kit_4M316k + - PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e test_ESP32_4M316k - 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 diff --git a/before_deploy b/before_deploy index 7a99597dac..4e5636406c 100755 --- a/before_deploy +++ b/before_deploy @@ -39,39 +39,10 @@ fi mkdir -p ${TMP_DIST}/memstats -for ENV in \ - custom_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\ - minimal_IRext_ESP8266_1M\ - minimal_IRext_ESP8266_4M1M\ - minimal_IRext_ESP8266_4M2M\ - 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\ - test_ESP8266_4M_VCC\ - dev_ESP8266_4M1M\ - hard_SONOFF_POW_4M1M\ - hard_other_POW_ESP8285_1M\ - hard_Shelly_1_2M256\ - hard_Ventus_W266;\ -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 @@ -81,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/dist/README.txt b/dist/README.txt index bfa6678e97..3b0cfebdc9 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 @@ -56,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/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.ini b/platformio.ini index a3f5e5ed15..2f7464dc9c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,31 +11,30 @@ ; *********************************************************************; [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. +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 +;default_envs = test_beta_ESP8266_4M1M ; ..etc +;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 ; -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-promo -Wstrict-null-sentinel ; -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 = @@ -57,155 +56,7 @@ 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_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 - -[core_esp32_1_10_0] -platform = espressif32@1.10.0 - -[core_esp32_stage] -platform = https://github.com/platformio/platform-espressif32.git#feature/stage - -[core_esp32] -platform = ${core_esp32_1_10_0.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 = @@ -213,905 +64,19 @@ build_flags = [mqtt_flags] build_flags = -DMQTT_MAX_PACKET_SIZE=1024 + [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_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR lib_ldf_mode = chain lib_archive = false -upload_speed = 115200 framework = arduino -board = esp12e +upload_speed = 115200 monitor_speed = 115200 ;targets = size, checkprogsize targets = - -[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] -build_unflags = -build_flags = ${core_2_5_2.build_flags} ${common.build_flags} -platform = ${core_2_5_2.platform} - -[beta_platform] -build_unflags = -build_flags = ${core_2_6_0.build_flags} ${common.build_flags} -platform = ${core_2_6_0.platform} - - - -[normal] -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} - - -[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_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 -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} -lib_ignore = ESP32_ping, ESP32WebServer - -[minimal_ir] -platform = ${ir.platform} -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IR -lib_ignore = ${ir.lib_ignore} - -[minimal_ir_extended] -platform = ${ir.platform} -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IRext -lib_ignore = ${ir.lib_ignore} - -[normal_ir] -platform = ${ir.platform} -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_NORMAL_IR -lib_ignore = ${ir.lib_ignore} - -[normal_ir_extended] -platform = ${ir.platform} -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED -lib_ignore = ${ir.lib_ignore} - -[normal_ir_extended_no_rx] -platform = ${ir.platform} -build_flags = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED_NO_RX -lib_ignore = ${ir.lib_ignore} - -[testing] -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 - -[dev] -platform = ${beta_platform.platform} -build_flags = ${beta_platform.build_flags} -DPLUGIN_BUILD_DEV - - - -[esp8266_1M] -board = esp01_1m -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 - -[esp8285_1M] -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] -board = esp12e -board_build.flash_mode = dio -board_build.f_cpu = ${common.board_build.f_cpu} -build_unflags = ${regular_platform.build_unflags} -build_flags = -Wl,-Tesp8266.flash.2m256.ld - -[espWroom2M] -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.2m.ld - -[espWroom2M256] -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] -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] -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 - - -; 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] -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] -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 -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 - -; Custom: 4M2M version -------------------------- -[env:custom_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 -lib_ignore = ESP32_ping, ESP32WebServer - -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} -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} -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] -platform = ${normal_252.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 -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} -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} -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 - - - - - -;;; NORMAL (STABLE) *************************************************** -; normal version with stable plugins ; -; ********************************************************************* - -; 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} - - - -[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 - -; 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} - - -[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} -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} - - - - -; NORMAL: 2048k WROOM02 version 256k SPIFFS -------------------------- -[env:normal_core_252_WROOM02_2M256] -platform = ${normal_252.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} - - - - - -; 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} - - -[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} -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 *********************************************************** -; 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} - - - -[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} - - - -[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} -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} - - - -[env:minimal_core_260_ESP8285_1M_OTA] -platform = ${normal_260_ota.platform} -board_upload.maximum_size = ${normal_260_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} - - - - - -;;; 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] -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] -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] -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] -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} - - -; - - - - - -; 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] -platform = ${testing_beta.platform} -build_flags = ${esp8266_4M1M.build_flags} ${testing_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: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] -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} - - - - -;[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} -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} - - - - - - -;;; DEV ************************************************************** -; 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} -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} - - - - - -;;; 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] -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} - - - - -;[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] -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} - - - -;[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} -;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] -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} - - - +extra_scripts = pre:pre_default_check.py +[env] +extends = common -; Ventus W266 weather station -; https://www.letscontrolit.com/wiki/index.php/VentusW266 -[env:hard_Ventus_W266] -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} diff --git a/platformio_core_defs.ini b/platformio_core_defs.ini new file mode 100644 index 0000000000..d1adf9b73c --- /dev/null +++ b/platformio_core_defs.ini @@ -0,0 +1,123 @@ +; ********************************************************************* + +; **** 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} + + +; 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} + -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_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} + -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..9b5359d48b --- /dev/null +++ b/platformio_esp82xx_base.ini @@ -0,0 +1,212 @@ +;;; 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} + +[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} +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..888c959288 --- /dev/null +++ b/platformio_esp82xx_envs.ini @@ -0,0 +1,352 @@ +;;; 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 = ${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 = ${beta_platform.build_flags} + ${esp8266_4M1M.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 = ${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 + + + + +;;; NORMAL (STABLE) *************************************************** +; normal version with stable plugins ; +; ********************************************************************* + +; NORMAL: 1024k version -------------------------- +[env:normal_ESP8266_1M] +extends = esp8266_1M +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} + ${esp8266_1M.build_flags} + + +[env:normal_ESP8266_1M_VCC] +extends = esp8266_1M +platform = ${regular_platform.platform} +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 = ${regular_platform.build_flags} + ${esp8285_1M.build_flags} + + +; NORMAL: 2048k WROOM02 version -------------------------- +[env:normal_WROOM02_2M] +extends = espWroom2M +platform = ${regular_platform.platform} +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 = ${regular_platform.build_flags} + ${espWroom2M256.build_flags} + + +; NORMAL: 4096k version -------------------------- +[env:normal_ESP8266_4M1M] +extends = esp8266_4M1M +platform = ${regular_platform.platform} +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 = ${regular_platform.build_flags} + ${esp8266_16M.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 = ${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 = ${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 = ${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 = ${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} + + + +;;; 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 = ${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 = ${testing_beta.build_flags} + ${esp8266_4M1M.build_flags} + + +[env:test_beta_ESP8266_16M] +extends = esp8266_16M +platform = ${testing_beta.platform} +build_flags = ${testing_beta.build_flags} + ${esp8266_16M.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 = ${dev.build_flags} + ${esp8266_4M1M.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..b0b9a6ab7a --- /dev/null +++ b/platformio_special_envs.ini @@ -0,0 +1,51 @@ +;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:spec_debug_custom_ESP8266_4M1M] +extends = esp8266_4M1M, debug_pio +platform = ${regular_platform.platform} +build_flags = ${regular_platform.build_flags} + ${debug_pio.build_flags} + ${esp8266_4M1M.build_flags} + -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + +[env:spec_debug_beta_custom_ESP8266_4M1M] +extends = esp8266_4M1M, debug_pio +platform = ${beta_platform.platform} +build_flags = ${beta_platform.build_flags} + ${debug_pio.build_flags} + ${esp8266_4M1M.build_flags} + -DPLUGIN_BUILD_CUSTOM +lib_ignore = ESP32_ping, ESP32WebServer +extra_scripts = pre:pre_custom_esp82xx.py + + +[env:spec_debug_custom_ESP32_4M316k] +extends = esp32_common, debug_pio +platform = ${esp32_common.platform} +build_flags = ${esp32_common.build_flags} ${debug_pio.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:spec_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 96% rename from pre_extra_script.py rename to pre_custom_esp82xx.py index 6a40f52644..74b70ab83f 100644 --- a/pre_extra_script.py +++ b/pre_custom_esp82xx.py @@ -13,7 +13,6 @@ # - frameworks # - dependent libraries env.Append(CPPDEFINES=[ - "PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y" # ,"NO_HTTP_UPDATER" # ,("WEBSERVER_RULES_DEBUG", "0") ]) 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/src/Controller.ino b/src/Controller.ino index 6872659895..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); } } @@ -419,3 +417,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/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 13d579f0e4..d72328456c 100644 --- a/src/WebServer.ino +++ b/src/WebServer.ino @@ -317,10 +317,13 @@ 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 // ifdef USES_TIMING_STATS String pageTemplate = ""; String fileName = tmplName; @@ -415,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; \ @@ -519,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); @@ -534,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) { @@ -557,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) { @@ -869,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; @@ -891,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++; } @@ -902,7 +913,7 @@ void json_init() { } void json_close(bool arr = false) { - TXBuffer += arr ? "]" : "}"; + TXBuffer += arr ? ']' : '}'; level--; lastLevel = level; } @@ -919,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 // ******************************************************************************** @@ -934,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])) { @@ -967,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("