David Morris – brassedoff.net

Family outings, Geographing, Linux, Java, RC boats, work…

Of rivers, locks and quays

Filed under: canal — david at 3:31 pm on Saturday, September 26, 2009

The canal trust have recently taken stewardship of an 80-year-old ex British Waterways working boat called Python.

Over a period of a few weeks, she’s been moved from London to up this next of the woods. The last stage of the move before getting to our local canal was a stretch from Torksey to West Stockwith. Torksey is where the Fossdyke canal which runs in to Lincoln joins the Trent. The Fossdyke is attributed to either Henry I or the Romans, but either way, it’s an old waterway and provides a safe stopping off point along the Trent if the tides aren’t in your favour.

It was my first trip out on to the Trent; some of the other Python crew had negotiated the tidal Trent before and we had fellow Trust member Mick Cheshire who’s a Trent veteran riding shotgun in case of mechanical or other problems with Python.

We left Torksey at around slack water (high tide) for the three hour trip, knowing the tide would be in full flow by the time we arrived at West Stockwith.

One thing I’d never realised about the Trent before (I’ve never fished it for instance) was just how much it twists its way through the countryside. It’s not the most visually attractive of rivers, servicing as it does several power stations and industrial wharves around Gainsborough. There’s a fair amount of debris kicking around as well, quite a lot getting washed down from further up stream. The building work going off around West Burton Power Stations as it’s being converted from coal fired to gas powered (just ask now where the gas reserves are coming from!)

The green and red boat in the shots below is Mick’s boat, Phoenix.

Torksey railway viaduct (disused) Littleborough on the Trent - note disused windmill Waiting for West Stockwith lock to be emptied

The ultimate challenge of the day for me was, along with Arthur, getting Python into the lock, across the tidal flow. Mick had gone in first. We had to cross the stream (”Don’t cross the streams!”) and get into an 8′ space along side Mick without losing any paint work. With Arthur on the throttle and yours truly on the tiller (and both West Stockwith virgins!), it was a tense moment, but we managed it with a great bit of teamwork. Even Mick was complementary!

Once in the lock, things were a little more controlled. Being a “big lock”, the paddles and gates are automated, but it’s deep and there’s a lot of water to flood in. It all went off according to plan though, and Python locked up to the Chesterfield Canal in one piece.

It was an excellent day!

Undocumented features

Filed under: car — david at 12:42 pm on Sunday, September 6, 2009

Undocumented features, in my line of work, are usually a euphemism for bugs in applications. Sometimes we’re lucky with them and the ‘undocumented feature’ can be useful to the end user, but generally it’s something wrong that needs to be fixed. Last night, we’d gone out to get a Chinese take-out and I’d been boxed in between a couple of parked cars in the new Mini. I put the car in first then started to roll back (I was facing uphill) to get enough room to drive out. I was a bit surprised when nothing happened. The car didn’t move. “Brick under the wheel” I thought? Funny though. The brake pedal was absolutely solid. More solid than usual.

A little warning chimed at the back of my mind. I tried again and the same happened.

Now, like many IT people (and probably many around the world), I’m not exactly the best at reading manuals when I get new toys, preferring to take a view that technology these days should be easy to use and if it isn’t, I’m not that interested in owning it.

mini

This is the replacement for the Cooper S that got stolen a few weeks ago amid piles of broken glass (stick with me – there is a link).

It’s a four month old ex-demonstrator Mini Cooper Clubman, midnight black, Chili pack, half leather carbon black interior, interior chrome lining, 17″ crown spoke alloys. The dealers also fitted the Mini standard iPod interface which interfaces direct with the fitted Boost radio for full track and playlist display.

The undocumented feature was discovered by accident last night.  Somewhere along the line I’d broken with tradition and read the manual for the car. I remembered seeing something about a hill start assist option, and it looks like that’s also on my car.

Whether I’ll actually get much use out of it is debatable . I certainly wouldn’t have paid for it new, and I would gladly have swapped it for the Xenon headlights given a choice, but I’m not going to let it detract from my enjoyment of the car. It’s agreat car and looks stunning.

Bi-xenon headlights?

Filed under: boating, canal, seth ellis — david at 8:33 pm on Sunday, August 30, 2009

I’ll freely admin I’ve become an intermittent blogger since I discovered Twitter. I’m more likely to tweet several times a day than I am to update my blog which is sad, but some things really need a blog post.

After the car got stolen recently, it was a relatively easy decision to go for another Mini. I know some will probably throw their hands up in horror, but it’s me that’s driving it…

The last Mini was an 06 Cooper S. There’s no doubting that the MCS is a cracking car, fun to drive and goes live the brown stuff off a shovel, but to my cost I’ve also found out it’s quite nickable. After much reflection, I decided that something less nickable was probably in order, so I decided to go for a S Clubman. It’s still fun to drive and being that little bit bigger (it really does have boot space!) it’s a bit more practical.

There wasn’t anything I fancied in the second-hand market so I was nearly ready to bite the bullet and go for a brand new build. Unfortunately, the lead time was two months for a new factory build. As I’ve been driving Mrs Woolforbrain’s car for the last three weeks and she woudl need it once the school holidays were over, I had to come up with an alternative solution. Fortunately, the nice people at Sytner Mini Sheffield had an ex-demonstrator, registered less than four months ago in black. It nearly met my ideal spec, but was missing the bi-xenon headlights that my previous MCS had and were on my shopping list, but did have the MFSW (multi-function steering wheel) which incorporates the cruise control and radio remote which was also on the shopping list. The car also had the sports Chili pack. The dealers kindly agreed to fit the Mini approved iPod interface kit free of charge, so we shook on it. I’m now the proud owner of a 09 plate Cooper Clubman and it’s fun again! The bi-xenon headlights would have been nice, but they’re a £420 option. The iPod interface is around £250 and will probably get used more, so we’ll put it down as a result!

I seem to be getting more and more involved with activities centred around the Canal Trust, but even so, it was a pleasant surprise to receive an email from the Chairman inviting me to become a member of Trust board with pretty much immediate effect. Needless to say, I will be accepting. It’s a great honour to be involved in such a campaign I feel so strongly about. The Trust has brought me into contact with some really nice dedicated people and has given me the opportunity to play with some great toys! After all, I get to play with a nice narrowboat taking people out on trips, and today, I’ve been talking to members of the public about the work that the Trust has put in to an 80-year-old ex British Waterway working boat. It’s great for me as well. Most of the time I spend doing volunteer work for the Trust gets me out in the fresh air which is a major departure from my day job, and I get all the positive vibes that result from being involved with a charitable organisation that does so much for the community and the environment. Plus, I get chance to put something back from an IT perspective.

NHS and car

Filed under: general — david at 11:29 am on Friday, August 14, 2009

With all the current hoo-ha about the Amerians slagging of f the NHS, I felt obliged to share this excellent blog post: http://potentialandexpectations.wordpress.com/2009/08/13/this-americans-experience-of-britains-healthcare-system/

Also, I’ve just had the insurance company on the phone. They’ll come up with a settlement within 2-3 working days based on the private sale value of my Mini. Having just had a look at Autotrader, there’s not a hell of a lot of difference between private sale and dealer sale prices which is very good news for me. I’ve just seen a lovely white Cooper S, one lady owner…

Oh the joy of it…

Filed under: family — david at 8:41 am on Saturday, August 1, 2009

Last night was not a good night. We got burgled at around 00:40 whilst we were in bed. Nothing was taken from the house except for my car keys. Of course, it didn’t stop there, and the delicate polite yoof then did away with my rather nice Mini Cooper S from off the drive. So, in the wee small hours of this morning, we were giving statements to the local constabulary and waiting for the boarding up service man to do his business. Kudos to both sets. The police were here promptly and the boarding up man did a stoking job on the rear patio door where the git gained access (picture here).

So now we’re in to reporting mode. Both insurance lots were notified last night, and there’ll no doubt be more phone calls to make this morning. Having lost several hours of sleep, we’re up and about. Dan is still fast asleep thankfully. He was worried in case the thieves came back for his Club Penguin collection which is clearly his (current) pride and joy. Needless to say, we offered all appropriate reassurances that we thought his collection was safe.

CurrentCost power graphs now online

Filed under: computer, gadgets, linux, technology — david at 8:37 am on Saturday, July 25, 2009

I’ve got my CurrentCost php graphs to a point where they’re suitable for a wider audience. The graph takes data from the mySQL database that’s holding the load data coming in from the CurrentCost sensor and display, does a little bit of massaging (all statistically acceptable!) and generates a dynamic graph.

Currently, the graphing routine is automatically scaling. I’m not sure long term whether this is the best option or not. It would probably be better to take a long term maximum and stick with that, but as the scaling rounds up to the nearest 1000 watts above the daily maximum, it should cope with all eventualities except the kettle AND the microwave AND the oven all on at the same time (and the electricity meter going in to overdrive!).

I’ve also added a tweak that allows me to go backwards and forwards a day at a time on the graph.

If you want to see the current load graph, look here. As this isn’t linked to the date or time of this blog posting, depending on when you look at it, there may not be much data on it. A better view would be to look at yesterday (which is always yesterday relative to YOUR today).

There are still a few more things needed, and a proper wrapping page would be nice, when I can get around to it. I’ve also still got the cost calculations to add in (daily cron job just after midnight and results going to another table perhaps?). Also, I’ve not yet given a lot of thought to what’s going to happen when we go into / out of daylight savings, but that’s not for a couple of months yet!

If you want the PHP that’s producing these graphs, it’s available here. (It comes with a  full Government health warning).

CurrentCost data graphing

Filed under: gadgets, linux, technology — david at 9:14 pm on Tuesday, July 21, 2009

I’ve just spent the last hour or so playing about with graphing the data from our CurrentCost data collection. It’s not brilliant – more work is definitely needed, but I can now at least see the data trends.

power trend

Mark Phelan has sent me some SQL queries to have a play about with to consolidate the data (who needs figures ever six seconds?!) and James Taylor has (quite correctly) suggested using RRDTool to graph the data. I’ll probably play about with the home-grown stuff for a while longer then give up and go over to RRDTool.

I spent the duration of my bike ride home thinking about kilowatt hours, joules and watts. More of this to come. It’s essential to work out the cost electricity from the simple watts data coming from the CurrentCost.

Hmmm…

Getting CurrentCost data into mysql on Linux

Filed under: gadgets — david at 6:10 pm on Saturday, July 18, 2009

Apologies for the non-technical readers. There. That’s that out of the way.

Before I disappeared off to Dusseldorf last week, I wrote about the ’scarey gadget’ that we’d acquired: the CurrentCostpower monitor. Whilst I was away, the data cable for this came, so I plugged it in to my openSuSE 11.1-based server for a quick play. Linux found the active cable straight away and proclaimed it to be /dev/ttyUSB0. A quick check with minicom confirmed that to be the case and we were in business.

The CurrentCost spits out an XML data chunk every six seconds with device time, watts, temperature and a few other bits and pieces in it. It’s a simple setup. You don’t need to poll the device. It’s a one-way dialog.

Thinking about the best way to get the data into a usable form, although it’s not my main area or expertise by any stretch, PERL seemed to be the answer. I wasn’t really bothered about doing a full parse job on the XML. I only wanted to pick out the temperature, watts and time (and I’ve even ended up throwing that away).

The data is getting shoved in to a mySQL database which I’ll play about with using a bit of PHP in days to come. For now though, here’s the PERL script that’s doing the work.

#!/usr/bin/perl -w

use DBI;

$dbiDSN         = "dbi:mysql:energy";
$dbiUser        = "energy";
$dbiPassword    = "password";
$dbiInsert      = "INSERT INTO energy_use (temperature,watts) values (?,?)";
$dbh = DBI->connect($dbiDSN, $dbiUser, $dbiPassword) or die $DBI::errstr;
$dbiStatement = $dbh->prepare($dbiInsert);
$device = "/dev/ttyUSB0";
$createTable = "create table energy_use (recordtime timestamp primary key, " .
                "temperature float, watts integer)";
open SENSOR, $device or die 'unable to open sensor';
while (1) {
$line = <SENSOR>;
$line =~ /<watts>(\d+)<\/watts>/;
$watts = $1;
$line =~ /<time>(\d+\:\d+\:\d+)<\/time>/;
$time = $1;
$line =~ /<tmpr>([0-9\.]+)<\/tmpr>/;
$tmpr = $1;
print "$time : $watts : $tmpr\n";
$dbiStatement->execute($tmpr, $watts);
}

Like I said, PERL isn’t my strong point, but it seemed like the correct tool for the job. I’m using the DBI handler for mysql. You can play about with the various bits to configure the script in the first few lines.

All I’ve attempted to do to parse the XML stream is grab the data in between teh relevant start and end tags. It’s not pretty and wouldn’t stand up to a scenario where several sensors were in use on different devices as supported by the CurrentCost, but it’s a start.

The living proof of the thing working can be seen in the database:

mysql> select * from energy_use;
+---------------------+-------------+-------+
| recordtime          | temperature | watts |
+---------------------+-------------+-------+
| 2009-07-18 17:44:38 |        22.8 |  1786 |
| 2009-07-18 17:44:44 |        22.8 |   591 |
| 2009-07-18 17:44:50 |        22.8 |   591 |
| 2009-07-18 17:45:02 |        22.8 |  1886 |
| 2009-07-18 17:45:08 |        22.8 |  1846 |
| 2009-07-18 17:45:14 |        22.8 |  1802 |
| 2009-07-18 17:45:20 |        22.8 |   591 |
| 2009-07-18 17:45:26 |        22.8 |  1496 |
| 2009-07-18 17:45:32 |        22.8 |  1762 |
+---------------------+-------------+-------+

Obviously, this is going to collect a lot of data, so a cron job to purge out old data would also be appropriate at some point. As you can see, I’ve thrown away the time from the CurrentCost data in favour of a mySQL timestamp which seemed more logical and less code because I’d still have needed to get a date from somewhere…

Scarey gadgets: CurrentCost

Filed under: computer, gadgets — david at 2:44 pm on Tuesday, July 14, 2009

It’s official. I have in the house now the scariest gadget imaginable for something of a gadget freak. It’s this little gem – a CurrentCost CC128.

It tells us how much electrickery we’re using and worse, how much it costs. So far, we’ve knocked about £10/month off the bill by being a bit more careful about what we leave switched on. £10/month payback on a £40 investment. That’s a bit of a no-brainer.

There’s more though. This gadget as a serial interface. And there’s a USB serial cable available for it. And it squirts data out in XML format.

There are already several people writing open source software for it, and when I get back from my latest business trip, guess what I’m going to be doing?!

I sense a little bit of Java or PERL as a daemon process, a mySQL table or two and a bit of PHP on the horizon.

For the record, the device has a little battery-powered sensor that clamps around the output from the domestic meter and communicates with the base station using 433MHz wireless. The base station itself is mains powered, estimated at a couple of pence per week to run and in ideal circumstances will pick up up to 30m away from the sensor.

I can’t wait.

Just how sustainable is this?

Filed under: computer, technology — david at 10:07 am on Thursday, July 2, 2009

No, it’s not a green or environmental post. It’s a techie post. I’ve been exchanging tweets recently with my ISP over their record bandwidth usage lately. The cause of these records? Tennis. Well, indirectly, tennis. In actual fact, BBC iPlayer. The Murray quarter final match yesterday afternoon accounted for a massize 25% of Plusnet’s bandwidth at something like 1.8Gb/s. It’s probably a good job they brought another 155Mb pipe on recently.

There’s a lot of discussion going off in the press at the moment about who should pay. Some advocate pushing charges back to the content provider, but they’re arguing that they’ve paid their whack in getting their server farm connected to the Internet in the first place with the necessary high capacity pipes.

As we look more to Internet delivered services, this argument is going to rumble on and on and users like thee ‘n’ me are going to want to make sure we’re using an ISP that can make the necessary investments in bandwidth to ensure consistent delivery of service. The situation is only going to get worse. Virgin will sell you a 50Mb fibre connection to home. Plusnet and others are trialling or have already rolled out ADSL2+ with up to 20Mb on copper.

Is, therefore, the current charging model the right one moving forward? Commentators more skilled than me will probably be having that argument for years to come. In the meantime, I’ll be catching up with TopGear from the weekend tonight on iPlayer and I hope there’s no tennis on to pinch the bandwidth!

« Previous PageNext Page »