Problem 1 – dynamic IP addresses
The dynamic IP addresses of the lamps lead to code changes being necessary in the Arduino controller. Using MQTT, the controller does not talk directly to the lamps. It does not know anything about them. Instead, it just publishes on or off to the /magic button topic of the MQTT server (the central entity, which manages all published messages and subscriptions), without knowing whether there are any lamps listening—basically saying to whoever it may concern, the magic button was pressed and it is on now.
All that the controller Arduino and the lamps need to know about is where to find the MQTT server (typically, using a third-party server with a static IP), as well as the topic where the information is published ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access