Chapter 10. Building Connected Devices
Whether you have IoT devices, ubiquitous sensors, distributed systems, or edge computing, your device is going to connect to a wider world. It may be a closed system or the whole internet. Either way, suddenly there are many new problems and features.
While your connection mechanism is important to the design of your system, once you are connected, you’ll need to consider getting data to and from the devices, updating the code remotely, and monitoring the whole system’s health. Oh, and of course, don’t forget security.
Connecting Remotely
From your processor’s point of view, a cloud server or a host computer is just another object to talk to, the same as any other peripheral. Sure, the host might meddle with your device, such as changing your processor’s code or instructing it to move the motor to a different location. But all of those things are just digital communications.
In fact, anything that your processor has been sending bytes to over a digital interface has its own processor. The motor you’re controlling over SPI and the humidity sensor you’re reading over I2C each have their own processor. To those processors, your processor is a host computer.
Just as each of your peripherals has a documented interface, your system’s interface to its host should be reasonably well documented (even if you control both sides). Putting a documented interface in place will let the two systems change independently (as long as the interface remains ...
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