Xively

Introduction

Publishes sensor data to Xively and subscribes to changes.

Xively (https://xively.com/) is a cloud-based service on which you can publish sensor data. Xively offers a number of libraries so you can easily develop applications to visualize and interact with the data stored on Xively.

The Xively sample application inside the SmartMesh SDK:

  • Sends the temperature data generated by each SmartMesh IP Motes running the default firmware in master mode. This allows you to see an timeline of your data at https://xively.com/, or on a Xively-enabled application you develop.
  • Subscribes to the datastreams corresponding to the LED of each SmartMesh IP Motes running the default firmware in master mode. This allows you to actuate the LED on an evaluation mote from https://xively.com/, or from a Xively-enabled application you develop.

It connects to:

  •  The SmartMesh IP Manager

Running

You can run the Xively application:

  • by double-clicking on the Windows executable at /win/ Xively.exe
  • by double-clicking on its source files at /src/ bin/Xively/Xively.py (may require additional steps on non-windows OSes)

Description

The Xively sample application connects to your SmartMesh IP Manager, and subscribes for temperature data. To be able to send that information to the Xively service, it requres you to enter a Xively Master API key.

You must first create a developer account with Xively at http://www.xively.com.

One you have created that account, log into http://www.xively.com and create a Master API key:

  • From the Web Tools dropdown, select "Settings".
  • Under the Settings section, select Master Keys.
  • Click on Add Master Key.
  • Enter a title for the key, and select all boxes, i.e. READCREATEUPDATEDELETE, and Access Private Fields.
Copy that Master key.

Make sure that you have a SmartMesh IP network running with one or more SmartMesh IP Motes running the default firmware in master mote.

To publish data to Xively:

  • Start the Xively sample application
  • Connect the Xively sample application to your SmartMesh IP Manager, either through the serialMux, or through a serial port.
  • The list of motes in your network is automatically populated
  • Enter the Xively Master API key you created in the steps above in the Xively API key box, and click set.
  • Each time a mote publishes temperature:
    • the data received counter increments
    • the published counter increments, indicating the Xively sample application is attempting to publish the data to Xively.
    • the published OK counter increments, indicating that publication was successful.

 

To see your data:
  • Log into http://www.xively.com, and navigate to Web ToolsManage.
  • A new product was created entitled "SmartMesh IP Starter Kit".
  • Clicking on that product lists the devices in your SmartMesh IP network.
  • Each device has two datastreams associated:
    • the "temperature" datastream holds the timeline of the temperature published.

    • the "led" datastream is used for actuating the mote's LED.


To actuate the mote's LED:

 

On the mote, make sure the LED_EN jumper is in place.

 

  • On a mote's device page on http://www.xively.com, click on the LED datastream.
  • This causes the LED on that board to switch on.
  • Repeat the steps above and enter 0 to switch the LED off.