CloudIn

Receive a feed from an Internet of Things (IoT) cloud service – Tutorial

The CloudIn widget receives data from IoT cloud services including data.sparkfun.comXively (formerly COSM & Pachube), and ThingSpeak, as well as cloud devices from spark.io. These services allow for devices, software, or people to post and receive feeds from anywhere in the world. For example a gesture sensor in Pasadena could send its values to the cloud, and video displays in London and Beijing can access the latest value of that sensor, and play different scenes based on the Pasadena sensor value.

The key thing about these services is that feeds can be posted and retrieved from anywhere, without the need to have a direct connection between the sender and receiver. The IoT cloud service handles the asynchronous reception, storage, and delivery of the feeds.

The CloudIn widget retrieves the latest feed value periodically, using an API key, channel, and dataFeed value from a public or private account on the IoT service. Set how often you want to get a feed value in the sampleRate parameter of the widget, set in seconds. For example, if sampleRate is set to 5.5, the widget will request a new value every 5 and a half seconds.

Note that these services are designed for low data rate feeds, and are not designed for real-time interactions such as using a knob to interactively turn a remote servo with fine grained responsiveness. The services have different standards for data rates:

  • Xively – has a rate limit of 25 access per minute (in their free version)
  • ThingSpeak –  has a rate limit that allows access once every 15 seconds
  • data.sparkfun.com – has a rate limit of 100 accesses every 15 minutes (once every 10 seconds)
  • Spark.io – allows a total of 1 access per second, per device.
  • Sen.se – support for this service has been removed.

On Screen Features

  • connect – Connects to the cloud service.
  • channel – Represents the device or other data source, e.g. an Arduino
  • dataFeed – A single data stream from the channel, e.g. a proximity sensor connected to the Arduino
  • in – The most recent actual feed from the dataFeed
  • refresh – The number of seconds left until the next data value is retrieved
  • out – The last data value sent to the output of the widget

Parameters

  • apiKey – The API key you’ve gotten from the cloud service. data.sparkfun.com = public key, Xively key, ThingSpeak key, spark.io = access token
  • channel – The ID of the channel you’ve set up. sparkfunPhant = unused, Xively = Environment, ThingSpeak = Channel, spark.io = device id. This represents a device, environment, virtual feed, etc.
  • cloudService – Selects the IoT cloud service to use
  • cloudUrl – If set to other than “default”, sets the URL of the cloud service (only applies to sparkfunPhant)
  • dataFeed – The ID of the specific data feed to get data from. data.sparkfun.com = data field, Xively = Datastream, ThingSpeak = Field# (should be an integer from 1 to 8 ), spark.io = port (e.g. A0)
  • invisible – If set to “true” or checked, the widget will disappear when the Flash movie is run – NOTE: you can make all the widgets invisible interactively when the Flash moving is running simply by pressing the backslash key “\”.
  • remoteHubIP – unused
  • sampleRate – The widget will retrieve a data value from the dataFeed every number of seconds specified (can be fractional)

Last modified March 22nd, 2015