; 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 [platformio] extra_configs = variants/*/platformio.ini platformio.local.ini ; Default BLE pairing PIN. This is a non-secret placeholder; override it with ; your real PIN in the git-ignored platformio.local.ini ([secrets] ble_pin=...) ; so the real value never lands in the committed tree. ; admin_pw: same idea for the mast envs in variants/tth_fleet (ADMIN_PASSWORD). ; PlatformIO resolves ${secrets.*} of EVERY env when it loads the config, so a ; checkout without platformio.local.ini (tth-upstream-sync CI) fails on the ; missing key even when it never builds a mast env. tth-fw-release writes the ; real values over it. [secrets] ble_pin = 123456 admin_pw = password ; Admin-pushed OTA (src/helpers/FwUpdate, docs/ota.md): the PUBLIC key ; every OTA package signature is checked against, raw Ed25519 hex. Default: the ; public OTA key meshcore-ota@tth-pub, the one the -ota release images are ; signed with (tools/ota_allowed_signers has it as an ssh key, for the release ; checksums). Only images built with -D FW_OTA=1 use it. A self-built image ; signed with your own key: [ota] pubkey = ; in platformio.local.ini. [ota] pubkey = 8777b6e1a8494113b70f41f5ed75bf3f2a8eba9635bab1dc3d20efd1a8398090 ; CUSTOM (TeTeHacko): channels the ChannelFilter deny list applies to ; (examples/simple_repeater/ChannelFilter.h). These keys are PUBLIC by ; construction, not secrets: hashtag channels derive key = SHA256(name)[:16] ; (anyone joins #meshcore by typing the name), and the Public channel key is ; the globally published izOH6cXN6mrJ5e26oRXNcg==. Derivation verified live ; 5. 9. 2026: SHA256("#meshcore")[:16] hashes to channel byte 0xEF, matching ; the on-air packets. Order: #meshcore, Public, #test. [channel_filter] build_flags = -D FILTER_CHANNEL_PSKS='"2fa78a5aef618e7c2a78f0ab5c8869b3,8b3387e9c5cdea6ac9e5edbaa115cd72,9cd8fcf22a47333b591d96a2b848b73f"' [arduino_base] framework = arduino monitor_speed = 115200 lib_deps = SPI Wire jgromes/RadioLib @ 7.8.1 rweather/Crypto @ ^0.4.0 adafruit/RTClib @ ^2.1.3 melopero/Melopero RV3028 @ ^1.1.0 electroniccats/CayenneLPP @ 1.6.1 build_flags = -w -DNDEBUG -DRADIOLIB_STATIC_ONLY=1 -DRADIOLIB_GODMODE=1 -D LORA_FREQ=869.618 -D LORA_BW=62.5 -D LORA_SF=8 -D ENABLE_ADVERT_ON_BOOT=1 -D ENABLE_PRIVATE_KEY_IMPORT=1 ; NOTE: comment these out for more secure firmware -D ENABLE_PRIVATE_KEY_EXPORT=1 -D RADIOLIB_EXCLUDE_CC1101=1 -D RADIOLIB_EXCLUDE_RF69=1 -D RADIOLIB_EXCLUDE_SX1231=1 -D RADIOLIB_EXCLUDE_SI443X=1 -D RADIOLIB_EXCLUDE_RFM2X=1 -D RADIOLIB_EXCLUDE_SX128X=1 -D RADIOLIB_EXCLUDE_AFSK=1 -D RADIOLIB_EXCLUDE_AX25=1 -D RADIOLIB_EXCLUDE_HELLSCHREIBER=1 -D RADIOLIB_EXCLUDE_MORSE=1 -D RADIOLIB_EXCLUDE_APRS=1 -D RADIOLIB_EXCLUDE_BELL=1 -D RADIOLIB_EXCLUDE_RTTY=1 -D RADIOLIB_EXCLUDE_SSTV=1 build_src_filter = +<*.cpp> + + + + ; ----------------- ESP32 --------------------- [esp32_base] extends = arduino_base platform = platformio/espressif32@6.11.0 monitor_filters = esp32_exception_decoder extra_scripts = merge-bin.py build_flags = ${arduino_base.build_flags} -D ESP32_PLATFORM ; -D ESP32_CPU_FREQ=80 ; change it to your need build_src_filter = ${arduino_base.build_src_filter} [esp32_ota] lib_deps = ESP32Async/ESPAsyncWebServer @ 3.10.3 file://arch/esp32/AsyncElegantOTA ; esp32c6 uses arduino framework 3.x ; WARNING: experimental. May not work as stable as other platforms. [esp32c6_base] extends = esp32_base platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13-1/platform-espressif32.zip ; ----------------- NRF52 --------------------- ; nRF52 Adafruit framework package. Committed DEFAULT is a fetchable git pin ; (works on CI and on any clone). d541301 is the tip of meshcore-dev's fork ; master and carries the BLE-stack patch against rapid connect/disconnect ; lockup (MeshCore PRs #1177, #1295). The full 40-char SHA is used on purpose: ; PlatformIO's shallow fetch choked on the SHORT SHA, which is the whole reason ; the local build used a full clone + symlink. That symlink hack now lives ONLY ; in the gitignored platformio.local.ini (it redefines [nrf52_fw].pkg), so it ; never leaks into the tracked tree and breaks CI again -- it did: a committed ; `symlink:///home/user/...` gave PackageException on every nRF52 runner build. [nrf52_fw] pkg = https://github.com/meshcore-dev/Adafruit_nRF52_Arduino#d541301665b40959682252911e57b11df3ee651a [nrf52_base] extends = arduino_base platform = nordicnrf52 platform_packages = framework-arduinoadafruitnrf52 @ ${nrf52_fw.pkg} platformio/toolchain-gccarmnoneeabi@^1.140201.0 ; Stamping verze pro KAŽDÝ nRF52 env, ne po jednom: 19. 8. 2026 se ukázalo, že ; z 585 envů v repu stampovaly DVA, takže `ver` na lavičních deskách hlásil ; literál z upstream headeru a z uzlu nešlo poznat, který build na něm je. ; U flashované desky je to podmínka, ne komfort (AGENTS.md). extra_scripts = create-uf2.py pre:tools/build_version.py ; FwPatch.cpp (delta OTA applier) runs from RAM, see the script's header. pre:tools/ota_ramlib.py build_flags = ${arduino_base.build_flags} -D NRF52_PLATFORM -D LFS_NO_ASSERT=1 -D EXTRAFS=1 -D FW_OTA_PUBKEY='"${ota.pubkey}"' -D USE_CC310_HW_CRYPTO=1 lib_deps = ${arduino_base.lib_deps} https://github.com/oltaco/CustomLFS#0.2.3 ; ----------------- RP2040 --------------------- [rp2040_base] extends = arduino_base upload_protocol = picotool board_build.core = earlephilhower ; commit points to framework-arduinopico 5.6.0 platform = https://github.com/maxgerhardt/platform-raspberrypi.git#4e22a0dcdd94eead72fdf56ea59a3d7c8aa2f379 build_flags = ${arduino_base.build_flags} -D RP2040_PLATFORM ; ----------------- STM32 ---------------------- [stm32_base] extends = arduino_base ; Pinned pending upstream fix for upstream conversions. ; https://github.com/jgromes/RadioLib/issues/1873 platform = ststm32@19.7.1 extra_scripts = post:arch/stm32/build_hex.py build_flags = ${arduino_base.build_flags} -D STM32_PLATFORM -I src/helpers/stm32 -I $PROJECT_PACKAGES_DIR/framework-arduinoststm32/libraries/SubGhz/src build_src_filter = ${arduino_base.build_src_filter} + lib_deps = ${arduino_base.lib_deps} file://arch/stm32/Adafruit_LittleFS_stm32 SubGhz [sensor_base] build_flags = -D ENV_INCLUDE_GPS=1 -D ENV_INCLUDE_AHTX0=1 -D ENV_INCLUDE_BME280=1 -D ENV_INCLUDE_BMP280=1 -D ENV_INCLUDE_SHTC3=1 -D ENV_INCLUDE_SHT4X=1 -D ENV_INCLUDE_LPS22HB=1 -D ENV_INCLUDE_INA3221=1 -D ENV_INCLUDE_INA219=1 -D ENV_INCLUDE_INA226=1 -D ENV_INCLUDE_INA260=1 -D ENV_INCLUDE_MLX90614=1 -D ENV_INCLUDE_VL53L0X=1 -D ENV_INCLUDE_BME680=1 -D ENV_INCLUDE_BMP085=1 lib_deps = adafruit/Adafruit INA3221 Library @ ^1.0.1 adafruit/Adafruit INA219 @ ^1.2.3 robtillaart/INA226 @ ^0.6.4 adafruit/Adafruit INA260 Library @ ^1.5.3 adafruit/Adafruit AHTX0 @ ^2.0.5 adafruit/Adafruit BME280 Library @ ^2.3.0 adafruit/Adafruit BMP280 Library @ ^2.6.8 adafruit/Adafruit SHTC3 Library @ ^1.0.1 sensirion/Sensirion I2C SHT4x @ ^1.1.2 arduino-libraries/Arduino_LPS22HB @ ^1.0.2 adafruit/Adafruit MLX90614 Library @ ^2.1.5 adafruit/Adafruit_VL53L0X @ ^1.2.4 stevemarple/MicroNMEA @ ^2.0.6 adafruit/Adafruit BME680 Library @ ^2.0.4 adafruit/Adafruit BMP085 Library @ ^1.2.4 ; ----------------- TESTING --------------------- [env:native] platform = native test_framework = googletest build_flags = -std=c++17 -I src -I test/mocks test_build_src = yes test_ignore = test_kiss_modem build_src_filter = -<*> +<../src/helpers/FwPatch.cpp> +<../src/Utils.cpp> +<../src/Packet.cpp> +<../src/helpers/ConfigSerializer.cpp> +<../src/helpers/DynamicConfigSerializer.cpp> +<../src/helpers/FairnessLimiter.cpp> lib_deps = google/googletest @ 1.17.0 ; Stejné jako [env:native], ale pod AddressSanitizerem. Bounds fixy v parsování ; paketů nemění návratovou hodnotu -- odmítnou přesně to, co upstream odmítne až ; po přečtení -- takže rozdíl je vidět jenom tady. Testy krmí parser bufferem ; alokovaným na přesnou délku rámce, aby bylo čtení za jeho konec skutečná chyba. [env:native_asan] platform = native test_framework = googletest build_flags = -std=c++17 -I src -I test/mocks -fsanitize=address,undefined # Bez -fno-sanitize-recover UBSan nalez jen VYPISE a test dobehne uspesne -- # takze z te poloviny sanitizeru byla jen ozdoba. ASAN abortuje sam. -fno-sanitize-recover=all # POZOR na diagnostiku: `pio test` u padu sanitizeru vypise jen # "Program received signal SIGHUP" a ASAN report SPOLKNE. Necti z toho, ze # sanitizer nic nenasel -- spust binarku primo: # pio run -e native_asan -t buildprog && .pio/build/native_asan/program # Overeno 2. 9. 2026: pres `pio test` jen SIGHUP, primo pak # "heap-buffer-overflow ... src/Packet.cpp:93 in mesh::Packet::readFrom". -fno-omit-frame-pointer -g -O1 build_unflags = -O2 test_build_src = yes ; test_empty_contact_slots (upstream 20. 10. 2026) jako prvni test vola ed25519 ; na hostu a UBSan zastavi na `lib/ed25519/fe.c:714: left shift of negative ; value` -- idiom referencni implementace ref10, ne nalez v nasem kodu. GCC ; nema per-file ignorelist, takze ten test bezi jen v [env:native]. test_ignore = test_kiss_modem test_empty_contact_slots ; POZOR: musi zustat v zakrytu s [env:native]. Merge upstreamu 2. 9. 2026 pridal ; DynamicConfigSerializer.cpp jen tam a tenhle env pak padal na undefined ; reference -- coz vypada jako nalez ASANu, a je to jen chybejici prekladova ; jednotka. build_src_filter = -<*> +<../src/helpers/FwPatch.cpp> +<../src/Utils.cpp> +<../src/Packet.cpp> +<../src/helpers/ConfigSerializer.cpp> +<../src/helpers/DynamicConfigSerializer.cpp> +<../src/helpers/FairnessLimiter.cpp> lib_deps = google/googletest @ 1.17.0 [env:native_kiss_modem] platform = native test_framework = googletest ; Stampovani i tady: `KissModem::handleGetDeviceName()` pripojuje k vyrobci ; FIRMWARE_VERSION, jinak je deska s KISS buildem verzne neidentifikovatelna. ; Bez tohohle skriptu se ten symbol na hostu nedefinuje a test env se od ; 1. 9. 2026 ani neprelozil ("FIRMWARE_VERSION was not declared"). extra_scripts = pre:tools/build_version.py build_flags = -std=c++17 -I test/mocks -I src -I examples/kiss_modem test_build_src = yes test_filter = test_kiss_modem build_src_filter = -<*> +<../examples/kiss_modem/KissModem.cpp> lib_deps = google/googletest @ 1.17.0