Rick Hurst Web Developer in Bristol, UK

Menu

Blog

Rasberry Pi as low power office server

raspberry pi running as low power office server

Part of a system that I look after for a small distribution company includes a linux server based in their offices. The server doesn’t do much – it runs a few cron jobs and a mySQL database, acting as a monitoring system on the internal network and as a middle-man receiving data extracted from Sage Line 50 database on a windows server and posting off data updates to a web-based server. It is however a vital part of the system, and needs to be running 24/7. For years this has been handled by an assortment of dusty old desktop PC’s, the last of which was starting to show signs of needing to be retired. The next old PC in line turned out to have a faulty network port, so I though it might be time to buy some kit specifically for this job. It occured to me that due to the low power requirements, a Rasberry Pi might be ideal.

Being fairly new to the Rasberry Pi, I ordered a starter kit including a Model B Pi, a 4GB SD card with “noobs” installed on it, a case and a power supply. Connected up to the TV at home via an HDMI cable, it booted into noobs, from where I installed raspbian linux. Once raspbian was installed, I found that I could install everything I needed (mysql, PHP5, apache) using apt much as I would on a regular debian-based linux box. One thing that I found I couldn’t do (from googling rather than actually trying) was install dropbox, however this wasn’t essential.

After installing it in the office and monitoring it for a few days, it seems to be coping extremely well. There is one particular php/mysql task that sends the cpu temporarily very high, but I think this can be tamed with a bit of code optimisation. I also wish I had started with a bigger SD card, as there is only just enough “disk” space when everything is installed.

One advantage of this low-power system is that I have it running from a USB cable plugged into another server rather then requiring another port on the office UPS. I’ve considered having it run from a rechargeable USB power pack, kind of like a mini dedicated UPS. I’ll be interested to see how it stands up to this kind of use. Due to the low cost of this system, the plan is to have a spare Rasberry Pi or two and some spare cloned SD cards on standby.

One other thing to note is that to plug the Pi into a monitor you may need an HDMI to DVI cable, unless you have a monitor with an HDMI port, or some HDMI or RCA to VGA solution (that will be another blog post). I only needed to plug it into a monitor to congure the static IP address – after that I ssh’ed into it from another machine.

So why didn’t I just use a virtual machine? A couple of reasons: firstly, one of the tasks for this machine is to monitor the windows server from which the sage line 50 data is sent. Secondly, the aforementioned windows server is the only machine on the network running 24/7 and already struggles a fair amount, and I didn’t want to hog any more RAM or cpu with a virtual machine.

Update 2014-01-22: The Pi has been up and running for nearly a week with no issues, but i’ve been reading about SD card wear that can occur if the disc is being written to frequently, so I plan to move the MySql and log file storage to an external drive, otherwise I suspect the card might “wear out” fairly quickly.

2CV Campervan

Acacdiane Oasi campervan

After I had to let my first T25 go, I bought a Citroën 2CV. The 2CV, due to it’s incredibly simple mechanics, bulletproof 2 cylinder aircooled engine and surprising off-road ability, makes a fantastic overland vehicle. I had grand plans of travelling Europe in mine, but unfortunately it caught fire one day on the way to Weston Supermare, and burned to a shell. Fires are a common problem with 2cv’s – the foil/ cardboard tubes used to transfer warm air from engine cowlings to the cab can sag onto the engine and eventually catch fire.

Apart from the obvious limitations on size, the van version, the fourgonette, or the Acadiane (based on the Dyane) can be used as a small one or two berth camper, by means of a platform across the rear wheel arches extending into the cab area. This wouldn’t do for us right now – as a family we need something at least as big as a T25, but i’m still fascinated by the idea of such a simple, small, agile camper.

I found this fantastic old promotioal video of an Acadiane based camper – there’s some ingenious use of interior units to provide storage, seating, table and a sleeping platform.

Heating a campervan for winter camping (and day trips).

Propex compact 1600 installed in a T3

Rocky has sat parked up near our house pretty neglected since the summer, but now my thoughts are turning to winter camping and day trips. Last winter we did a few overnighters, using a combination of an electric fan heater (noisy, but effective), duvets and hot water bottles to keep ourselves cozy. I’ve also been told that an electric oil-filled radiator is a good solution for heating a campervan, as it is safe and silent, so can be left on overnight, unlike the fan heater.

Of course electric heaters require mains hook-up, and this isn’t always available, so many people have blown-air heaters installed – either an eberspacher, which runs on diesel, or a propex which runs on gas. Both these types of heater are expensive bits of kit, but luckily Rocky came fitted with an old propex, which I sent off to be inspected to check if it is safe to use.

The advantage of the propex heater is that it ventilates to the outdoors – ours is fitted under the rear seat with two holes through the floor attached to a couple of lengths of pipe under the van to provide air intake and exhaust for the part of the heater where the flame occurs. This makes it quite safe, though we have a carbon monoxide detector in the van anyway just in case. The other safety issue to watch out for is to make sure the heater isn’t buried under anything flammable – i’ve removed everything from under the seat except my jack now.

I’m writing this on a crisp November morning sat in Rocky parked up near our house, testing out the propex heater that I re-fitted last week. When I first tried it, I couldn’t get it to light. I’d read about how butane “freezes” below a certain temperature – the truth is, it doesn’t actually freeze, but the liquid just gets too cold to boil, and therefore it doesn’t produce any gas below about 4 degrees centigrade. I confirmed this by trying to light the cooker, which also didn’t work. The potential solution is to buy a propane cyclinder instead, which would need a different regulator. I’m reluctant to do this as it means buying and carrying more stuff around, that might rarely get used, and I like the fact that the second bottle of butane used for the heating is a backup for the one running the cooker and fridge. The blue camping gaz butane bottles that I use seem to be available virtually everywhere in the UK and on the continent too – less so for propane I think.

The solution today (I just wanted to check it’s all working, safe etc. before we go and try it for real) was to run an extension cable out to the van and gently warm the gas cyclinder with the electric fan heater that we use on electric hook-up. After about five minutes I tried the propex heater and it worked fine. Of course if we have electric hookup available, we’d probably just use the fan heater instead of burning up our gas supplies and running down the leisure battery. I guess one possible solution if we didn’t have electric available is to use a small portable gas heater (which run on a canister of butane/propane mix, which will hopefully still be working) to warm up the gas cylinders – yep, I know what you are thinking, possibly a bit dangerous! The portable gas heaters shouldn’t be used without ventilation and can be a fire hazard. Another (untested) possibility is that maybe you could use a small butane/propane mix stove to boil some water for hot water bottles to warm the gas bottles. I’ve read somewhere that another solution would be to stand the gas bottle in a washing up bowl full of warm water.

So my thoughts turned to insulating the bottles, but I read somewhere that one problem with this is that the bottle actually cools down as it produces gas, so having it insulated while it is being used will possibly lead to it cooling itself back down below operating temperature! In summary it is worth insulating it to stop it getting cold overnight, but then remove the insulation when you start using it. The more I read, the more I think maybe I should just bite the bullet and buy a propane cylinder..

I’ve actually removed the thermostat for the propex heater and wired it into a switch instead. The reason for this is that I couldn’t get it to work with the thermostat – the heater just squealed! The propex engineer I spoke to suggested that this may be due to a faulty relay, and that I could try to run it directly from a 12 volt source by removing the plug and joining the orange and red wires together and attaching to a 12 volt supply. This seems to work fine.

Managing Google App Engine SDK versions on OSX with virtualenv

When I first started developing Django apps on Google App Engine (GAE), I downloaded the google app engine launcher. Installing this will install the latest version of the SDK, and will (if you let it) update your path to point to it. This is fine if you are always using the latest version and don’t need to use an older version for some reason. If that is the case you will need to uninstall GAE launcher, find an old installer for the version you want and reinstall.

A more manageable way is to not use the GAE launcher, but to download the SDK manually, then set up a virtualenv to use a particular SDK. I also use virtualenvwrapper to help me switch easily between environments.

This is the pertinent bit – in the folder where your virtual envs are stored, add the path to the app engine sdk in bin/postactivate. Postactivate gets run when you activate the virualenv through virtualenvwrapper. E.g for something using version 1.8.8 you might have something like:-


#!/bin/bash
# This hook is run after this virtualenv is activated.
export PATH=/Users/rickhurst/gae-sdk/1.8.8/google_appengine:$PATH

Catching up – Summer 2013

Rocky the T25 being towed

Ok after a productive start to the blog this year, i’ve failed to post since the start of the summer. I’m going to blame it mostly on my camper van, both literally spending time working on it and camping in it with my family, and also generally all my blogging effort has gone into my “camper van things” blog. I’ve had a fantastic summer, worked less than I probably should have, but now getting back to work (and saving up for some more summer adventures next year!).

So to catch up – i’m now freelancing more or less full-time back at Potato, working on some interesting stuff, notably cutting my teeth with AngularJs framework, which i’ve enjoyed so far. My initial observations are that it is significantly different to Backbone/Marionette that there is no confusion over what technology i’m using, it allows you to be productive very quickly and that it litters your markup with non-standard attributes. The latter may upset purists, but otherwise it gets the thumbs up from me. If you’re interested in learning AngularJs, a good place to start would be the tutorial.

Owning a T25 – 12 months on

Rocky the T25 parked up near Saumur, France

It’s nearly a year since we picked up our VW T25 camper. In that time, we’ve:-

  • Driven it 4768 miles
  • Taken it on 2 ferries
  • Taken it to 3 VW events
  • Slept in it for 35 nights
  • Had the 1.6 diesel engine replaced with a 1.9 diesel
  • Called for breakdown service twice (starter motor problem in East Anglia and fuel line problem in France)
  • Drunk 200 cups of tea in it (estimated!)
  • Sorted out rust patches/paintwork, much of which now needs redoing, as i’m a bit of an amateur with this type of thing
  • Painted the wheels
  • Got some winter tyres and spare wheels
  • Had the windows tinted
  • Fitted a swivel seat base in the passenger side
  • Had an immobiliser fitted
  • Fitted a bike rack
  • Got it through an MOT

I’ve also spent an unhealthy amount of time on the T25/T3 forums and Facebook groups enjoying reading about what adventures other people have been having with their vans and what they’ve been doing to them. One thing that is clear is that it is possible to spend a massive amount of cash improving a T25, from professional bodywork restorations, suspension mods and massive alloy wheels to powerful subaru or tdi engine replacements.

Personally I’ve decided that I need to rein things in, and concentrate just on keeping our bus roadworthy and ready for more adventures. I have a list of things that need sorting before I would be happy to take Rocky on another overseas trip. The fuel lines and the fuel tank breathers need sorting out, but also it looks like I need to consider an engine rebuild or another engine swap, as the 1.9 engine I had put in, although it runs brilliantly, is using an unsustainable amount of oil. The consensus seems to be that it is burning oil (basically using it as fuel) due to worn piston rings and/or bores.

I was hoping to get at least a couple of years out of this engine, but it hasn’t turned out that way. If I had the tools, skills and space to attempt an engine swap myself, I might have been tempted to try my luck with another old engine, but I really think its time to look at having the current engine dismantled, inspected and reconditioned/ remanufactured as needed which would hopefully add many more years life to it. Tempting as it is to save up for a Tdi conversion which (along with an appropriately geared gearbox) would make the van faster and more suited to motorway driving, i’ll settle for a reliable simple engine to plod along with in the slow lane, and put the cash saved towards more road trips.

However, our other “ongoing project” is a Victorian house, and the bus has diverted cash and attention away from the house over the last year, and this needs to be rectified. I’ll need to redo some of the aforementioned bodywork before the winter sets in, but other than that I’ll have to ignore him for a while, and concentrate on the house instead.

One thing i’m sure of though, is that despite the ongoing costs, we have had a lot of fun with this bus, and are really glad we bought it. Still looking forward to many adventures to come!

European holiday road trip 2013

Rocky the T25 parked up at a campsite in La Romieu

At the end of July, we headed off in an unprecedented UK heatwave to Portsmouth to catch a ferry to Santander in the north of Spain. Despite the cost of the ferry, we decided that for Rocky’s maiden continental Europe voyage (under our ownership), we should get closer to our first destination under boat power, to ensure that if we got stuck, we’d get stuck in the north of Spain or south of France, rather than a few miles south of Calais.

I couldn’t help think back to the last time I caught a ferry to Spain in my old T25 – the van refused to start when the ferry started boarding, so people had to drive round me for a few minutes until it finally started and managed to get on board. No such problems this time, although I was one of the annoying people sat in the queue with the engine running way before I needed to start – partly because I have to go through the “disarm the immobiliser” + “wait for the glow plugs” routine very time I start so there is a good ten seconds between deciding to start the engine and actually starting it, which seems much longer when people are waiting behind!

The Santander ferry worked out really well – a 24-hour relaxing trip, in glorious sunny weather on calm seas, the holiday was truly started. After arriving, we took the short drive to our first campsite, at Cabo del Mayor above Santander. I had emailed the campsite trying to book a pitch, but they don’t take reservations for short bookings, so we took our chances and just turned up. Luckily they had space (though very tiny pitches compared to most french sites) so we parked up, opened some wine and relaxed.

If we had more time I would have liked to spend more time in Santander and the north of Spain, but we didn’t have that luxury, so after breakfast the next day, a coffee and stroll around the lighthouse at Cabo del Mayor, we started heading in the direction of France and found space at Camping Igueldo, high up in the hills above above Donostia San Sebastian. That night we sat and watched out of the van windows as our sun canopy buckled under the weight of water and ice thrown down by a massive thunderstorm. Luckily the canopy detached itself from the van before anything broke, and it all dried out in a couple of hours the next morning.

Heading off in the morning we experienced our first mechanical issue – Rocky suddenly lost power while heading through San Sebastian, and we found ourselves limping along at 20mph leaving a cloud of white smoke. so we pulled over at a bus stop, where he conked out. After reluctantly restarting, the engine seemed to be ok again, so we tried moving on, but after a couple of minutes the same thing happened again, this time while sat on a bridge over a railway. The inevitable despair set in – the thought of having to make the breakdown call, the thought that the engine would be in pieces, the thought that the van would be towed away leaving us stranded with nowhere to stay. As the camper was fully loaded including three bikes on the bike rack, it was going to take a good 20 minutes to get to the engine hatch to see if there was anything obviously wrong, so we decided to make one last push to try to get ourselves somewhere safer. We started the van again and limped through a short tunnel with no hard shoulder.

The engine seemed to be running fairly well again, so we made it through the tunnel and a couple of miles up the road before reaching a petrol station with car park, so we pulled over and decided what to do. The engine was running again, it wasn’t overheating, it wasn’t making any strange noises, no smoke, no oil or coolant puddles underneath, and there was nothing unusual hanging down from the engine from what I could see from underneath, so after a cup of tea we decided to wing it and carry on. A couple of hours later, after cruising at motorway speed faultlessly for about 100 miles, we pulled into our next campsite “Camping La Jaougotte” in a pine forest near Vielle-Saint-Girons, in the Aquitaine region of France. We put the power loss down as an “intermittent” fault, maybe caused by dirty fuel or a blockage of some kind.

Driving around the local area a couple of days later, on one of several trips to the beach and lake, the power loss happened again and this time the problem didn’t go away. Trying to diagnose the problem myself and with the help of a dutch T3 syncro-owning campsite neighbour, we spotted a tiny split in the fuel hose near the fuel pump. A gaffer-tape DIY fix looked promising, but didn’t stop the problem – possibly because it wasn’t a good seal or possibly because there was already too much air in the pipe. If i’d known at that point that the split was definitely the cause of the problem (it was) I would have persisted, and tried to bleed the air out of the system, but at that point I was stumped.

Eventually, a day later I swallowed my pride and made the breakdown call. A few hours later a man turned up with a truck and (after some half-hearted wiggling of spade connectors) towed Rocky away to a local garage. We decided to go to the campsite bar to commiserate. That’s when we spotted the warning that a heavy thunderstorm was forecast for that evening. Knowing that the van was very unlikely to return that night we started preparing to spend the night in our tent. We generally take the tent to use as a kind of shed – somewhere to store all the stuff we don’t want to keep in the van. Although we own a groundsheet and bedroom inner for it, they weren’t with us. It was quite depressing to think that we would have to squeeze ourselves and belongings into this tent and sit out a thunderstorm, potentially with water coming in from underneath. Luckily, our syncro-owning campsite neighbours bailed us out by loaning us a spare two person tent, so at least Jo and our kid would sleep in the dry!

We survived the night, and the thunderstorm, and the next morning was fairly depressing, because we had no means of boiling the kettle, and we were also contemplating what would happen if the garage decided that they couldn’t fix the problem. Our breakdown cover would in theory give us a hire car, so we could drive to a decathlon and pick up some camping gear and carry on our trip, but we already had too much stuff (bikes, camping tables, the mattresses from the camper etc.) to fit in a normal car, which could be problematic.

There was also paranoia over an issue many vintage camper van owners have faced when the vehicle can’t be fixed and the breakdown insurance company decide to ship the vehicle back to the UK – someone in an office somewhere will look up the “market price” of a stock 30 year old van in a database and decide it isn’t worth enough to have it repatriated back to the UK, even if you have proof of agreed value. They then offer to scrap it for you! Thankfully a few phone calls later (via 3rd parties, my french is nowhere near good enough to deal with this kind of thing), we established that the van was fixed and waiting for us to pick up, so luckily I never got to find out what would happen in the worst case scenario.

The garage had replaced a short section of fuel line next to fuel pump, and bled the system. A nervous test drive or two later, the problem didn’t show its head again, so we moved on the next day. A lot of worry over a very simple problem, and a very simple fix. I do however plan to have all the fuel lines replaced in the near future, following some wise advice given to me on the club 80 90 forum – if part of the fuel line failed, the rest can’t be far behind. I also need to address the related issue where the fuel tank overflows if you fill it all the way to the top.

We then spent a relaxing week or so at a campsite in the village of La Romieu, in the Gers region, chilling out, swimming, sunbathing and catching up with friends before eventually deciding we need to start moving north. We headed all the way up to Saumur in the Loire valley in one go – a long motorway trip, stopping only once to top up the oil (more on that later). We spent a few days at Camping Chantepie, before deciding that we would head to a site near Roscoff in Brittany for a couple of nights before catching the Roscoff to Plymouth ferry. We found Camping des Abers near Landeda, right on a beautiful beach.

After the uneventful crossing from Roscoff to Plymouth we headed back up to Bristol with no issues. Apart from the obligatory traffic jam two junctions before Bristol adding on an extra couple of hours..

One thing that became apparent on this trip is that the 1Y engine we had fitted earlier this year is using (or losing) far too much oil – on motorways it gets through nearly a litre over a hundred miles. I need to address this before I would do another long trip, whether that means a repair (new piston rings?), getting the engine reconditioned or even remanufactured (making it like new, but costly) or another engine swap. Luckily the van is still perfectly useable in the meantime, i’m happy to use it for shorter trips, as long as I keep topping up the oil, so there is no massive hurry.

Apart from the engine issues, if I was doing the trip again, i’d definitely take more camping gear for “emergencies” – the inner compartment/ groundsheet for the quechua base, a second tent and a portable stove, as insurance against the van being taken away again – hopefully something i’ll not need!