Distinguishing MQTT Packet Receipt from Screen State

Distinguishing MQTT Packet Receipt from Screen State

Try Start with Step and compare the broker record for the retained update with the values on the two screens.

Distinguishing MQTT Packet Receipt from Screen State

Step-through
  1. Device
  2. MQTT broker
  3. Mobile app
  4. Dashboard

Publish the changed device state

Device → Broker

PUBLISH OFF · RETAIN requested

Mobile app

Last shown · ON

Dashboard

Last shown · ON

The device changes from ON to OFF and publishes the update.

Observe In frame 3 both clients show receipt of OFF and their displays are Pending with ON still shown. In frame 4 the app displays OFF while the dashboard marks its old ON value Stale.
Explain For the QoS 1 deliveries, PUBACK establishes packet receipt. A scripted hold delays dashboard processing, so the app can apply OFF while the dashboard still shows the earlier ON report.

Technical boundaries. The trace follows one retained OFF update with a scripted delay in dashboard processing. It shows the order of receipt and display changes without elapsed times. The dashboard catches up when the hold is released in this example.

Back to the chapter