CoAP · Study deck
CoAP Observe: Subscriptions and Updates
A thermostat needs fresh changes, not a flood of copies after a link returns.
Broker Bex is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Implement Server Push: Configure and build CoAP Observe for real-time notifications using RFC 7641
- Design Observer Registries: Construct server-side data structures to manage registration, notifications, and deregistration lifecycle
- Calculate Bandwidth Savings: Apply formulas to quantify Observe benefits over traditional polling for specific IoT scenarios
- Diagnose Edge Cases: Identify and resolve NAT timeout, token reuse, and ghost observer problems in deployed systems
Major section
In 60 Seconds
The useful result is a fresh change at the right pace, not merely an open subscription.
- A protocol means the shared rules for a message exchange.
- A broker means a service that receives and forwards named messages.
- Telemetry means measured status sent from a device.
- CoAP means Constrained Application Protocol, a compact system for small devices.
Major section
In 60 Seconds (continued)
MQTT means Message Queuing Telemetry Transport, a broker-based system.
- Register one observer, change the value, lose a notification, reconnect, and remove the observer.
- This runway does not prove every push design or energy saving.
- This eliminates polling overhead -- instead of 8,640 GET requests per day for 10-second updates, the server pushes only on change, reducing traffic by 90%+ for slowly-changing sensor data.
Major section
Start With the Quiet Thermostat
A thermostat does not need to ask a room sensor the same question every ten seconds when the temperature barely changes.
- It needs one registration, then a trustworthy update only when the value crosses a meaningful boundary.
- Observe is that subscription story for CoAP.
- The chapter builds from the simple "tell me when it changes" promise into registries, notification pacing, cleanup, edge cases, and evidence that the push stream saves energy instead of creating a flood.
Major section
Phoebe's Field Notes: Count Radio Wakes, Not Only Bytes
If each wake-transmit-sleep cycle costs about 3.00 mJ, energy falls from 4.32 to 0.723 J/day, an 83.3% event-energy saving.
- A 225 mAh, 3.0 V cell stores 2,430 J, so the same ledger gives 563 versus 3,361 idealised days.
Major section
For Beginners: Understanding Observe vs Polling
You keep asking the same question over and over, even if the answer hasn't changed.
- You ask once, then relax - they'll let you know when something changes.
- Battery life: Every time a device sends a message, it uses power.
- With Observe, you might only send 10 messages when values actually change.
Major section
Putting Numbers to It
We can quantify the exact bandwidth savings.
- Multiple clients can observe one resource, but each relationship needs its own retained state; the next sections trace registration and notification behavior inside that contract.
Major section
Observe Protocol Flow
A notification is useful only if the client can prove that it belongs to the relationship and is fresher than what it already accepted.
- Token continuity identifies the observation, while Observe values and freshness rules help reject stale or reordered updates; a transport ACK confirms delivery but does not by itself prove that the application accepted the value.
Major section
Observe Protocol Flow (continued)
Cancellation or relationship loss ends that state, and re-registration requires reconciliation.
- Client -> Server: RST (stop this observation).
- Timeout (Max-Age expiration):: Keep one practical point in view: If the client does not refresh the observation within Max-Age,.
- If the client does not refresh the observation within Max-Age, the server removes that observer entry.
Deck summary
Key takeaways
The useful result is a fresh change at the right pace, not merely an open subscription.
- MQTT means Message Queuing Telemetry Transport, a broker-based system.
- A thermostat does not need to ask a room sensor the same question every ten seconds when the temperature barely changes.
- If each wake-transmit-sleep cycle costs about 3.00 mJ, energy falls from 4.32 to 0.723 J/day, an 83.3% event-energy saving.
- You keep asking the same question over and over, even if the answer hasn't changed.
Retrieval practice
Recall check 1 of 4

Broker Bex says: answer from memory, then check your reasoning.
Q1A CoAP Observe design replaces polling for a fast-changing sensor. What evidence should be reviewed before accepting it?
Show answer
Answer: C CoAP Observe review should cover registration lifecycle, notification control, network state, and protocol trade-offs.
Retrieval practice
Recall check 2 of 4

Broker Bex says: answer from memory, then check your reasoning.
Q2A client sends GET /temperature with Observe: 0 and Token: 0xAB12. The server responds with Observe: 47. What does the value 47 in the server's response represent?
Show answer
Answer: B Correct!
Retrieval practice
Recall check 3 of 4

Broker Bex says: answer from memory, then check your reasoning.
Q3Complete the CoAP observe subscription for real-time updates:
Show answer
Answer: A CoAP Observe uses observe=0 in the GET request to register for notifications.
Q4What information must the server store for each observer in the observer registry?
Show answer
Answer: B Correct!
Retrieval practice
Recall check 4 of 4

Broker Bex says: answer from memory, then check your reasoning.
Q5A CoAP server has 100 clients observing a temperature resource. The resource changes rapidly (10 times/second). What problem will occur and how should you fix it?
Show answer
Answer: C Correct!
Print reference
Answers
Answer key.
- C · CoAP Observe review should cover registration lifecycle, notification control, network state, and protocol trade-offs.
- B · Correct!
- A · CoAP Observe uses observe=0 in the GET request to register for notifications.
- B · Correct!
- C · Correct!