Idea
In short
How do you build an MQTT heartbeat and last will?
An ESP32 publishes a heartbeat to a small MQTT broker on your own computer, and sets a last-will message so the broker tells everyone when the board drops off. Switch the board off and watch the status change to offline. It shows how real IoT systems notice a dead device. You need ESP32 DevKit V1, LED 5 mm red, Resistor 220 Ω, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
- Level
- Intermediate
- Time
- About 80 min
- Parts
- 5
An idea, not a guided build yet. Goal, parts and steps; no wiring, code or tests. Copy it to My Garage to plan it.
Goal
Make an IoT board announce when it goes offline.
Parts list
- Development Boards
- Semiconductors
- Passives
- Prototyping
- Prototyping
How to build it
- Run a Mosquitto broker on a computer
- Connect the board with placeholder Wi-Fi details
- Publish a heartbeat every ten seconds
- Set a last-will message
- Pull the power and watch the status flip
Related projects
Common questions
What parts do I need for the MQTT heartbeat and last will?
ESP32 DevKit V1, LED 5 mm red, Resistor 220 Ω, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the MQTT heartbeat and last will take to build?
About 80 minutes for a intermediate maker.
