Skip to content

Add MQTT config subscription and callback handling #5

Description

@TalkingJupiter

Context

RuntimeConfig parsing exists, but the firmware does not yet subscribe to any MQTT config topic or apply received config.

Scope

Subscribe to a per-device config topic and parse config messages.

Suggested topic:

repacss/devices/<mac>/config

Implementation notes

  • Add mqttClient.setCallback(...) in TelemetrySender.cpp.
  • Subscribe after successful MQTT connect.
  • Convert the callback payload into a String or bounded buffer safely.
  • Pass config JSON into parseRuntimeConfigJson(...).
  • Store accepted config somewhere the main firmware can use.

Acceptance criteria

  • Firmware subscribes to the config topic after MQTT connect/reconnect.
  • Retained config messages are received after reconnect.
  • Valid config JSON is parsed into RuntimeConfig.
  • Invalid config JSON is rejected with a useful serial log message.
  • Telemetry publishing continues even if config is invalid or missing.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions