---- SNAP Connect Pachube updater ----

- - - - - BEGIN DISCLAIMER - - - -

NOTE - This example was tested against https://pachube.com on 02/16/2012.
Pachube may change their servers and/or API at any time, which may invalidate this demo.
This demo is provided AS-IS, Synapse Wireless will not support it.

- - - - - END DISCLAIMER - - - -

This example demonstrates a simple, flexible way to use a SNAP Connect application to push
data from remote SNAP devices to a RESTful cloud-based service.  In this instance we are
using Pachube (https://pachube.com) which offers basic storage, retrieval, and presentation
of "datapoints".  The collection of datapoints associated with a remote device is referred
to as a "datastream".  To run this example, you will need to signup for the free Pachube
service at the above website.  When you do, you will be able to create "feeds", which have
a feed_id. You will also be able to create "Secure Sharing Keys" ("keys"), which are used
to enable access to those feeds.

The "key" you get has to be edited into pachSnapE10.py (look for '**** your key here ****')

The "feed_id" and "stream_id" have to go into your SNAP node scripts.

In this example, a SNAP Connect client (Synapse E10, or a PC if you prefer) will update
your Pachube feed on behalf of any number of remote SNAP wireless devices.  The wireless SNAP
nodes broadcast an RPC function 'update_stream' to add datapoints to a named stream. Just calling
this function will create a new stream with the given name.

Example remote script snippet:
    ...
    value = readAdc(0)    
    feedID = '12345'
    streamID = "BeerFridge"
    mcastRpc(1, 2, 'update_stream', feedID, streamID, value, 'ntcTempF')
    
The datastreams created by your remote SNAP devices will be associated with your unique "feed",
which you can view graphically at the Pachube website.

SNAPpy script pachube_test1.py is one example of a remote sensor script.
Look inside this script for more details.
