Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Internet of Things with MQTT

You're reading from   Hands-On Internet of Things with MQTT Build connected IoT devices with Arduino and MQ Telemetry Transport (MQTT)

Arrow left icon
Product type Paperback
Published in Oct 2019
Publisher Packt
ISBN-13 9781789341782
Length 350 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Tim Pulver Tim Pulver
Author Profile Icon Tim Pulver
Tim Pulver
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Title Page
Copyright and Credits About Packt Contributors Preface 1. The Internet of Things in a Nutshell FREE CHAPTER 2. Basic Architecture of an IoT Prototype 3. Getting Started with MQTT 4. Setting Up a Lab Environment 5. Building Your Own Automatic Pet Food Dispenser 6. Building a Smart E-Ink To-Do List 7. Building a Smart Productivity Cube, Part 1 8. Building a Smart Productivity Cube, Part 2 9. Presenting Your Own Prototype 1. Assessments 2. Other Books You May Enjoy

Chapter 5: Building Your Own Automatic Pet Food Dispenser

  1. The # character is called a multi-level wildcard. By using it, we subscribe to all subtopics of the topic.
  2. In this project, we are using the public namespace with the try/try login credentials. It is neither secure nor private, and we just use it because it is easier and more tolerable for a prototype. If you want more security and privacy for your data, you need to use a private channel on Shiftr (or any other MQTT server with private channel functionality).
  3. If Shiftr stops working at some point, you can just move on to another (free) MQTT server (a list can be found at https://github.com/mqtt/mqtt.github.io/wiki/public_brokers). This is the beauty of MQTT: there are many implementations, and you can easily move on to another provider or simply create your own (local) server.
  4. You can control the smart pet food dispenser from any MQTT client. MQTT clients come in many shapes and sizes. You can control it using the Terminal (for example, using Mosquitto, which we installed in Chapter 3, Getting Started with MQTT), using iOS or Android apps, or using macOS and Windows apps. You can also create a new Arduino project that also uses MQTT, and easily let the two Arduinos communicate using MQTT in the same way.
  5. Writing as little code as possible is the most efficient way of making your ideas a reality. When you find tiny examples or code snippets that solve parts of your problems, you should try to combine them instead of writing all of the code from scratch. You will be faster this way: you don't need to be an expert, and mostly using code that has been used by other people means that it will probably work when you use it.
  6. You really don't need to be an expert to build breathtaking prototypes. In the physical prototyping workshops I've held, many people who have never written code before built awesome prototypes anyway by combining examples, adding some code to glue them together, and making it look nice by spending time on building a case and hiding the (often ugly-looking) inner workings of the prototype.
  1. Please don't bet the life of your pet on your prototype working. As stated before, it is not secure, can probably fail in other ways, and should just be used as a prototype.
  2. There are many more things that you can build using just a servomotor and the techniques we used. Have a brainstorming session and try to come up with five ideas.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime