Friday, April 11, 2014

Getting Sensor Data online with Xively

I was able to recently prove the sensors for temp and moisture (using the SHT11 & DS18B20) worked well with my RPi setup. As I mentioned in the original plan, some early research indicated that uploading the recorded data to Xively would prove useful for later public web access, and help me avoid constructing my own database for the data. 

I'd like to make the weather station data publicity available for my fellow gardeners, but do not want any dependency on the sharing of the data on the RPi itself. In my setup using PPP for my remote radio I intend to have the remote put the data to Xively via my base stations physical network connection. So far, in local testing (around the house) it is working well. Below describes how I've got it working. (Referencing the great work of other.)

I'm not going to detail the steps to get an Xively feed setup, and data posted to it. I followed others tutorials online that did a better job than I'd do. The one provided by Xively itself ended up the basis for nearly all my feeds:, and for those looking for the nitty-gritty details, I'll save you tracking down the API:, and the wrapper library itself:   AdaFruit (as always) has a good follow-along tutorial that could also be referenced:

Here are all my scripts for grabbing data, as well as the scripts for posting to Xively: Update your API and channel names accordingly if you borrow.

Pictured below and available here is my Xively Feed:  I find this Xively page helpful for general use, but for a wider audience a more refined site is needed (and in the works.)

Now that I have the data steady flowing to Xively, I'll work next on visualizing the data in a more useful way on my one site. At the moment I'm considering:, as well as this Also for quick view of current values Google Gauges, like from this tutorial:

Until my site is up, here are a few quick pointers for pulling the Xively data. They are not interactive, but do provide an alternative the Xively site proper. I was tipped off on this simple approach from this site which extensively uses this method.

Actual html:

<img src=>

Template html:

<img src=>

Example output:

For more API details (which apply to the image generation) check out:

No comments:

Post a Comment