Posts Tagged ‘currentcost’

Accessing MySQL from Perl on SlugOS

Tuesday, May 27th, 2008

I’ve written about my CurrentCost meter that I’m using to monitor my home electricity usage, and the small home server that I’ve set up to collect the data.

Yesterday, I decided to make a start on collecting the data. My plan was to copy what Nick had done and create a MySQL database to store the info, with a table to store a timestamp and the watt reading from the CurrentCost meter.

CREATE TABLE currentcostdl (  
    time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,  
    power FLOAT NOT NULL,  
    primary key(time));

I started with Nick’s Python scripts, but didn’t get very far.

The server, a NSLU-2 (or “slug”) is running SlugOS.

The problem was that there is no python-mysqldb package in the SlugOS repositories. I did try downloading the source for it from sourceforge to build it myself, but struggled to get the dependencies I needed to make it – urllib in particular was a big pain.

I also tried the debian package but again dependencies on SlugOS got in the way.

So I gave up on that and decided to do it myself using Perl – Perl and MySQL had to be easier, right?

Erm… not so much 🙂

(more…)

My new home server – a NSLU-2

Wednesday, May 21st, 2008

I finished putting together my latest gadget this afternoon – a mini home server made from a Linksys NSLU-2 NAS device and a portable USB harddrive.

Why did I want it?

Do I really need an excuse? 🙂

Now I have a full, albeit small, Linux server at home, I’m sure I can think of some fun things to do with it. But as I wrote last week, the catalyst that pushed me to doing this now was wanting something to collect data from my new CurrentCost electricity meter.

It needed to be cheap, small, and low-powered – no point having a server running all the time to monitor my home’s electricity usage if it makes a significant dent in my electricity usage all by itself!

What did I buy?

A NSLU-2 – a network storage link for USB 2.0 disk drives, by Linksys. This is a small NAS device that lets you make a USB harddrive available on a network. The firmware in it comes with enough software to create a network share for any portable USB harddrives or USB flash memory key that you plug in.

It’s a neat little gadget, but what makes it special is that it is very easy to flash the firmware and replace it with a full Linux distro. Plug in your USB harddrive, and you have a Linux server with as much space as you might want.

Oh – and for some reason, people call them “slugs”.

(more…)

CurrentCost – first impressions

Thursday, May 15th, 2008

CurrentCostCurrentCost has been a bit of a buzz going round Hursley for a few weeks now.

I’ve been resisting the temptation to get involved, because I know how obsessive I get about stuff, and I’m a bit busy at the moment to take on another new obsession!

But last week, I weakened. It was all looking a bit too cool, so I figured I had to give it a go.

I’m a few weeks behind the other guys at Hursley, so I’ve not got much to add that hasn’t already been said yet. Still, I have a few readers from outside the IBM group, so thought I’d share links to posts I’ve been following about what other IBMers have been up to, and add my first impressions.

(more…)