feat(MQTT): rebuild topic spec to v2 (F-062)
Full MQTT topic rebuild per docs/reference/vesper_mqtt_topic_spec_v2.md.
Only the MQTT transport path changed — WebSocket, HTTP, and UART are untouched.
- control/command (in) + control/ack (out, strictly replies) replace the old
control/data pair; new control/reports for critical unsolicited events
(bell overload) that don't belong on the strictly-reply ack channel
- status/playback split out for playback transitions only
- status/alerts + status/info renamed to system/alerts + system/info, both
now correctly retained; new system/logs and system/metrics (diagnostics
report moved here from system/info, gained bell strike/heat data)
- LWT registered for the first time — status/heartbeat gets
{"state":"offline","ok":false} on an unclean disconnect; graceful
disconnect (mqtt.disable) announces offline explicitly since LWT doesn't
fire on a clean disconnect
- heartbeat payload flattened, gains independently-derived state/ok fields
(via a new MQTTDriver::setStateProvider() wired from Player+HealthMonitor)
- optional req_id correlation added bus-wide (CommandEnvelope/CommandResult),
not MQTT-only, since any transport with multiple senders sharing one
channel has the same problem. Always optional — v1 clients unaffected.
- per-topic ON/OFF switches (ConfigManager::MqttTopicConfig, 8 flags) as
sub-switches under the existing mqtt.enable/disable master switch, so a
device can breathe by disabling topics it doesn't need. New
mqtt.get_topics/mqtt.set_topics commands; command switch applies live.
Bumped to v2.2.0. Verified: pio run -e vesper-std-v1 -e agnus-v1 both build clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -125,7 +125,7 @@ This happens immediately after `configManager.begin()`, before any other subsyst
|
||||
`CommunicationRouter::begin()` registers both callbacks and applies all three channel levels from `ConfigManager`:
|
||||
|
||||
```cpp
|
||||
Logging::setMqttPublishCallback(..., "vesper/<uid>/logs");
|
||||
Logging::setMqttPublishCallback(..., mqttClient.getLogsTopic()); // vesper/<uid>/system/logs
|
||||
Logging::setSdWriteCallback([fm](const String& line) {
|
||||
fm->appendLogLine("/logs", line, time(nullptr), SD_LOG_MAX_TOTAL_BYTES);
|
||||
});
|
||||
@@ -134,6 +134,8 @@ Logging::setMqttLevel(...);
|
||||
Logging::setSdLevel(...);
|
||||
```
|
||||
|
||||
The registered MQTT publish callback also checks `ConfigManager::getMqttTopicConfig().logs` before publishing — this is a second, independent gate alongside the per-level `mqttLevel` check `Logging` already does internally. An operator can silence the whole `system/logs` channel via `mqtt.set_topics { "logs": false }` without changing the configured level, then re-enable it later with the level untouched. See `docs/reference/vesper_mqtt_topic_spec_v2.md`.
|
||||
|
||||
It also sets the default per-subsystem MQTT suppressions to prevent feedback loops:
|
||||
|
||||
```cpp
|
||||
|
||||
Reference in New Issue
Block a user