- MQTTDriver::publishConfirmed(): QoS 1 + PUBACK tracking (8 s; heartbeat 20 s). A missed PUBACK forces a reconnect. status/playback relies on the existing republish-current-state-on-connect; control/reports are resent after the next CONNACK (newest 4). Publish + registration under one recursive mutex since the PUBACK can arrive before publish() returns. - AsyncMqttClient vendored into lib/ (upstream 3d93fc7) with one patch: _onPubAck()/_onPubComp() call _handleQueue(), so a QoS 1 message delays the next packet by one RTT instead of RTT + up to ~500 ms. - platformio.ini: platform and every library pinned to the exact versions already being built (git deps by commit). Clean-libdeps rebuild verified to resolve the same AsyncTCP and the vendored AsyncMqttClient. - Removed board_build.cmake_extra_args (timer stack): no effect on Arduino builds, the SDK is precompiled with 2048. Replaced by a warning comment. - mqtt.status gains resent_messages and the new forced-reset reasons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
245 lines
12 KiB
INI
245 lines
12 KiB
INI
; ═══════════════════════════════════════════════════════════════════════════════
|
|
; Project Vesper — PlatformIO Configuration
|
|
; ═══════════════════════════════════════════════════════════════════════════════
|
|
;
|
|
; Hardware Variants (active):
|
|
; vesper-v1 — Kincony KC868-A6 (ESP32-D0WD-V3, 4MB flash) — current production board
|
|
; agnus-v1 — ESP32 base, no SD card, NVS-only settings storage
|
|
; agnus-mini-v1 — Same binary as agnus-v1, output limit enforced via app/NVS
|
|
;
|
|
; Future variants (commented out):
|
|
; vesper-plus-v1 — Vesper+ with RF remote support
|
|
; vesper-pro-v1 — Vesper Pro with onboard LCD
|
|
;
|
|
; Each environment auto-includes its variant header via -include variants/<name>.hpp
|
|
; which defines HAS_SD_CARD, HAS_RTC, OUTPUT_COUNT_MAX, etc. for that build.
|
|
;
|
|
; Build: pio run -e vesper-v1
|
|
; Upload: pio run -e vesper-v1 --target upload --upload-port COM8
|
|
; Monitor: pio device monitor
|
|
; Clean: pio run -e vesper-v1 --target clean
|
|
; ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; SHARED SETTINGS — inherited by all environments
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
[common]
|
|
; Everything below is pinned to an exact version on purpose — like the Arduino
|
|
; IDE asking before it updates a library. Nothing changes on a clean build
|
|
; unless someone edits a version here in a commit. To update one: change the
|
|
; pin, rebuild all envs, test on hardware, note it in the commit message.
|
|
; Platform 6.12.0 = Arduino-ESP32 core 2.0.17 (ESP-IDF 4.4).
|
|
platform = espressif32 @ 6.12.0
|
|
framework = arduino
|
|
monitor_speed = 115200
|
|
|
|
; All external library dependencies.
|
|
; Not listed here: AsyncMqttClient — vendored and patched in lib/AsyncMqttClient
|
|
; (see lib/AsyncMqttClient/VENDORED.md). PlatformIO picks it up from lib/.
|
|
lib_deps =
|
|
; WiFi provisioning portal
|
|
tzapu/WiFiManager @ 2.0.17
|
|
|
|
; Async web server + WebSocket support, and its TCP layer (also used by
|
|
; AsyncMqttClient). Git sources are pinned to the exact commit after '#'.
|
|
; me-no-dev/* now redirects to the ESP32Async forks (v3.6.0 / v3.3.2).
|
|
https://github.com/me-no-dev/ESPAsyncWebServer.git#ad3741d159f9cfd50c567e81b67f3bef1dc6d89f
|
|
https://github.com/me-no-dev/AsyncTCP.git#ef448a8a1dffe4ec1b72326dd5a26211ff227b49
|
|
|
|
; JSON parsing
|
|
bblanchon/ArduinoJson @ 7.4.3
|
|
|
|
; I2C GPIO expanders (relay control) — PCF8575 header is bundled in same library
|
|
adafruit/Adafruit PCF8574 @ 1.1.2
|
|
; Pulled in by the Adafruit libraries; pinned so it can't float either
|
|
adafruit/Adafruit BusIO @ 1.17.4
|
|
|
|
; Real-time clock
|
|
adafruit/RTClib @ 2.1.4
|
|
|
|
; RF remote receiver (433MHz, RCSwitch protocol)
|
|
sui77/rc-switch @ 2.6.4
|
|
|
|
; Modbus RTU master (used by Rs485OutputManager for bespoke-rs485 build)
|
|
4-20ma/ModbusMaster @ 2.0.1
|
|
|
|
build_flags_common =
|
|
-std=gnu++14
|
|
-DCORE_DEBUG_LEVEL=0
|
|
-DCONFIG_ASYNC_TCP_RUNNING_CORE=0
|
|
; F-070: route every abort()/assert/stack-overflow through our wrapper so the
|
|
; reason string survives the reboot (src/Telemetry/CrashBreadcrumbs.cpp)
|
|
-Wl,--wrap=esp_system_abort
|
|
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; VESPER Standard v1 — Kincony KC868-A6 (ESP32-D0WD-V3, 4MB Flash)
|
|
; Current production board
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
[env:vesper-std-v1]
|
|
platform = ${common.platform}
|
|
framework = ${common.framework}
|
|
board = esp32dev
|
|
|
|
; Serial monitor
|
|
monitor_speed = ${common.monitor_speed}
|
|
|
|
; Upload settings
|
|
upload_speed = 921600
|
|
upload_protocol = esptool
|
|
|
|
; Partition table — MUST match the layout already burned into field devices
|
|
; running the pre-restructure firmware (Arduino IDE PartitionScheme=no_fs).
|
|
; No spiffs partition — this firmware is SD-card only and never used SPIFFS.
|
|
; Using min_spiffs.csv here would move app1's offset (0x1F0000 vs 0x200000)
|
|
; and shrink both app slots, which OTA cannot safely migrate on its own —
|
|
; the currently-burned partition table on those devices has no entry at the
|
|
; new offset, so pushing a min_spiffs-built binary via OTA leaves the
|
|
; bootloader unable to find a valid image after the slot flip. See
|
|
; docs/features/feature-catalog.md F-059 for the full writeup.
|
|
board_build.partitions = no_fs.csv
|
|
|
|
; Upgrade to C++14 so std::make_unique is available
|
|
build_unflags = -std=gnu++11
|
|
|
|
; NOTE: the FreeRTOS timer service task (Tmr Svc) stack is fixed at 2048 bytes in
|
|
; Arduino builds — the SDK is precompiled, so it can't be raised from here (a
|
|
; `board_build.cmake_extra_args` line used to claim 4096; it only works for
|
|
; ESP-IDF framework builds and never had any effect). Timer callbacks must stay
|
|
; tiny: set a flag or notify a task, never LOG / JSON / network / xTaskCreate.
|
|
|
|
; Build flags for this variant
|
|
; IMPORTANT: MQTT_SECRET must match the MQTT_SECRET in the backend .env file exactly.
|
|
; Do NOT commit the real secret value to git.
|
|
; To override locally without modifying this file, use a platformio.ini.local file:
|
|
; [env:vesper-v1]
|
|
; build_flags = ... -DMQTT_SECRET=\"your_actual_secret\"
|
|
build_flags =
|
|
${common.build_flags_common}
|
|
-DPSRAM_ENABLED=0
|
|
-DMQTT_SECRET=\"deea8b2dbf21872bff8b4639ca16d0348358945ccd4c1cb6c5934ba510de1dce\"
|
|
-include variants/vesper-std.hpp
|
|
|
|
lib_deps = ${common.lib_deps}
|
|
|
|
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; AGNUS v1 — No SD card, NVS-only settings storage
|
|
; Same ESP32 base as Vesper. Agnus Mini is the same binary — output limiting
|
|
; is handled in the app and NVS, not in firmware.
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
[env:agnus-v1]
|
|
platform = ${common.platform}
|
|
framework = ${common.framework}
|
|
board = esp32dev
|
|
|
|
monitor_speed = ${common.monitor_speed}
|
|
upload_speed = 921600
|
|
upload_protocol = esptool
|
|
|
|
; Partition table — kept consistent with vesper-std-v1 (see that env's comment
|
|
; for the full rationale). No spiffs partition; SD-card only, no SPIFFS usage.
|
|
board_build.partitions = no_fs.csv
|
|
build_unflags = -std=gnu++11
|
|
|
|
build_flags =
|
|
${common.build_flags_common}
|
|
-DPSRAM_ENABLED=0
|
|
-DMQTT_SECRET=\"deea8b2dbf21872bff8b4639ca16d0348358945ccd4c1cb6c5934ba510de1dce\"
|
|
-include variants/agnus.hpp
|
|
|
|
lib_deps = ${common.lib_deps}
|
|
|
|
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; AGNUS MINI v1 — Same binary as agnus-v1, different NVS provisioning
|
|
; Output count is limited via the app and NVS key, not in firmware.
|
|
; Only exists as a separate env so OTA can target it independently.
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
[env:agnus-mini-v1]
|
|
platform = ${common.platform}
|
|
framework = ${common.framework}
|
|
board = esp32dev
|
|
|
|
monitor_speed = ${common.monitor_speed}
|
|
upload_speed = 921600
|
|
upload_protocol = esptool
|
|
|
|
; Partition table — kept consistent with vesper-std-v1 (see that env's comment
|
|
; for the full rationale). No spiffs partition; SD-card only, no SPIFFS usage.
|
|
board_build.partitions = no_fs.csv
|
|
build_unflags = -std=gnu++11
|
|
|
|
build_flags =
|
|
${common.build_flags_common}
|
|
-DPSRAM_ENABLED=0
|
|
-DMQTT_SECRET=\"deea8b2dbf21872bff8b4639ca16d0348358945ccd4c1cb6c5934ba510de1dce\"
|
|
-include variants/agnus.hpp
|
|
|
|
lib_deps = ${common.lib_deps}
|
|
|
|
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; BESPOKE RS485 v1 — Vesper base board + Waveshare 16CH RS485 Modbus RTU relay
|
|
;
|
|
; One-off build for a single client requiring 16 outputs. The internal PCF8574
|
|
; relays on the KC868-A6 are NOT used. All outputs go through the Waveshare board
|
|
; via UART2 RS485 (GPIO27 TX, GPIO14 RX, MAX13487EESA auto-direction transceiver).
|
|
;
|
|
; OTA updates for this device must be built from THIS environment only.
|
|
; Other environments are unaffected — Rs485OutputManager is dead code for them
|
|
; since FEATURE_RS485 is not set.
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
[env:bespoke-rs485-v1]
|
|
platform = ${common.platform}
|
|
framework = ${common.framework}
|
|
board = esp32dev
|
|
|
|
monitor_speed = ${common.monitor_speed}
|
|
upload_speed = 921600
|
|
upload_protocol = esptool
|
|
|
|
; Partition table — kept consistent with vesper-std-v1 (see that env's comment
|
|
; for the full rationale). No spiffs partition; SD-card only, no SPIFFS usage.
|
|
board_build.partitions = no_fs.csv
|
|
build_unflags = -std=gnu++11
|
|
|
|
build_flags =
|
|
${common.build_flags_common}
|
|
-DPSRAM_ENABLED=0
|
|
-DMQTT_SECRET=\"deea8b2dbf21872bff8b4639ca16d0348358945ccd4c1cb6c5934ba510de1dce\"
|
|
-include variants/bespoke_rs485.hpp
|
|
|
|
lib_deps = ${common.lib_deps}
|
|
|
|
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; VESPER+ v1 — Future: adds RF remote support
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; [env:vesper-plus-v1]
|
|
; platform = ${common.platform}
|
|
; framework = ${common.framework}
|
|
; board = esp32dev
|
|
; monitor_speed = ${common.monitor_speed}
|
|
; build_flags =
|
|
; ${common.build_flags_common}
|
|
; -DPSRAM_ENABLED=0
|
|
; -DMQTT_SECRET=\"change-me-in-platformio-ini\"
|
|
; -include variants/vesper.hpp
|
|
; lib_deps = ${common.lib_deps}
|
|
|
|
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; VESPER PRO v1 — Future: adds onboard LCD
|
|
; ───────────────────────────────────────────────────────────────────────────────
|
|
; [env:vesper-pro-v1]
|
|
; platform = ${common.platform}
|
|
; framework = ${common.framework}
|
|
; board = esp32dev
|
|
; monitor_speed = ${common.monitor_speed}
|
|
; build_flags =
|
|
; ${common.build_flags_common}
|
|
; -DPSRAM_ENABLED=0
|
|
; -DMQTT_SECRET=\"change-me-in-platformio-ini\"
|
|
; -include variants/vesper.hpp
|
|
; lib_deps = ${common.lib_deps}
|