O'Reilly logo

Mastering Internet of Things by Peter Waher

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

Choosing a connection direction

There are two basic solutions to this problem if HTTP is to be used:

  • Make the device public or reachable by interested parties. This means making the device into a web server. A sensor can return momentary values immediately as responses to GET method calls, and actuators can react directly on control state POST requests. Latency is minimized.
  • Emulate a Publish or Subscribe pattern, constantly pushing new sensor information to the server using POST requests, and at the same time polling the server, perhaps using the same POST request, for any new control actions to execute. In this case, the device is a web client, and the server is responsible for pushing the information to interested parties.

In this book, ...

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