relay.test_bell — fire bell N using configured output + duration, non-blocking
relay.test_batch — fire a list of bells simultaneously (single melody step)
clock.test_c1 — fire C1 (ODD) clock output using pulse_duration
clock.test_c2 — fire C2 (EVEN) clock output using pulse_duration
All four bypass bellsEnabled guard intentionally — test commands always fire.
ClockHandler now accepts an optional OutputManager* for the test commands.
CommunicationRouter passes _outputManager to ClockHandler.
Feature catalog updated: F-038 and F-039 added.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds full bidirectional remote control across all major subsystems,
establishing the device as the single source of truth for all settings.
New firmware features (F-029 to F-037):
- bells.enable / bells.disable: master ON/OFF for all playback and clock
alerts (relay.test_output intentionally unaffected)
- telemetry.set_guard_enabled: enable/disable thermal protection at runtime
without touching thresholds
- telemetry.set_max_loads: set bellMaxLoad per-bell or globally via command
- Device runtime tracking: lifetime seconds flushed to SD every 10 min,
boot log (up to 200 entries, rotating) written after first NTP sync
- Total playback counter persisted to SD, increments on every play()
- telemetry.get_metrics / telemetry.reset_metrics: new aggregate read + reset
- system.get_config (replaces system.get_settings, old name still accepted),
system.get_all (everything in one call), system.get_telemetry
- log.get_config, mqtt.get_config, bells.get_config: new getters for
previously write-only subsystems
- network.status now includes ssid, mac, hostname
- BellsHandler: new handler registered on CommandBus
- LegacyAdapter updated with all new command mappings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
F-024 — V1 single-segment fix: when continuous_loop=false, total_duration is
now always overwritten with segment_duration regardless of what the client
sent. Sending total_duration:0 explicitly no longer bypasses the stop timer.
The play-once fallback in onMelodyLoopCompleted is tightened to only fire when
both segment_duration and total_duration are zero.
F-025 — V2 command namespace: PlaybackHandler now registers playback.play and
playback.stop instead of the old root-level playback command. LegacyAdapter
maps V1 { cmd:playback, action:play/stop } to the new V2 names so all deployed
clients keep working without changes.
F-026 — V2 mode field: setMelodyAttributes accepts a mode string (single /
timed / interval / infinite) with a duration field, replacing the ambiguous
continuous_loop + segment_duration + total_duration triplet. V1 timing fields
are still parsed when mode is absent.
Docs: feature-catalog.md entries F-024, F-025, F-026 added.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add inline documentation for all src/ subsystems covering purpose,
responsibilities, public API, and usage notes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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>
- Delete dead code: CommandHandler (700-line God Class) and
HTTPRequestHandler — both replaced by new architecture in Stage 4
- Create Drivers/ group for the three low-level protocol drivers,
mirroring the Transport/ pattern:
MQTTAsyncClient → Drivers/MQTTDriver (class: MQTTDriver)
WebSocketServer → Drivers/WebSocketDriver (class: WebSocketDriver)
UARTCommandHandler → Drivers/UARTDriver (class: UARTDriver)
- Update all includes and type references across CommunicationRouter,
all three Transport wrappers, and MQTTHandler
- Add -std=gnu++14 + build_unflags to platformio.ini so std::make_unique
compiles on ESP32 (required by CommunicationRouter::registerHandlers)
Build: passing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the complete set of v2 command handlers. Old CommandHandler is
untouched — handlers are standalone and not yet wired to anything.
Handlers added:
PlaybackHandler — playback (1 dependency)
LoggingHandler — log.set_serial/sd/mqtt
FileHandler — files.list/list_builtin/download/delete
TelemetryHandler — telemetry.get_strikes/reset_strikes/get_loads
RelayHandler — relay.set_durations/set_outputs/get_config/test_output
FirmwareHandler — firmware.status/commit/rollback + ota.update/custom
NetworkHandler — network.info/status/set_config
MQTTHandler — mqtt.enable/disable
SystemHandler — ping/identify + system.* commands (8 total)
ClockHandler — 16 clock.* commands
Notable fixes vs. original CommandHandler:
- clock.set_timings now sets pulseDuration/pauseDuration correctly
(original called updateClockOutputs — was a bug)
- system.restart uses a deferred FreeRTOS task (no blocking delay)
- relay.test_output safety-gated: player must be fully stopped
- Timekeeper class name (lowercase k) corrected throughout
Two compile-time fixes applied during build:
- JsonVariantConst → const_cast<JsonDocument&>().as<JsonVariant>()
(ConfigManager methods take non-const JsonVariant)
- class TimeKeeper → class Timekeeper (actual class name in header)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the core data structures and interfaces for the comms refactor.
No behaviour change — old CommandHandler is completely untouched.
New files:
CommandEnvelope.hpp — universal message wrapper (transport + command + reply lambda)
CommandResult.hpp — standardised return type with ok/err/info factories
ICommandHandler.hpp — interface every domain handler will implement
ITransport.hpp — interface every transport layer will implement
CommandBus.hpp/.cpp — registry + dispatcher (std::map, O(log n) lookup)
Two minor corrections vs. plan:
std::unordered_map → std::map (Arduino String has no std::hash)
LOG_WARN → LOG_WARNING (codebase macro name)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>