A panel reconnects and displays temperature and humidity immediately, but the values are already more than ten minutes old. Check whether it received a snapshot held by the broker, then verify whether the source generated a record with a new sample timestamp.
The example checks a read-only display in an isolated development environment with synthetic sensor data. It uses no live network operations, external accounts or device controls. The sensor may use a quartz reference for a controller or communication module, while application time can come from another clock. The actual device clock design is unspecified.
The last reported value may have been measured much earlier
In MQTT, a publisher can mark an application message as retained. A broker supporting retention can store the last retained message for future subscribers to that topic. Delivery when subscribing or resubscribing depends on protocol version and retain-handling options. Receiving a message immediately after reconnect does not establish that the sensor is online and has just acquired a measurement.
Track three times. Record when the sensor generates the measurement, when it reaches the broker or cache, and when the panel receives and displays it. The display timestamp is often easiest to obtain. It alone does not establish freshness. A broker may immediately provide an earlier value or wait until a new sample is available. If the application overwrites sample time with receipt time, both cases look the same.
Retention differs from a panel's local cache, queued delivery after a disconnect and a message being republished. Determine which metadata the fixture exposes and save it, since reconnect messages do not all carry the same flags. Distinguish a stored snapshot delivered on subscription from normal forwarding during operation. If evidence is insufficient, mark the source unconfirmed before attributing the anomaly to network, clock or sensor.
Worked example: a panel update can show a sample more than eighteen minutes old
Suppose the bench uses one comparable timebase. The synthetic source generates sample sequence 42 at 10:00:00. The panel creates a subscription at 10:18:00 and shows the original sample at 10:18:01. Delivery and display can take about a second while the sample is about 18 minutes and 1 second old. If the product marks anything older than two minutes stale, it cannot present this as fresh. These timestamps and thresholds belong to the example and are not MQTT rules.
Now suppose another sample is acquired at 10:18:04 and displayed at 10:18:06, about two seconds later. If the readings happen to match, the displayed number cannot tell whether the sample is new. Sequence number, source ID and sample time can identify it. A device restart may reset the sequence to a lower value, so keep a comparable session or boot identifier. Equal values can be fresh, and a lower sequence number does not establish staleness.
If source and display clocks are unsynchronized, subtraction can yield a negative age. Mark timebases as incomparable rather than silently clamping the value to zero. A trusted receiver can measure elapsed time since receipt, but label it as time since receipt rather than sample age. Use a monotonic clock for short local intervals so changes in wall time do not distort them.
Reproduce three display states without changing production nodes
Simulate a new subscription with an old record and log sample time, source ID and display time. Generate an identifiable fresh sample and check the change from stale to current. Finally, deliver a record with no sample timestamp and only a reception time, and verify it is not automatically considered fresh. Keep the same panel version and application settings for all three.
| Check | Records to keep | What the evidence separates |
|---|---|---|
| Source identity | Synthetic device ID, boot generation and sequence | New device or reboot versus old sample from the same source |
| Time and status | Sample, reception and display timestamps and labeling rules | Fast display versus fresh data |
| Subscription behavior | Protocol version, new subscription, retain handling and available flags | Whether a stored snapshot could explain delivery |
| Application display | Value, stale or unknown status, and behavior when a new value arrives | Preserve history while identifying current measurements |
A panel can usefully display the last local reading when offline. Mark that separately from a snapshot newly received from the broker. Use distinct values first to trace local cache and remote replay, then use equal values with different sequence numbers. Without source logs, keep first appearance and provenance separately and avoid claiming a cause that cannot be confirmed.
A correct stale warning does not show that the sensor recovered. Verify delivery of at least one newly generated sample and check time comparability. Marking a device online whenever the panel receives a record on reconnect can confuse panel-to-broker connectivity with fresh reporting from the remote sensor. Track these states separately.
When does this fault call for a 26 MHz crystal check?
Taiwan's TXC 7M passive quartz crystal family covers 26 MHz. It is an inquiry option if the board has a matching oscillator circuit. It does not identify a fitted part or provide logic output on its own. Verify full order code, load capacitance, equivalent series resistance, drive, temperature and footprint.
If repeated resets, sampling timing faults or an out-of-spec runtime timebase are measured, trace the oscillator path using hardware documentation. If only the first reconnect message is stale while sampling continues regularly and no hardware evidence contradicts the timestamps, correct the display rules first. Clock acceptance and data freshness need separate validation. The absence of another stale display does not qualify the clock.
Define three display states in requirements. They cover a verified fresh value, historical data only and no interpretable data yet. A retained message can promptly populate the historical state without establishing freshness. Give each state defined inputs and expected actions, such as showing the sample timestamp, marking the timebase incomparable or waiting for a fresh sample. Verify those transitions before judging visual styling.
During staggered node upgrades, older messages may lack newly introduced time or sequence fields. Cover present fields, missing fields and changed semantics separately. Leaving an unknown timestamp unknown preserves history without treating the first reconnect record as current.
Frequently asked questions
Does turning off retained snapshots fix the problem? It can leave the display empty while no new measurement is available or change page startup behavior. Retention is an application choice. Freshness and availability still need explicit rules.
If the number never changes, is it stale? The environment can stay stable. Compare sample time, sequence and source ID to determine whether new measurements continue arriving.
