O'Reilly logo

Getting Started with the Internet of Things by Cuno Pfister

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Handling Sensor Requests

Chapter 10 is an example of an HTTP server, but it doesn’t use any sensors or actuators. In this chapter, I’ll show how you can add sensor access to your server programs (Figure 11-1).

Architecture of VoltageMonitor

Figure 11-1. Architecture of VoltageMonitor

VoltageMonitor, which you’ll see later in Example 11-1, shows how to handle GET requests to a sensor resource, more specifically one that represents some voltage—e.g., a voltage produced by an attached potentiometer, photo resistor, or similar sensor. You can use any web browser as a client to inspect the current voltage. After all, a web browser is basically an engine for initiating GET ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required