Skip to content
petervizi edited this page Sep 13, 2010 · 15 revisions

Original article at pachube.com
What you need is

  • one Arduino with some sensor
  • python-eeml

After you have uploaded your application to the Arduino, which sends measurement data via USB (for an example look at this), and installed python-eeml (sudo python setup.py install) you are ready to update your data stream on Pachube, like this:

import eeml
import serial

# parameters
API_KEY = 'YOUR PERSONAL API KEY'
API_URL = 'YOUR PERSONAL API URL, LIKE /api/1275.xml'

serial = serial.Serial('/dev/ttyUSB0', 9600)
readings = serial.readline().strip().split(' ') # the readings are separated by spaces
pac = eeml.Pachube(API_URL, API_KEY)
pac.update([eeml.Data(0, readings[0], unit=eeml.Celsius()), eeml.Data(1, readings[1], unit=eeml.RH())])
pac.put()

This library only supports manual update at the moment, however you can generate full EEML documents with it.

Clone this wiki locally