Device to Cloud, Hands-On. Part 2: Pattern Overview and Commands with HTTP

Play Device to Cloud, Hands-On. Part 2: Pattern Overview and Commands with HTTP
Sign in to queue


In this second episode of the (open-ended) device-to-cloud series, I'm talking about the four basic patterns of device information exchange and then start investigating the trickiest of these patterns, Commands, using a simple HTTP web service on the Arduino Ethernet board.

The four basic patterns are Telemetry, Inquiries, Commands, and Notifications.

  • Telemetry is the flow of information about the current or temporally aggregated state of the device or the state of its environment (e.g. readings from its sensors) from the device to some other party. The information flow is unidirectional and away from the device.
  • Inquiries are questions that the device has about the state of the outside world based on its current circumstances; an inquiry can be a singular query akin to a database lookup, but it might also ask a service to supply a steady flow of information. For instance, the aforementioned toaster will ask for the weather and get a singular response, but a vehicle might supply a set of geo-coordinates for a route and ask for continuous traffic alert updates about particular route until it arrives at the destination. Only the former of these cases is the regular request/response case that HTTP is geared towards.
  • Commands are service-initiated instructions sent to the device. Commands can tell a device to send information about its state – either as a point-in-time observation or over continuously some period – or to change the state of the device, including performing activities with effects in the physical world. That includes, for instance, sending a command from a smartphone app to unlock the doors of your vehicle, whereby the command first flows to an intermediating service and from there it's routed to the vehicle's onboard control system.
  • Notifications are one-way, service-initiated messages that inform a device or a group of devices about some environment state they're otherwise not aware of. Cities may broadcast information about air pollution alerts suggesting fossil-fueled systems to throttle CO2 output – or, more simply, a car may want to show weather or news alerts or text messages to the driver.

The Arduino device code used in the video is in this Gist

[Part 1] [-> Part3] [Part 4] [Part 5]





Download this episode

The Discussion

  • User profile image

    Only 2 parts into the series but like it already.
    I have a netduino plus 2 so I'm curious to see what's next...

  • User profile image

    This series looks very interesting - especially the use of the Arduino. Subscribed!

    (Oh and by the way - is that a flux capacitor on your t-short and is that Darth Vader having a grip-pf-death on the Apple logo? Good sense of humor Smiley )

  • User profile image

    Clemens, great series on microcontrollers!  I have a couple comments and suggestions about the topics you cover.  First, you should look at BeagleBones.  The latest, BeagleBone Black, uses a 1GHz ARM processor, 512MB DDR2 RAM, 2GB flash storage, Ethernet, HDMI, etc for $45.  As far as I know, it's the best microcomputer available today.     It is Linux based and perhaps more importantly, runs node.js.  This device screams to be connected to the Internet! 

    I haven't had time to fully explore it, but it seems that the availability of Node on a device would allow use of a wide variety of javascript libraries to overcome the security concerns you have raised.  Configuring your device with an Oauth2 library, client id, and secret to communicate over SSL would achieve a level of security that is well accepted and used on the Internet today.  Additionally, configuring the device to be a SignalR or client would allow for realtime communication. 

    I haven't watched past Part 2, but yet I'm looking forward to see what you do with Service Bus!

    If you are ever down in San Diego, we are always looking for speakers for our group:



Add Your 2 Cents