The software that powers IoT is changing rapidly as customers demand more sophisticated products. Developers creating the software for embedded products need to adopt new techniques to meet these increased customer expectations.
The book focuses on the ESP32 and ESP8266 microcontrollers because they deliver a major leap in capabilities at a very low cost. These chips are found in commercial products from major companies worldwide and are also popular with students and makers.
The authors are both members of the team that created the Moddable SDK. This book draws on their years of experience using it to deliver products. They wrote this book for embedded developers, web developers, product designers, and makers.
Examples are available in the book's repository on GitHub. The book includes instructions for building the examples using macOS, Windows, and Linux computers.
Network connections are fundamental to IoT. The examples include secure communication with the essential IoT cloud protocols HTTP, WebSockets, and MQTT. You'll also learn to scan for Wi‑Fi networks using the built-in Wi‑Fi on the ESP32 and ESP8266, and how to use mDNS to advertise and discover local network services.
Displays make products easier to understand and use, so it is no surprise they are becoming more common in IoT products. You'll learn how to overcome the constraints of inexpensive microcontrollers to deliver high-quality, high-performance graphics using the APIs and build tools in the Moddable SDK.
Sensors are a key hardware component in most IoT products. You'll learn how to read data from a widely used temperature sensor, configure the resoution of its readings, and manage its energy use. More importantly, you'll see how to use a sensor's data sheet to write the software to communicate with it, so you can support whatever sensors your project needs.
Getting pixels on the screen is only the first step in building a user interface. It is challenging to create an interface that looks and feels like it belongs next to a modern mobile phone. The Piu user interface framework brings powerful ideas from the web to inexpensive microcontrollers. That includes cascading styles, responsive layout, timeline driven animation, and declarative user interface specification.
A series of step-by-step examples shows you how to use Piu to create a beautifully animated interface for your project, including an expanding touch keyboard for small screens.
When writing software for an IoT product, eventually you need to write code that interacts directly with the hardware. You'll learn how to detect presses of tactile buttons, control single and tri‑color LEDs, turn servo motors commonly used in robotics, retrieve readings from sensors, and play sound on a speaker.
For web developers getting started with embedded development the book introduces hardware communication protocols used in microcontrollers. It also includes color wiring diagrams for connecting inexpensive hardware components to your development board. No soldering required!
BLE is the most energy efficient way for IoT products to communicate wirelessly. It is found in electric toothbrushes, ovens, phones, lightbulbs, and more. Starting with a simple JSON device description, you'll see how to implement a heart rate monitor peripheral for ESP32 that communicates with your phone. You'll also learn how to advertise services over BLE and discover nearby BLE devices.
If you are just getting started with BLE, the book introduces key terms and concepts from the BLE standard.
This book is for professionals creating IoT products. It explains the capabilities and constraints of microcontrollers and provides a wealth of practical example code to perform common tasks.
The choice of hardware to use in a product has far reaching consequences, from the product's features and performance to its price. Many product designers, unfamiliar with just how powerful modern microcontrollers are, choose unnecessarily powerful hardware that costs more. This book shows how much can be done with hardware that costs just a few dollars. It also includes a detailed discussion about adding a cost effective display to an IoT product.
Moddable book orders are only available in the United States
Get our new book along with Moddable Two, our most popular and most powerful development board. Shipping is free!
With a Moddable Two, you'll be ready to run the examples in the book including networking, BLE, graphics, and user interface. Moddable Two includes an ESP32 microcontroller with Wi‑Fi and BLE built in, plus a high quality color IPS display with capacitive touch. The bundle also includes the Moddable Programmer for installing and debugging over USB.
You can run the examples on popular development boards including Moddable One, Moddable Two, Moddable Three, M5Stack, M5Stack Fire, M5Stack Core2, M5Atom Matrix, M5Atom Echo, M5Atom Lite, M5Stick C, ESP32 Thing, NodeMCU ESP8266, NodeMCU ESP32, and ESP32-WROVER.