Inevitable disappointment

Away from coding and informatics research, I’m a bit of a cyclopath. I like to use navigation apps and map my rides using cyclemeter on my iPhone. But even with wifi switched off, the iPhone’s battery lasts less than 4 hours. The first solution I tried was a simple external battery. But this isn’t very convenient because for a long time, my iPhone has been in a LifeProof case, and nestled on my bike’s handlebars. The Lifeproof handlebar mount doesn’t allow the case’s charge door to open to allow a charging cable to reach the phone. So I’ve needed to dismount the phone from the handlebars when charging it – not much use for navigation.

Another potential solution is a hub dynamo. Some online research suggested that the best model is the Schmidt Original Nabendynamo (SON). There are many models of SON to suit the large number of combinations of hub types and spoke numbers. (My bike has disk brakes: the disks are fixed to the wheel hubs using 6 holes – an ISO standard.) About a year ago I bought the right type of SON and got my favourite bike shop to fit it into my bike.

But there are still issues: as well as needing to be able to open the charge door, dynamos produce varying AC voltages. iPhones and other USB devices need 1V DC. SO a transformer/regulator is needed between the dynamo and iPhone.

The first transformer/regulator I tried was a USB-werk, which is a special version of the e-werk transformer The e-werk has variable output but the USB-werk supposedly just gives out USB-style power. The first one I received didn’t work at all, while the second one failed after a week. I’m relieved to hear I’m not the only one who has had problems. I’m very grateful to the supplier, Rose Bikes, for taking them back with no quibbles.

Another solution – I forget the name – I tried did give out power, but the iPhone decided this was an unauthorised device and wouldn’t charge from it.

Over the last year I’ve been unable to afford to risk losing more money on failing ‘solutions’.  I’ve been aware of the Biologic Reecharge brand for a while. They sell cases for several iPhone models but until recently didn’t sell a case for iPhone 5/5s/5c that attached to bike handle bars. (They do now.) Anyway, if I couldn’t afford kit for things I didn’t have, I certainly couldn’t afford to replace a working phone.

But thanks to being paid last month for writing some code, I’ve recently bought the Biologic kit needed to connect my phone to the handlebars and to the dynamo:

The case adds a lot of bulk to the phone. A lot of the bulk is an extra battery, so that the case can charge the phone even when it’s not connected to the dynamo:

lifeproof case and Biologic case

lifeproof case and Biologic case

naked iPhone 4 and Lifeproof case

naked iPhone 4 and Lifeproof case

So today’s tests show that the handlebar mount works, and doesn’t fall apart when cycling over Edinburgh’s rubbish road surfaces. The case will charge my iPhone 4 or another external device, whether or not connected to my mac’s USB port. (Just now the case battery is charging – it’s still flashing an amber LED to say it’s less than 50& charged.) All the cables needed to connect external USB devices and the transformer to the case are present and correct. BUT I still have no idea whether the dynamo will charge the case or a phone within the case because I can’t connect the transformer to the dynamo!

The cables that should connect the transformer to the dynamo have bare wire at their dynamo ends. The manual assumes that my dynamo has Shimano-style connectors into which I can twist these bare ends.

manual

Apparently I should also have ordered two wee connectors to connect the cables to my SON dynamo:

533485_1

 

These cost €0·95 each, but shipping will cost €8·95 on top of that! I refuse to pay shipping that’s 4 times the price of the products. I’ve not yet found a UK online source of these connectors so I’ll go and bug some electronics stores in the morning.

For now, time to sleep – and see whether the case battery is fully charged in the morning.

 

2014_02_22: almost a day off and hubris

So no project work today – instead meeting up with spinning folk to finalise details for our trip to Bolzano next month. Because some folk will be off road-cycling before we spin, I thought it might be worthwhile everyone having everyone else’s cellphone numbers. The trip is being organised though FaceBook. It’s a worthwhile tool but there’s no way I’m giving it such contact details. So I suggested I set up a secure website on my domestic web-server, an old mac laptop.

So I dragged out the code from my web-design module and copied it across, intending to hack it down to a simple DB where people could enter names and numbers and view previously entered details, then set about ensuring PHP and MySQL were running. Not much work to find and install the latest versions of PHP and MySQL that will run under MacOS 10·4. Tiny bit of work (remembering how to use nano) to hack the apache config file to enable PHP. Even found GUI tools for MySQL. All fine and funky – except the mysql_connect command fails at the first fence. I know it’s deprecated, so I try mysqlreal_connect. This version of MySQL is too old to understand that command. Over and out!

And of course the simple solution, suggested by the lead spinnerette, is that she knows everyone’s cellphone numbers and can just email them around…

HUBRIS in large lumps.

2014_02_12

Got my MSc dissertation mark today. Passed!

Code had 32 sets of ‘place markers’ – one for each LA, all basically identical except that each LA’s markers were added to a different cluster group. Nightmare to maintain – if I change one thing, I have to change it 31 more times (exactly the same change). Chances for mistakes very high.

So spent today hacking this to a routine. Not helped by wasting hours forgetting that ‘=’ sets a variable’s value, while ‘==’ gets the value. GRR!

I now have a forest of markers over Scotland.forest

Next step is to bring back the clustering.