Skip to Main Content
Hands-On Internet of Things with MQTT
book

Hands-On Internet of Things with MQTT

by Tim Pulver
October 2019
Intermediate to advanced content levelIntermediate to advanced
350 pages
9h 5m
English
Packt Publishing
Content preview from Hands-On Internet of Things with MQTT

Making the dispenser controllable via MQTT

Now let's add MQTT functionality. What we want to achieve is the following.

The Arduino should subscribe to the /yourname/feeder/feed topic. The namespace consists of three parts: yourname, which you can freely pick, should unify all of your MQTT experiments; feeder, which is the name of your device (you could also give it a longer name, such as food-dispenser); and feed, which is a command we use to release one portion of food. We could also add other commands here. One command that would be good to add is status, to which the device sends a message when it connects or disconnects to the internet and MQTT server. Its namespace would look like this: /yourname/feeder/status. Feel free to add this ...

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.
Start your free trial

You might also like

Practical IoT Hacking

Practical IoT Hacking

Fotios Chantzis, Ioannis Stais, Paulino Calderon
Internet of Things (IoT) Fundamentals

Internet of Things (IoT) Fundamentals

Jerome Henry / Rob Barton

Publisher Resources

ISBN: 9781789341782Supplemental Content