Slow Lighting Event in Milan

by Ivan Vaghi on April 20th, 2009

English

We started out with a few events every couple of months and now it looks like there is something new every day. This is a video from last sunday Slow Lighting Event, a collaboration between Tinker.it, MIKAMAI, Metissage, CloudifyEdoardo Piccolotto and many many other people that turned up there.  We built interactive lamps connected to twitter and facebook via some restful API that can be used by the Arduino.

Italiano

Prima era un evento ogni paio di mesi.. ora c’e’ da fare qualcosa quasi ogni giorno. Se sopravvivviamoa questo mese sarà un successo :-)  Questo è un video dell’evento Slow Lighting di domenica scorsa, fatto in collaborazione da Tinker.itMIKAMAIMetissageCloudifyEdoardo Piccolotto e un sacco di altra gente che è venuta a trovarci.  Abbiamo costruito lampade interattive connesse ai social network tramite una API Rest scritta in ruby on rails e che permette agli Arduino che comandano le lampade di mediare informazioni social attinte in tempo reale dalla rete.

No Comments »

Connect to the internet of things with Pachubero, a Pachube wrapper for Ruby

by Ivan Vaghi on January 16th, 2009

pachubepic

Here at MIKAMAI we have been playing a lot with Arduino recently.

It’s all Massimo’s fault, really :-)

My good friend Massimo has been giving us boards and books and we have been participating and helped organizing events such as the Hack-Up and the DorkBot Milano, where we played a  lot with both Arduino and Ruby.

The next logical step was to have Arduino boards talking to each other via the internet over some kind of ruby-based routing system.  Massimo pointed out an existing system, Pachube – which people in the know pronounce pach-be, but sound much cooler as pa-chu-be.

Pachube is a platform where people can register different kinds of sensors from all over the world.  You can ask for an API Key to receive semi-realtime feeds coming from any of the sensors.  The potential for artists and interaction designers is simply amazing.

A couple of weeks ago I was in London and I met the author, Usman Haque.  Besides being an all-around cool guy with whom I share many interests, Usman infected me with the pachube virus.  You can have a lamp lightning up in Milano when your loved one gets home in London, you can monitor your energy consumption or you can get your plant to twitter you when it’s running out of water.

As I left his place I took out the laptop and I started coding from the bus.. We put together Pachubero, a very very simple ruby library to connect to Pachube and request data from the feeds.

You can get Pachubero from GitHub.

First of all you must have a pachube key.  If you don’t, you can set the key variable to :mock to use fake example data.  If you don’t have a key, write us for an invitation. I have a few of them still left.

require 'pachubero'
 
PACHUBE_KEY = :mock
 
pachube = Pachube.new PACHUBE_KEY

you can then iterate through the feeds and get their titles

[1202, 1203].each do |n|
 
  puts pachube.feed(n).title
 
end

you can also get the info of a specific feed

f = pachube.feed(1202) 
 
puts f.id
 
puts f.title
 
puts f.status
 
puts f.description

and get all the data out of it

f.data do |tag, v, min, max|
 
  puts '-----'
 
  puts tag
 
  puts v
 
  puts min
 
  puts max
 
end

data can change in time, so you can keep polling while refreshing the feed. Pachube is not allowing a refresh rate greater than 5 seconds for the time being.

6.times do
 
  f.refresh
 
  f.value[0]
 
  sleep 10
 
end

Have fun with Pachube and Pachubero and let us know how you are using it.

4 Comments »