Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
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

Product type Book
Published in Oct 2019
Publisher Packt
ISBN-13 9781789341782
Pages 350 pages
Edition 1st Edition
Languages
Author (1):
Tim Pulver Tim Pulver
Profile icon Tim Pulver
Toc

Table of Contents (16) Chapters close

Title Page
Copyright and Credits About Packt Contributors Preface 1. The Internet of Things in a Nutshell 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 3Getting 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 $15.99/month. Cancel anytime}