mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
276 lines
10 KiB
INI
276 lines
10 KiB
INI
; PlatformIO Project Configuration File for EMS-ESP
|
|
;
|
|
; override any settings with your own local ones in pio_local.ini (see example pio_local.ini_example)
|
|
; The firmware is renamed following this convention, and placed in the build/firmware folder:
|
|
; EMS-ESP32-<version>-<chip_type>-<flash_mem>[+ if PSRAM onboard].bin
|
|
; For example: EMS-ESP-3_7_0-dev_31-esp32-16MB+.bin
|
|
;
|
|
; boards can be found in https://github.com/pioarduino/platform-espressif32/tree/main/boards
|
|
|
|
[platformio]
|
|
; build all supported targets. Use pio_local.ini to override and build specific targets.
|
|
default_envs = s_4M, s_16M, s_16M_P, s3_16M_P
|
|
|
|
description = EMS-ESP Firmware for the ESP32
|
|
src_dir = src
|
|
lib_dir = lib
|
|
boards_dir = boards
|
|
; build_cache_dir = .pio/build_cache
|
|
|
|
extra_configs =
|
|
factory_settings.ini
|
|
pio_local.ini
|
|
|
|
[common]
|
|
core_build_flags = -std=gnu++17 -O3 -Wno-type-limits -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-format
|
|
core_unbuild_flags = -std=gnu++11 -std=gnu++14
|
|
|
|
my_build_flags =
|
|
|
|
build_flags =
|
|
${common.core_build_flags}
|
|
${factory_settings.build_flags}
|
|
${common.my_build_flags}
|
|
-I./src/core
|
|
-D ARDUINO_ARCH_ESP32
|
|
-D ONEWIRE_CRC16=0
|
|
-D CONFIG_UART_ISR_IN_IRAM
|
|
; AsyncTCP
|
|
-D CONFIG_ASYNC_TCP_MAX_ACK_TIME=5000 ; default
|
|
-D CONFIG_ASYNC_TCP_PRIORITY=10 ; default
|
|
-D CONFIG_ASYNC_TCP_QUEUE_SIZE=64 ; default
|
|
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1 ; force async_tcp task to be on same core as Arduino app (default is any core)
|
|
-D CONFIG_ASYNC_TCP_STACK_SIZE=6144 ; stack usage measured: ESP32: ~2.3K, ESP32S3: ~3.5k - (default is 16K)
|
|
; ESPAsyncWebServer
|
|
-D WS_MAX_QUEUED_MESSAGES=0 ; log messages are already queued in ems-esp
|
|
-D CORE_DEBUG_LEVEL=0
|
|
|
|
unbuild_flags =
|
|
${common.core_unbuild_flags}
|
|
|
|
; 16MB Flash variants
|
|
[espressif32_base_16M]
|
|
framework = arduino
|
|
board_build.partitions = partitions/esp32_partition_16M.csv
|
|
board_upload.flash_size = 16MB
|
|
platform = espressif32@6.9.0 ; Arduino Core 2.0.18 / IDF 4.4.8
|
|
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip ; Arduino Core 3.1.1 / IDF 5.3.2
|
|
;
|
|
; Experimental for building using espidf and the Hybrid mode to remove core libraries.
|
|
;
|
|
; custom_sdkconfig = https://raw.githubusercontent.com/pioarduino/sdkconfig/refs/heads/main/sdkconfig_tasmota_esp32
|
|
; '# CONFIG_ETH_USE_ESP32_EMAC is not set'
|
|
; '# CONFIG_ETH_PHY_INTERFACE_RMII is not set'
|
|
; '# CONFIG_ETH_RMII_CLK_INPUT is not set'
|
|
; '# CONFIG_ETH_RMII_CLK_IN_GPIO is not set'
|
|
; custom_component_remove = espressif/esp_hosted
|
|
; espressif/esp_wifi_remote
|
|
; espressif/esp-dsp
|
|
; espressif/network_provisioning
|
|
; espressif/esp-zboss-lib
|
|
; espressif/esp-zigbee-lib
|
|
; espressif/esp_rainmaker
|
|
; espressif/rmaker_common
|
|
; espressif/esp_insights
|
|
; espressif/esp_diag_data_store
|
|
; espressif/esp_diagnostics
|
|
; espressif/cbor
|
|
; espressif/qrcode
|
|
; espressif/esp-sr
|
|
; espressif/libsodium
|
|
; espressif/esp-modbus
|
|
; chmorgan/esp-libhelix-mp3
|
|
; espressif/esp32-camera
|
|
|
|
; 32MB Flash variants
|
|
[espressif32_base_32M]
|
|
framework = arduino
|
|
board_build.partitions = partitions/esp32_partition_32M.csv
|
|
board_upload.flash_size = 32MB
|
|
platform = espressif32@6.9.0 ; Arduino Core 2.0.18 / IDF 4.4.8
|
|
|
|
; use Tasmota's library for 4MB Flash variants.
|
|
; Removes libs (like mbedtsl, so no WiFi_secure.h) to increase available heap
|
|
[espressif32_base_T_4M]
|
|
framework = arduino
|
|
board_build.partitions = partitions/esp32_partition_4M.csv
|
|
board_upload.flash_size = 4MB
|
|
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.00/platform-espressif32.zip ; Arduino Core 2.0.18 with IPv6 support, based on IDF 4.4.8
|
|
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.12.30/platform-espressif32.zip ; Arduino Core 3.1.0.241206 based on IDF 5.3.2
|
|
|
|
; use Tasmota's library for 16MB Flash variants.
|
|
; Removes libs (like mbedtsl, so no WiFi_secure.h) to increase available heap
|
|
[espressif32_base_T_16M]
|
|
framework = arduino
|
|
board_build.partitions = partitions/esp32_partition_16M.csv
|
|
board_upload.flash_size = 16MB
|
|
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.00/platform-espressif32.zip ; Arduino Core 2.0.18 with IPv6 support, based on IDF 4.4.8
|
|
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.12.30/platform-espressif32.zip ; Arduino Core 3.1.0.241206 based on IDF 5.3.2
|
|
|
|
[env]
|
|
build_flags =
|
|
${common.build_flags}
|
|
build_unflags =
|
|
${common.unbuild_flags}
|
|
extra_scripts =
|
|
pre:scripts/build_interface.py ; builds the WebUI (unless NO_BUILD_WEBUI is set)
|
|
scripts/rename_fw.py ; renames the firmware .bin file
|
|
scripts/upload.py ; optionally upload the firmware via OTA (if upload_protocol = custom)
|
|
monitor_speed = 115200
|
|
monitor_filters = direct
|
|
build_type = release
|
|
board_build.filesystem = littlefs
|
|
lib_deps =
|
|
bblanchon/ArduinoJson @ 7.3.0
|
|
mathieucarbou/AsyncTCP @ 3.3.2
|
|
mathieucarbou/ESPAsyncWebServer @ 3.6.0
|
|
https://github.com/emsesp/EMS-ESP-Modules.git @ 1.0.4
|
|
|
|
;
|
|
; Builds for different board types
|
|
; If the environment variable (windows or linux) "NO_BUILD_WEBUI" is set, the WebUI will not be built.
|
|
; If you're building for a single target, create a pio_local.ini file (look at example)
|
|
;
|
|
|
|
[env:s_4M]
|
|
; 4MB ESP32 - using Tasmota - no SSL, no PSRAM - like a BBQKees older S32 and E32 models
|
|
extends = espressif32_base_T_4M
|
|
board = s_4M
|
|
|
|
[env:s_16M]
|
|
; 16MB ESP32 - using Tasmota - no SSL, no PSRAM - like a BBQKees later S32 models
|
|
extends = espressif32_base_T_16M
|
|
board = s_16M
|
|
|
|
[env:s_16M_P]
|
|
; 16MB ESP32 - with PSRAM - like a BBQKees E32V2
|
|
extends = espressif32_base_16M
|
|
board = s_16M_P
|
|
|
|
[env:s3_16M_P]
|
|
; 16MB ESP32-S3 - with PSRAM - like a BBQKees S3
|
|
extends = espressif32_base_16M
|
|
board = s3_16M_P
|
|
|
|
[env:s3_32M_P]
|
|
; 16MB ESP32-S3 - with PSRAM and 32MB flash
|
|
extends = espressif32_base_32M
|
|
board = s3_32M_P
|
|
|
|
[env:s2_4M_P]
|
|
; based on lolin_s2_mini with 2MB PSRAM
|
|
extends = espressif32_base_T_4M
|
|
board = s2_4M_P
|
|
|
|
[env:c3_mini_4M]
|
|
; based on lolin_c3_mini, no PSRAM
|
|
extends = espressif32_base_T_4M
|
|
board = c3_mini_4M
|
|
|
|
; lolin C3 mini v1 needs special wifi initialization
|
|
; https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
|
[env:c3_miniv1_4M]
|
|
extends = espressif32_base_T_4M
|
|
board = c3_mini_4M
|
|
build_flags =
|
|
${common.build_flags}
|
|
-DTASMOTA_SDK
|
|
-DBOARD_C3_MINI_V1
|
|
-DARDUINO_USB_MODE=1
|
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
|
|
|
;
|
|
; Building and testing natively, standalone without an ESP32.
|
|
; See https://docs.platformio.org/en/latest/platforms/native.html
|
|
;
|
|
; It will generate an executable which when run will show the EMS-ESP Console where you can run tests using the `test` command.
|
|
;
|
|
; See https://docs.platformio.org/en/latest/core/installation/shell-commands.html#piocore-install-shell-commands
|
|
;
|
|
; to build and run directly on linux: pio run -e native -t exec
|
|
;
|
|
; to build and run on Windows, it needs winsock for the console input so:
|
|
; - For the first time, install Msys2 (https://www.msys2.org/) and the GCC compiler with `run pacman -S mingw-w64-ucrt-x86_64-gcc`
|
|
; - Then, build with `pio run -e native` to create the program.exe file
|
|
; - run by calling the executable from the Mysys shell e.g. `C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64 -c <location>/.pio/build/native/program.exe`
|
|
; - or use with Windows Terminal https://www.msys2.org/docs/terminals/
|
|
;
|
|
[env:native]
|
|
platform = native
|
|
build_flags =
|
|
-DARDUINOJSON_ENABLE_ARDUINO_STRING=1
|
|
-DEMSESP_STANDALONE -DEMSESP_TEST
|
|
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.2-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
|
-std=gnu++17 -Og -ggdb
|
|
build_unflags = -std=gnu++11 -std=gnu++14
|
|
build_type = debug
|
|
build_src_flags =
|
|
-Wall -Wextra
|
|
-Wno-unused-parameter -Wno-sign-compare -Wno-missing-braces
|
|
-I./src/core
|
|
-I./lib_standalone
|
|
-I./lib/uuid-common/src
|
|
-I./lib/uuid-console/src
|
|
-I./lib/uuid-log/src
|
|
-I./lib/semver
|
|
-I./lib/PButton
|
|
-I./lib/espMqttClient/src
|
|
-I./lib/espMqttClient/src/Transport
|
|
build_src_filter =
|
|
+<../src>
|
|
+<../lib>
|
|
+<../lib_standalone>
|
|
-<../src/ESP32React>
|
|
-<../lib/uuid-telnet>
|
|
-<../lib/uuid-syslog>
|
|
-<../lib/eModbus>
|
|
-<../lib/OneWire>
|
|
lib_ldf_mode = off
|
|
lib_deps =
|
|
|
|
; unit tests
|
|
; The code is in ./test/test_api.*
|
|
; to run use `pio run -e native-test -t exec`. All tests should PASS.
|
|
; to update the test results, compile with -DEMSESP_UNITY_CREATE by uncommenting the line below
|
|
; then run and capture the output between "START - CUT HERE" and "END - CUT HERE" into the test_api.h file
|
|
[env:native-test]
|
|
platform = native
|
|
test_build_src = true
|
|
build_flags =
|
|
-DARDUINOJSON_ENABLE_ARDUINO_STRING=1
|
|
-DEMSESP_STANDALONE -DEMSESP_TEST
|
|
-DEMSESP_UNITY
|
|
; -DEMSESP_UNITY_CREATE
|
|
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.2-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
|
-std=gnu++17 -Og -ggdb
|
|
-lgcov --coverage -fprofile-arcs -ftest-coverage
|
|
build_type = debug
|
|
build_src_flags =
|
|
-Wall -Wextra
|
|
-Wno-unused-parameter -Wno-sign-compare -Wno-missing-braces
|
|
-I./src/core
|
|
-I./lib_standalone
|
|
-I./lib/uuid-common/src
|
|
-I./lib/uuid-console/src
|
|
-I./lib/uuid-log/src
|
|
-I./lib/semver
|
|
-I./lib/PButton
|
|
-I./lib/espMqttClient/src
|
|
-I./lib/espMqttClient/src/Transport
|
|
-I./test/api
|
|
-I./test
|
|
build_src_filter =
|
|
+<../src>
|
|
+<../test>
|
|
+<../lib>
|
|
+<../lib_standalone>
|
|
-<../src/ESP32React>
|
|
-<../lib/uuid-telnet>
|
|
-<../lib/uuid-syslog>
|
|
-<../lib/eModbus>
|
|
-<../lib/OneWire>
|
|
lib_ldf_mode = off
|
|
lib_deps = Unity
|
|
test_testing_command =
|
|
${platformio.build_dir}/${this.__env__}/program
|