Commit Graph
5 Commits
Author SHA1 Message Date
bonaminandClaude Sonnet 5 838e206a82 fix(Telemetry,HealthMonitor): bump task stacks to fix reboot-every-10min crash
TelemetryTask (4096B) overflowed its stack canary because
flushRuntimeToSD() nests ArduinoJson serialization + SD write + a
LOG_DEBUG call that fans out to Logging::log()'s 512B format buffer
and publishToMqtt()'s String + AsyncMqttClient::publish() — all on
the same small stack. Bumped to 8192B.

HealthMonitor's monitoring task shares the same nested-logging
pattern (11 LOG_* calls per health check pass) and was judged next
most likely to trip, so bumped 4096B -> 6144B pre-emptively.

RAM headroom confirmed fine post-bump (19.2%, 63KB/320KB used).
Root cause, other at-risk tasks, and the planned logging-queue
redesign are documented in feature-catalog.md F-051.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 09:22:11 +03:00
bonaminandClaude Sonnet 4.6 3d90ed4292 refactor(Logging): calibrate default levels and reduce playback noise
Serial default VERBOSE→INFO, MQTT default NONE→WARNING, SD NONE→WARNING.
Per-subsystem MQTT caps added in CommunicationRouter: BellEngine/
OutputManager/HealthMonitor/ConfigManager at WARNING to silence per-note
and per-poll spam; Player/Telemetry/OTAManager at INFO to keep state
transitions visible.

Remove early Logging::setLevel() call in main.cpp — CommunicationRouter
applies all three channels once the MQTT callback is wired. Loop heartbeat
downgraded DEBUG→VERBOSE. HealthMonitor polling noise (skipping/performing
lines) removed; subsystem status and completion lines VERBOSE→DEBUG.
FirmwareValidator boot-path checks VERBOSE→INFO (one-shot, worth seeing).
ConfigManager isHealthy() false-branches and NVS read trace VERBOSE→DEBUG.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-09 10:01:19 +03:00
bonaminandClaude Sonnet 4.6 a4d071d5d5 feat: multi-board HAL guards, RFRemote subsystem, Player/OTA improvements
Multi-board variant support:
- variants/vesper.hpp: enable HAS_RF=1, define RF_RX_PIN=22
- variants/agnus.hpp: enable HAS_RF=1, RF_RX_PIN=22, correct HAS_RTC=0
- main.cpp, Player, HealthMonitor, OTAManager, ConfigManager: wrap all
  RTC/SD/RF-dependent code in #if HAS_RTC / HAS_SD_CARD / HAS_RF guards
  so Agnus builds cleanly without those peripherals

RFRemote subsystem (new):
- src/RFRemote/: RF receiver driver (GPIO RF_RX_PIN) + command handler
- Registered with HealthMonitor and CommunicationRouter when HAS_RF=1

Player improvements:
- uid -> pid rename throughout (Player, BuiltInMelodies, api-reference)
- loadMelodyInRAM() now returns bool
- playerControlTaskFn task added — defers stop/pause/resume out of
  timer callback (Tmr Svc) to avoid stack overflows
- setDependencies() accepts nullptr FileManager for SD-less boards

OTAManager:
- Consume download_url from server metadata response instead of
  constructing firmware path locally
- HTTP redirect following enabled (setFollowRedirects)
- HAS_RTC guards on TimeKeeper references

platformio.ini:
- Add rc-switch library for RF remote support
- Remove BOARD_TYPE/BOARD_NAME/BOARD_VERSION flags (moved to variant headers)
- MQTT_SECRET placeholders only — no secrets in source

Docs:
- docs/architecture/codebase-refactor-plan.md: new migration strategy doc
- docs/reference/api-reference.md: updated for pid, note_assignments, download_url
- Remove stale docs: ota-telemetry-api.md, platformio-commands.md, firmware-variants.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 17:02:01 +02:00
bonaminandClaude Sonnet 4.6 d4bd990e53 feat: semver versioning, FastAPI OTA integration, health alerts via MQTT
- Version.hpp: extract FW_VERSION from main.cpp into shared header
- OTAManager: replace uint16_t version with SemVer struct; update API URLs
  to new FastAPI backend (/api/firmware/{hw_type}/{channel}/latest);
  add postDownloadTelemetry() and postFlashTelemetry() for fleet visibility
- ConfigManager: remove fwVersion from DeviceConfig (always read from
  FW_VERSION constant); saveDeviceConfig/loadDeviceConfig are now no-ops;
  fallbackServerUrl replaced with fallbackServerUrls[2] array
- HealthMonitor: add AlertCallback + setAlertCallback() firing on state
  transitions (including CLEARED on recovery)
- CommunicationRouter: wire HealthMonitor alert callback on begin();
  add publishAlert() and publishInfo() for MQTT status topics
- MQTTDriver: add _alertsTopic + _infoTopic; add publishDirect() for
  absolute topic publishing; migrate heartbeat to JsonDocument
- ResponseBuilder, ClientManager, BellEngine: StaticJsonDocument /
  DynamicJsonDocument → JsonDocument; remove dead notifyBellsFired()
- docs: reorganise into architecture/, dev/, features/, reference/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 22:15:27 +02:00
bonamin 30d660268f refactor: Fixed the file hierarchy and switched to platform.io 2026-02-28 21:57:42 +02:00