Skip to content

Add MQTT reconnect backoff #8

Description

@TalkingJupiter

Context

The current MQTT reconnect helper retries whenever publish/connect logic reaches it. If the broker is unavailable, this can cause overly aggressive reconnect attempts.

Scope

Add bounded reconnect backoff to the MQTT sender.

Suggested behavior

  • Track the last reconnect attempt timestamp.
  • Only retry every 2-5 seconds while disconnected.
  • Keep mqttClient.loop() running when connected.
  • Do not block heartbeat or temperature sampling.

Acceptance criteria

  • Broker-down scenarios do not spam reconnect attempts every main loop.
  • Serial logs remain useful but not noisy.
  • Telemetry resumes automatically when broker connectivity returns.
  • A/B heartbeat and failover logic remain responsive while MQTT is down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions