Tuesday, November 24, 2009

Past Weather

It's been a couple of weeks since I setup a small weather station on the roof of my flat. At the time I had thought about three separate stages for getting things up and running; installing the weather station, logging the weather data to my server and displaying the data with some nice graphs and stuff.

With the station setup pulling the data off onto my server was pretty straight forward. I opted to install Open2300 to do the difficult bit and wrote a cron to run the fetch2300 script every five minutes, logging the values to a MySQL database (I decided not to use the mysql2300 script as I wanted a little more flexibility on how the data was stored).

Since then I've also setup a basic website at weather.22-11.com which shows the current weather and some graphs for past weather. At the moment graphs are calculated for the last day, week, month and year - although it'll be a while before the last two have enough data to start wrapping. I've been using the Google Chart API to create the graphs and it seems to be working well enough at the moment. I need to spend a little time tidying up the pages and making it look nicer.

It's not all been plain sailing though. I've been having some infrequent issues with the serial connection to the weather station locking up and the crons getting queued up. I think I've managed to fix the issue but there's been a couple of days where no data's been collected (hence why some of the graphs look a bit funny). I've also got an issue of where I positioned the outdoor temperature/humidity sensor. On sunny days the temperature rockets (and humidity drops) fairly substantially. There's not much protection from the sun on the top of the roof so I'm going to need to have a look at building some sort of sun shield for the sensor.

All in all the weather station's been good fun. It's nice to have a quick look before you leave the house and see how cold/wet/windy it is.

Update:
Looks like the stability issues I was having with the weather station have been worked out. I've been having an issue were open2300 didn't seem to be returning the wind speed values correctly. After looking through the memory map and trying to work out what was going on I realised that it was returning the speeds in m/s and not km/h as I thought. That's nicely sorted, but I've just accidentally deleted all my data for the past couple of weeks. I'd not gotten around to backing up the database yet either.... oops. Maybe it's for the best now that some of issues I was having have been ironed out.

Tuesday, November 10, 2009

The Weather Man

Last week I caved in after a couple of years lusting over nice graphs and bought myself a home weather station. After weighing up some of the options I settled on the Technoline WS-2350 (curiously before the start of the year I had never heard of Technoline, but now I own two of their products, the other being the awesome BC-900, I'm also loving their no nonsense product names). It was cheap, measured all the basics, could communicate with a radio connection between the base unit and sensors and has the ability to pull information from it onto a computer.

Today I set about stage one of my weather station project; setting up the weather station. The WS2350 consists of 4 main components; the base station (measuring indoor temperature, humidity and atmospheric pressure), the main sensor unit (measuring outdoor temperature and humidity), a wind direction and anemometer unit, and a rain fall unit. Setting things up is fairly straight forward with the wind and rain units plugging into the main sensor unit using RJ-11. The main sensor unit communicates with the base station using a fixed cable (which also provides power) or by radio (with the power coming from a couple of AA batteries). I opted for the radio connection as running a cable from my flat up onto the roof wouldn't be totally straight forward. Depending on how things go (signal strength, battery life) I might switch to a cable in the future.

Once I had everything set up and running indoors I got out the ladder and headed up onto the roof to checkout exactly how I could mount the instruments. Above my flat there's a shared TV aerial which provides a nice pole rising above the chimney pots. The wind unit was easy to attach using the supplied "U" bolt and the main unit easy to attach further down using some cable ties. The rain unit looks like it's designed to be fixed onto a flat surface, rather than suspended, so it required a little bit of modification. I used a clamp designed for fixing aerials onto masts and drilled a couple of holes in the side of the casing to hold the unit to the pole. Inside the flat things were a bit easier and all I required was a RJ-11 extension cable to connect the unit to my server. The base unit comes with screw holes so it was easy to hang it on the wall next to my fridge (the server lives under the freezer).

Everything is up and running fine, with the temperature outside at 6.7 degrees and dropping. All I need to do now is complete phases two and three of the project:
  • Phase Two - write a script to pull data from the base unit and store it. This should be easy as I've already done a quick proof of concept using Open 2300.
  • Phase Three - write up a website to display current weather, maximum and minimums, graphs of values over time, etc, etc. I'm planning on using the Google Charts API to create the graphs.

Thursday, November 05, 2009

Karmic Koala

With the end of October having just past a few things have happened; the clocks went back, people dressed up in silly costumes, tonight everyone will be running around setting fire to things and a new version of Ubuntu has been released - 9.10, "Karmic Koala". Back in April I posted about some of the issues which I had updating my netbook and desktop last time around. Based on lessons learned then things went a bit more smoothly.

I choose to forgo a straight update in favour of a fresh install on both machines. On the netbook I don't keep much anyway, and on the desktop I wanted to get rid of the Windows XP partition in favour of using VirtualBox. Installation on the Mini 9 was the usual complicated affair of encrypting the drive and installing the OS, then booting to a live USB image to remove the swap. The biggest issue was that the Mini 9's wi-fi no longer works out of the box. It's disappointing but not a huge inconvenience and there's an easy fix. Installation of the desktop couldn't have been more straight forward with a clean install (took no time at all) and then rsyncing backed up home directories back over - all files and settings nicely kept.

I'm still getting used to some of the UI changes but most things are looking good. On the desktop everything is fine, but I think I'm going to tweak Netbook Remix's interface a little to my liking. All in all another solid release from Canonical.

Monday, October 19, 2009

Photos

My flickr photostream gets used for everything; random photos to accompany blog posts, holidays snaps, shots of family and friends, and mixed in there, a few hidden gems. To try and highlight the "photographic" shots that I'm most proud off I've created a rehash of my 22/11 photos page - 22-11.com/photos.

I've split the page into three categories, but will probably add more later. Each category pulls out random photos at the moment, but some way to run through them all would probably be a good idea. I'd like to start taking more decent photos but I think I need to make time to specifically go out shooting. I was out in Edinburgh last weekend with a film SLR, the first time I've shot on film (and with manual focus) in ages. Hopefully I wasn't just pissing away film.

Tuesday, October 13, 2009

On bicycle inner tube valves...

For bike inner tubes there are basically two different types of values; Schrader and Presta. Things used to be simple, they used to be easy. I only every bought tubes with Schrader values. Things were so simple that I actually forgot Presta valves existed, until I asked my girlfriend to pick me up a new tube and she returned with a Presta. No trouble, I didn't specify a type of value and I have a pump which can handle both (by handle both I mean fiddle about for half an hour cursing until the thing finally gets on properly and can push in some air). Things were still fine, it was a one off and once the tube burst I could replace it with a Schrader and get back on track.

I few months ago I bought a new bike (Mongoose Amasa Super) and was a bit miffed to find that came fitted with Presta values. An inconvenience but not the end of the world. A few weeks ago I replaced the tyres with some Panracer Uff'da's, which being a little bigger than my off-road tyres meant I decided to get some new tubes - letting me get back to Schraders. However, things aren't as easy as that. Another annoying thing about Presta valves is that if they're factory fitted then the rims only have holes big enough for their skinny little stems. The effort of changing tyres was getting steadily bigger, but after a trip to B&Q for the right sized drill bit I had holes big enough for the Schraders and everything was great. I rode around for two days loving the feeling of smooth tyres on tarmac, and laughing at how little effort is required to move. I then found out that I didn't clean the rims out well enough after they were drilled and a small scrap of metal had sliced one of the tubes. Presta valves are really annoying.

I still had the orignal Presta tubes which came with my bike to use as spares and before long my valves were mis-matched and I had a Presta on the back. Don't get me wrong, I've done about 150 miles with it and there's not been an issue, but next time I change tyres or get a puncture I know it's going to annoy me (the tube's also slightly too small for the tyre so the risk of a puncture is increased). For that reason I went online and grabbed a new inner tube, 26x2.5, which my wife kindly picked up from the post office this morning. Everything should be great, except I made a mistake and bought another Presta. Damn, damn, damn, damn, damn. So after changing tubes, drilling holes and changing more tubes I'll still stuck with a Presta.

I know they have their advantages; I know they hold up better with no cap on, I know they can be deflated easier and I know that they don't let out a little hiss of air when you disconnect the pump - but they're still really annoying and not as easy to use as Schrader valves. Maybe I should just put up and shut up, or buy a better pump, but it's got to the stage where I might as well work my way through the 4 Presta tubes I now have before replacing them with a nice simple functional Schrader. How I long for that day.

Thursday, October 08, 2009

IMAP Grab

A couple of months ago I switched my email over to use Gmail as a back end, with a slightly non-standard setup. I didn't want to go down the Google Apps route so had dismissed Google at first, but I came up with something which works for me. Anyway, that's hopefully going to be the subject of another post soon.

One of the parts of a move to Google's servers which slightly worried me was the lack of a backup which I control. I'd always have most of my mail kicking around in Thunderbird at home, but I didn't want to rely on that completely. After a bit of looking around at possible IMAP backup solutions I found a handy little script called IMAP Grab, which is a wrapper for getmail. It had been written specifically for the task I was trying to achieve so fits the bill nicely. There's even a handy "-_Gmail_" directory shortcut to stop it downloading the [Gmail] directory. However, it didn't work completely as planned as it looks like it was written for an American Gmail account. No trouble, after a quick one line change I had it ignoring the UK [Google Mail] directory (and the renamed "Bin") as well.

252c252
< gmail_exceptions = ['[Gmail]', '[Gmail]/All Mail', '[Gmail]/Drafts', '[Gmail]/Sent Mail', '[Gmail]/Spam', '[Gmail]/Starred', '[Gmail]/Trash']
---
> gmail_exceptions = ['[Gmail]', '[Gmail]/All Mail', '[Gmail]/Drafts', '[Gmail]/Sent Mail', '[Gmail]/Spam', '[Gmail]/Starred', '[Gmail]/Trash', '[Google Mail]', '[Google Mail]/All Mail', '[Google Mail]/Drafts', '[Google Mail]/Sent Mail', '[Google Mail]/Spam', '[Google Mail]/Starred', '[Google Mail]/Bin']


With a cron to run every hour I now have a live backup of my Gmail account. I really don't think I'll need it, but you never know, and it only took a few minutes to setup.

Monday, September 28, 2009

Sit Down, Pedal, Pedal, Stop and Stand Up

I got back from sunny Ardnamurchan (ok, it wasn't sunny, it was raining and blowing a howling gale) last night after a great long weekend cycling around the peninsula. We headed up on Thursday afternoon to join Dave and Rosie at the cottage where they were doing a bit of DIY and tidying up (mostly just burning loads of tree cuttings). After a relaxing evening, some chicken pie and a few drinks we set off the next day for Sonachan, opting to cycle the 30 odd miles rather than drive. It was a nice but hilly and windy cycle consisting mainly of steep ups and downs, and a strong head-wind.

The reason we were headed out to Sonachan was to see Dave Gorman preform as part of his "Sit Down, Pedal, Pedal, Stop and Stand Up" tour. He's cycling from the most southerly, to the most easterly, the most westerly and the most northern points of the UK mainland; Ardnamurchan being the furthest west. Each night he's doing a gig, the Sonachan one being just 3 miles from the lighthouse at the point. We were expecting to be overtaken on the ride along by a fit Dave Gorman but we had under estimated our fitness and made quite good time along. After a great gig we camped in the field across the road from the hotel (the bunkhouse was full).

We had been debating if we should cycle back the next day and with only a little rain and the idea of a nice tailwind we decided that we would. We joined Dave Gorman and his "human sat-nav" Scott for the trip back to Acharacle (they were off to Glenfinnan). I was fully expecting them to pull away at the first hill - what with their road bikes and all - but we managed to keep the pace and enjoy some chat along the way. After a short stop for lunch at the Green Parrot tea room we split our seperate ways and headed back to the cottage. Knackered after 62 miles of (very hilly) cycling over two days we settled in with a few beers, burnt more garden waste and enjoyed a massive pasta bake for dinner.

Dave (Gorman) has got a few photos of the cycle up on his blog.