In my previous post I covered why I want to modernise my Mini and in this post I want to cover some of the intended mods.  Some are simple, some are sensible and some are downright bonkers and I intend to tackle them in that order!  As I’m still driving my first car, second if you don’t count the POS I had for a few weeks, I’ve never really had mod cons other than in rentals!  A ’96 Vauxhall Corsa Merit by the name of Neville, normally aspirated 1.7D that came with a radio, not even a cassette player!  I intend to make up for this with gusto.

The original vague plan to modernise the car was to add little mod cons here and there that modern cars have like central locking, an alarm and electric windows and for ICE I figured a Bluetooth/DAB head unit would do the trick.  I’ve since decided to build a full digital dashboard, replacing the analogue instrument cluster, and designing a system that wouldn’t look out of place in a car of today.

I started with this idea back when I though implementing CAN was a good idea but I’ve since learned how much of a pain wiring looms are so sod that!  Rather than replacing the loom I’m going to integrate with the existing, replacing the control switches in the dash with solid state relays to enable computer control but maintaining the original wiring loom.  This gives the benefits of modern control but better still keeps the original design in place so I can still ask for help from Mini experts.

The basic architecture of the system will be a microcontroller board monitoring and controlling car systems in real time and a PC based interface to act as the interface.  This gives the benefit of a real time monitoring system that comes online very quickly but can hand that information to a PC which has the power to do something with it.  Speed, tachometer, temperatures and the existing instruments will all be consumed in various manners by the microcontroller, likely an Arduino, then transferred to the PC using serial.  This project will only metaphorically fly but will share learnings from an earlier project.

The Toys

Brains

The PC will very likely be one of the Intel NUC machines, with a Core i5 processor, up to 16GB RAM and HD 5000 graphics it’ll be more than fit for purpose.  Another bonus of these machines is that they have very low power requirements for the spec and can run off 12-19V, with a DC-DC PSU they are ideal.

Displays

For screens I’ve decided to go big or stay home, to that end two iPAD retina screens will be repurposed and embedded in the dash; one as the instrument cluster and another as a secondary screen in the centre for navigation and entertainment purposes.  The screens in question should be powered by the Oscar adapter, an open source controller board that is ideal for my needs as it is based on Arduino and give full control of screen brightness, with a light sensor this means I can adapt the screen brightness to ambient conditions and not be blinded while driving late at night.  Plus the resolution and pixel density is astonishing for the price and as they are designed for tablet usage the power requirements are tiny too!

Tunes

For Entertainment I’ve decided not to bother writing an MP3 player interface for it and will instead give it two main sources; Radio and an external player.  For DAB I have purchased a Monkey Board, it’s an open source DAB/FM receiver designed for hobbyists to build their own digital radios and the holy grail for Car PC enthusiasts!  For the external player I’ve a Bluetooth module which supports hands-free calling and A2DP, at a tenner it’s a no brainer.  I’m also going to have a line in socket so that anyone in the car can easily hook up and play their tunes.  A computer controlled input switch should do the trick to get the audio from these devices to the PC and from their to a 4ch car amplifier.

Grunt

Doing all this and leaving the engine as is would be daft, the car currently has it’s original 998 engine coupled to a four speed box.  On top of the stage 1 kit my friend Chris fitted I’m planning on moving up to stage 2 or 3 and replacing the gearbox with a five speed option, likely from Minispares.  Their five speed boxes have a standard ratio for gears one to four, giving the standard acceleration curve for the car, but the fifth gear is an overdrive gear and takes the stress off the engine while cruising.  They are ideally suited for the smaller engines so should be a good combo and make motorway driving a lot easier.

The Grand(er) Plan

All of the above is pretty mundane and doable, now we get to my aspirations.  Starting with a simple idea that everyone takes for granted; an auto-choke.

Autochoke

Like all old petrol cars, my Mini has a choke.  As I’ve been driving a diesel for 14 years this is a new concept to me and after researching how they work, should be easy to automate.  A choke controls the fuel/air mix into the engine to allow more fuel into the engine when you first start it to allow it to warm up, as it does so you let the choke out and allow more air into the engine.  As my setup will have a temperature sensor in the engine and as I’ve access to 3d printing kit I’m going to make an actuator that hooks into the end of the choke cable and automates this process.

Climate Control

Yup, I’ve set myself the challenge of installing not air-con but a climate control system.  This precedent has kind’ve already been set as the Japanese model Minis had aircon units as an option with a chiller unit mounted under the passenger side of the dash.  Rather than follow this model I’m intending to source a combined cooler/chiller unit, one of these to be precise.  It’ll be a tight fit but by replacing the fan switch with a relay or other driver and using a similar actuator as the autochoke for the heater cable I reckon it’s doable.  Mounting the plumbing may be tricky but as there are already Minis with aircon they have proven it can be done, I just need to figure out how.

Computer Vision

I’ve been interested in robotics since the first time I saw Transformers and computer vision technology has always intrigued me.  To that end I’m going to use Open CV along with a slew of camera to enable lane tracking along with vehicle and obstacle detection.  There are loads of examples of this already working so I’ll not be starting from scratch.  The Core i5 should now make a lot more sense!

Navigation

I work for the Satellite Applications Catapult and the biggest project I’ve worked on thus far involved making lots of interactive maps.  As such, it would be rude not to integrate satnav into the system really!  Not sure what tech I’ll be using yet but I’ve plenty of ideas and options.

Thermal Imaging/Night Vision

Yeah, why the hell not?  Modern cars have night vision as an option and KITT could see in the dark so why the hell not?  For night vision I have the simple option of a modified webcam with the IR filter removed, coupled with halogen headlights that throw out a lot of IR this should give a longer view of the road at night than my eyes can pick up.  For seeing through fog, I’m thinking a PathfindIR should do the trick.  This will be a hell of an expensive upgrade though so definitely the last item to be added, if ever!

 

That’s the plan, ambitious as all hell!  I’ll be starting with the microcontroller as knowing how fast your going and how much fuel you have left is key and then building up from there.  More details on each item as I build, and inevitably rebuild, each part!

 

I’ve been planning the restoration of my classic Mini, which goes by the name Hugo, for years now and he is finally road legal!  The only issue is that a few days after this happened the wiring loom burned out…  While waiting for the new loom to be delivered my friend Chris has been doing some work on the shell to replace a few rusty panels and I’ve been researching some of the things needed to get my dream car up and running.  Before getting into the how of the project I’d start with the what and why, to that end I figured a post on the history of the project may be in order.

I’ve wanted a Mini my as long as I can remember and decided to buy myself one for my 30th birthday, a friend of a friend had a Mini 30 for sale for a decent price and that’s that!  The initial plan was to cram a VTEC engine in there, an idea my 15 year old self had after reading of one of the first conversions in the mid 90s in MiniWorld Magazine and as look would have it I knew someone who had a VTEC for sale, which I bought.  For three years the engine and car sat in my garage gathering dust, I’d bitten off far more than I could chew.

Earlier this year I decided it was time to crap or get off the pot;  The complexity of the build was daunting, so much so I didn’t know where to start, so I hadn’t.  To that end I decided to ditch the engine swap, sticking with the original, and concentrate on getting the car on the road then seeing what happens.  The long term plan has always been to modernise the car which was part of the reason to go VTEC, so I figured I’d stick to that idea and attempt to rebuild the car as if it was designed now rather than then.  Same engine but tuned and made as reliable as possible.

There are many purists out there that will balk at what I’m intending to do, taking the Mini and tweaking it here and there, and that by modernising it I’m making something that isn’t a Mini any more.  Here’s the thing;  The Mini has been hacked since day one, it has a long history of modifications, tweaks and rebuilds and without this spirit of tweaking we wouldn’t have the Cooper, the history of rallying and hell, even the Italian Job!  The heart of the Mini would remain but modern conveniences would be introduced.

“Modern conveniences” started with central locking and electric windows; it’s since grown to include a full digital dashboard, an auto-choke of my own design and thermal imaging.  More on this and the mechanical mods planned in an upcoming post.

So, that’s the why of the project.  TLDR; Because I can.

 

I’m once more dabbling in Linux at work so figured I’d give RaspBMC another go with my new knowledge of Linux troubleshooting workarounds…

First of all I thought I’d have a play with SSH so set up a reverse tunnel to access my Pi remotely.  I followed the same steps in this article to no avail;
http://www.tunnelsup.com/raspberry-pi-phoning-home-using-a-reverse-remote-ssh-tunnel/

If I ran the script manually I could create the tunnel no problem, it just wasn’t being created automatically which was a pain.  Turns out that RaspBMC disables cron out of the box so this needed to be re-enabled;
http://www.wexoo.net/20130406/running-cron-jobs-on-raspberry-pi-in-raspbmc

Last of all I found that, as before, my Pi keeps randomly hanging requiring a reboot.  A friend of mine introduced me to the hardware watchdog on the Pi that can be used to reboot if the device goes unresponsive and so far so good;
http://raspberrypi.stackexchange.com/questions/1401/how-do-i-hard-reset-a-raspberry-pi

 

That’s all for now, the new wiring loom is going in the Mini soon though so expect more automotive posts soon!

 

Catchy title, I know…

In the big GIS project I’m working on we have a large set of data, 100 million rows+, which needs to be rendered as an overlay.  This turned out to be tricky as I’m not really a GIS developer and learning as I go. I figured it out through trial and error so I’m writing this post to help those like me, hopefully I’m using the correct keywords I was looking for so that SEO picks this up!

Our frontend architecture is as follows;

To create the tiles in Geoserver we ended up creating a parametric SQL layer, more info on that here, and we are adding it as a WMS layer.  What I discovered in the end is that to pass the viewParams through to Geoserver you need to add a layerParams option with viewParams within it, for example with start and end as SQL parameters;

layerParams: {
    viewParams: "start:'2014-01-01T00:00:00.000Z';end:'2014-01-31T00:00:00.000Z'"
}

In a WFS call the equivalent would be to append the following and one thing to note in both cases is to properly escape the characters;
VIEWPARAMS=start:'2014-01-01T00:00:00.000Z';end:'2014-01-31T00:00:00.000Z';

Hope this helps!

 

 I’ve a trusty paint of headphones I’ve had for ten years or so and used to use them when playing my electric drum kit, the long cable was particularly useful at the time but now I use them almost exclusively at my desk the cable is proving a pain in the neck.  I have a Bluetooth headphone adapter I use at the gym so figured a simple hack may be in order.

I shortened the cable, added a loop for the adapter to clip to and job done.  The end result is closed back headphones that, with an extension cable, can be used as normal and a headphone adapter I can still use at the gym.

WP_20140204_005 WP_20140204_006

Simple enough but fantastic sound quality and functionality by combining a few things I had lying around, saved my buying a new pair of wireless cans and gets more life out of kit that was underutilised.

 

Lifehacking!  Until recently I’ve spent more time blogging about it than doing it but in the last few months I’ve found a task/time tracking technique that seems to be working and today had an idea of how to adopt a complimentary method too;  Bullet Journal and Kanban.

Last year I started using Bullet Journal, which the guys at the source can explain far better than I, with a great deal of success.  I used a pocket sized Moleskine which I could take anywhere and it has helped keep track of what I’m meant to be doing long term and when.  The only irritation I found with it was that I tend to plan more than a month ahead so in my 2014 notebook I’ve written out January to December on pages 1 – 24 so my entire year is in one place and after that it follows the same idea as standard.

For my bigger projects I’ve long liked the idea of Kanban but I like to make notes and flesh out ideas in notes so using sticky notes to track the task as well as a separate notebook to track details of the task seemed a pain in the backside.  On the walk back from lunch today an idea, OneNote!

OneNote is a fantastic application, when it was initially pushed out at Microsoft it was a little bit of a pain but once coupled with FolderShare it became brilliant.  This pre-precursor to SkyDrive allowed notebooks to be sync’d across multiple machines via the internet which made the product very useful and with the later versions this is done automatically via SkyDrive.  I’ve been using OneNote for years for keeping track of ideas and research but using it as a Kanban board never occurred to me for long running tasks.  It turned out to be as simple as this;

OneNote Kanban

Create a new notebook called whatever you want, create a section for each state and a page per task.  The three in “In Progress” denotes the WIP (work in progress) limit and as a task changes state simply drag it to the relevant section, job done.  I think the two concepts will work quite well together as I can make a note on the go in my bullet journal notebook and when I get home add it to my backlog if it’s a longer term task or just do it if its a short one.  To handle the context switch between the two I’ve added a market to the bullet journal scheme which is a ‘K’, this denotes the task has been moved to my Kanban backlog and can be ignored from the perspective of the journal.

The journaling technique is working far better for me than the Master Planner or The Chain ever did insofar as I’m still using the journal six months later and as I use OneNote on a daily basis fingers crossed it’ll help too.  Time will tell!  If nothing else it’s a good place to throw all my ideas.

 

So I was working on a set of scripts to automatically commit and deploy HTML, JavaScript and CSS stuff using PowerShell however as I’ve just discovered WebStorm which does all this and allows for live preview and debugging of code I’m not going to bother anymore!

After installing it I quickly managed to configure auto-deployment to a Linux server via SFTP and live previews in Chrome.  Having spent the last few months getting to grips with JavaScript programming I have to say I’ve missed having a good IDE, live preview of code that updates on the fly really is a brilliant touch and should make things far easy moving forward as I rewrite our UI using AngularJS.

Note:- I had an issue testing my SFTP connection when I configuring the deployment location and received the following error;
“Conection to ’192.168.0.10′ failed.  Invalid descendent file name “Accept:”.”

It turns out that I’d managed to somehow create a file called “Accept:” in my home folder in Ubuntu and the WebStorm IDE doesn’t appear to deal well with filenames that contain ‘:’, at least I think that is why.  All I know is I deleted the file and was then able to connect without issue.  Hope this helps someone as it took a while to figure out this morning in my pre-caffeinated fugue.

 

I cant imagine I’m the first to do this but a simple way to emboss a Moleskine notebook is to doodle on a postit note and to draw over your design with loads of pressure. Crude but a simple trick.

My 2014 notebook still needs to be laser engraved though, a project for after Christmas at the Reading Hackspace methinks.

 

SavedPicture-201312915710.jpg

 

So I’ve been trying to get to grips with scripting for git to allow me to commit then deploy via FTP on Windows. I discovered git-ftp which looked promising but it was Linux flavoured, I followed the rabbit hole all the way to installing Cygwin and attempting to build it for Windows before realising I could just use PowerShell with Posh-Git and PSFTP (PowerShell FTP) instead. More to follow on that in the next post however though I’d share a few things I learnt about Cygwin first, no point in my learnings going to waste, this post is mostly a link dump.

Git-FTP can be found here and information regarding installing packages into Cygwin can be found at the source and there is a packpage manager, apt-cyg, that I never tried but looked useful.

A few issues I hit were that I sit behind a proxy at work so following this guide to configure Cygwin to have internet access.  The guide works for http access and if you need https access, just used this command;

export https_proxy=https://user:pass@host:port/

To access my existing git folder which sits in my Documents folder I mounted my C: drive in Cygwin then created a symbolic link;

mkdir /c
mount c: /c
cd ~
ln -s /c/Users/Username/Documents

This creates a folder named Documents in your home folder which maps to your Documents folder in your Windows user folder.  I found this in a cheat sheet on a Stanford users site, very useful so my thanks to them.

All fun learning, more info on my PowerShell solution in the next post.

 

I’m working a lot with GeoServer at the minute and needed to get a start and end date for data available in a layer, I don’t have direct access to the backend so thought I’d have a go at using PowerShell to get what I need. PowerShell 3.0 onward has ConvertFrom-Json and Invoke-WebRequest so it turned out to be rather simple;

$array = @()
$json = Invoke-WebRequest -Uri "http://192.168.0.10:8080/geoserver/thing/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Thing:other_thing&maxFeatures=50&outputFormat=json" | ConvertFrom-Json
$json.features | ForEach-Object { $array += $_.properties.time }
$array = $array | Sort-Object
Write-Host "Start: " + $array[0] + ", End: " + $array[$array.Length - 1]

This code creates an empty array, invokes a webrequest to get the JSON from the specified layer, pushes the time property from each feature into the empty array then sorts it. Outputting the first and last element in the array gives start and end.

No doubt there is a max/min function I could have used that I’m not aware of so feel free to mention it in the comments if so. It all turned out to be surprisingly easy and I should be writing a similar block of code in JavaScript soon so will post it as comparison.

 
%d bloggers like this: