From 1ff708eefae1d21a627205d835366b1d7915da75 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Fri, 20 Dec 2024 13:08:30 +0200 Subject: [PATCH] Update the example platformio.ini file --- examples/platformio.ini | 245 ++++++++++++++++++++++++++++++++-------- 1 file changed, 197 insertions(+), 48 deletions(-) diff --git a/examples/platformio.ini b/examples/platformio.ini index 386bc72a8..93ce242b0 100644 --- a/examples/platformio.ini +++ b/examples/platformio.ini @@ -1,64 +1,213 @@ ; PlatformIO Project Configuration File ; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -; NOTE: This is an example platformio.ini file to be used as a template for -; derived projects. Do not use the file within the SensESP directory tree but -; instead create a new project in PlatformIO and copy this file and one of the -; example source files there. - [platformio] -;set default_envs to whichever board(s) you use. Build/Run/etc processes those envs -default_envs = - esp32dev + +; Change the default environment to match your board. Valid options are: +; - arduino_esp32 +; - pioarduino_esp32 +; - espidf_esp32 +; - pioarduino_esp32c3 +; - espidf_esp32c3 +; - shesp32 +; - halmet +; - halser + +default_envs = pioarduino_esp32c3 [env] -; Global data for all [env:***] -framework = arduino -lib_ldf_mode = deep + +; Options common for all working environments + +;; Uncomment and change these if PlatformIO can't auto-detect the ports +;monitor_port = /dev/tty.usbserial-310 +;upload_port = /dev/tty.usbserial-310 +upload_speed = 2000000 monitor_speed = 115200 + lib_deps = -; Comment out one of the following two paths that point to the -; SensESP library code. - -; This one is the "Release" version - the branch called "latest". - SignalK/SensESP - -; This one has all merged PR's, but is not yet an official "release" version. -; It is the branch called "master". This version is unstable and under continuous -; development and will break without warning. Use it only if you want to -; participate in SensESP development or need to test some yet unreleased feature. -; https://github.com/SignalK/SensESP - -;this section has config items common to all ESP32 boards -[espressif32_base] -platform = espressif32 -build_unflags = -Werror = reorder + ; Peg the SensESP version to 3.1.0 and compatible versions + SignalK/SensESP @ ^3.1.0 + ; To use the development version, use this line instead: + ; https://github.com/SignalK/SensESP.git#main + ; To use a local copy (for development purposes), use this line: + ; symlink:///Users/yourname/path/to/SensESP + ; Add any additional dependencies here + ;ttlappalainen/NMEA2000-library + ;NMEA2000_twai=https://github.com/skarlsson/NMEA2000_twai + +build_flags = + ; Max (and default) debugging level in Arduino ESP32 Core + -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE + ; Use the ESP-IDF logging library - required by SensESP. + -D USE_ESP_IDF_LOG + +; This line defines the partition table to use. "min_spiffs" has two app +; partitions, one for OTA updates and one for the running app, but the +; SPIFFS filesystem is quite small. For 8 MB flash boards such as HALMET, +; you can use "default_8MB.csv" instead. + board_build.partitions = min_spiffs.csv + +;; Uncomment the following lines to use Over-the-air (OTA) Updates +;upload_protocol = espota +;upload_port = IP_ADDRESS_OF_ESP_HERE +;upload_flags = +; --auth=YOUR_OTA_PASSWORD + +; You shouldn't need to touch the settings in this section below this line. + +build_unflags = + -Werror=reorder monitor_filters = esp32_exception_decoder -[env:esp32dev] -extends = espressif32_base +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Platform configurations follow + +[arduino] + +platform = espressif32 @ ^6.9.0 +framework = arduino + +lib_ignore = + esp_websocket_client + +build_flags = + ${env.build_flags} + ; Arduino Core bug workaround: define the log tag for the Arduino + ; logging macros. + -D TAG='"Arduino"' + +[pioarduino] + +platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip +framework = arduino + +; The library.json format doesn't support dependencies conditional on the +; platform version, so we have to use the lib_deps option to specify the +; esp_websocket_client library only for the ESP-IDF framework. + +lib_deps = + ${env.lib_deps} + esp_websocket_client=https://components.espressif.com/api/downloads/?object_type=component&object_id=dbc87006-9a4b-45e6-a6ab-b286174cb413 + +build_flags = + ${env.build_flags} + +[espidf] + +platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip +framework = espidf, arduino + +board_build.embed_txtfiles = + managed_components/espressif__esp_insights/server_certs/https_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt + +; The library.json format doesn't support dependencies conditional on the +; platform version, so we have to use the lib_deps option to specify the +; esp_websocket_client library only for the ESP-IDF framework. + +lib_deps = + ${env.lib_deps} + esp_websocket_client=https://components.espressif.com/api/downloads/?object_type=component&object_id=dbc87006-9a4b-45e6-a6ab-b286174cb413 + +build_flags = + ${env.build_flags} + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Board configurations follow + +[esp32] + board = esp32dev +build_flags = + ${env.build_flags} + -D BUTTON_BUILTIN=0 + -D LED_BUILTIN=2 + +[esp32c3] + +board = esp32-c3-devkitm-1 +build_flags = + ${env.build_flags} + -D SENSESP_BUTTON_PIN=9 + -D PIN_RGB_LED=8 + ; Use the CDC USB port as Serial + -DARDUINO_USB_MODE=1 + -DARDUINO_USB_CDC_ON_BOOT=1 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Permutations of platform and device. + +[env:arduino_esp32] + +extends = arduino, esp32 +build_flags = + ${arduino.build_flags} + ${esp32.build_flags} + +[env:pioarduino_esp32] + +extends = pioarduino, esp32 +build_flags = + ${pioarduino.build_flags} + ${esp32.build_flags} + +[env:espidf_esp32] + +extends = espidf, esp32 +build_flags = + ${espidf.build_flags} + ${esp32.build_flags} + +[env:arduino_esp32c3] + +extends = arduino, esp32c3 +build_flags = + ${arduino.build_flags} + ${esp32c3.build_flags} + +[env:pioarduino_esp32c3] + +extends = pioarduino, esp32c3 +build_flags = + ${pioarduino.build_flags} + ${esp32c3.build_flags} + +[env:espidf_esp32c3] + +extends = espidf, esp32c3 +build_flags = + ${espidf.build_flags} + ${esp32c3.build_flags} + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Individual board configurations + +[env:shesp32] + +extends = pioarduino, esp32 +build_flags = + ${pioarduino.build_flags} + ${esp32.build_flags} + +[env:halmet] + +extends = pioarduino, esp32 +board_build.partitions = default_8MB.csv + +build_flags = + ${pioarduino.build_flags} + ${esp32.build_flags} + +[env:halser] + +extends = pioarduino, esp32c3 build_flags = - ; Verify that this is the correct pin number for your board! - -D LED_BUILTIN = 2 - ; Max (and default) debugging level in Arduino ESP32 Core - -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE - ; Arduino Core bug workaround: define the log tag for the Arduino - ; logging macros. - -D TAG='"Arduino"' - ; Use the ESP-IDF logging library - required by SensESP. - -D USE_ESP_IDF_LOG - -; uncomment and change these if PlatformIO can't auto-detect -; the ports -;upload_port = /dev/tty.SLAB_USBtoUART -;monitor_port = /dev/tty.SLAB_USBtoUART + ${pioarduino.build_flags} + ${esp32c3.build_flags}