Project: IR over IP

If you remember back to my post about the hellish time I had with the CCTV DVR I set up last summer, you’ll remember how eager I was to expand the functionality and climb over some of the obstacles created by the awful software that comes loaded on the boxes. In that vein, one thing I’ve been meaning to do is get one of those IR repeater things that allow you to control such appliances from a different room, usually by converting the IR signal from a remote into an RF signal, then back to IR in the desired room.

But, why buy when you can build and blog about it huh?

The DVR shipped with a cheap nasty little remote that didn’t even work when I first came to look at this project – the diode at the top was attached so badly (a dry solder joint) that I needed to exact some repairs before even getting started.

The Plan

The plan is to have a device to receive the IR signal downstairs at the TV, transport it over Ethernet to the loft space where the DVR lives, then transmit it as though the remote was being used in the loft:

The Plan

Since the house is already nicely wired for Ethernet, it seems the most sensible way of transporting the data to the loft. I could have done something fancy with 802.15 (Zigbee) but I don’t really want to tie up any of my XRF or Xbee modules on this. Continue reading

The best PHP framework is…

I’ve never been a fan of fully-fledged (“big“) frameworks like Symfony or CodeIgniter. (There, I said it!) .

I’d rather just start from somewhere comfortable where I know every class that’s in scope and I know nothing is present that I don’t absolutely need.

It seemed silly to me that the simplest web applications can be 80% framework code and 20% application-specific code (even if that’s not at all in terms of code coverage on average, just present code).  Another reason was that I love to learn.  I don’t feel like I’m learning when I’m just learning an API or the contents of some slightly pretentiously presented user manual for a framework.  Writing a framework, however?…

~ My angle ~

Looking at the things my friends use the big frameworks for; I find it strange that most of the use is to do simple things like handling the flow of the application; things we used to do with a few lines like a switch or if…elseif…endif statement.

Two years ago or thereabouts, I noticed that each time I started work on something new in PHP, I’d start by copying a load of stuff over from my last project.  I then noticed that I’d become what I hated, kind of.  Still, more recently, I decided to neaten this collection of classes up, formalise it and write some documentation that is understandable by people other than myself.

My framework, I have named simply Transcend Framework (TF  for short and in the code…) to fit in with the branding of the rest of the stuff I work on.  What does it include?  Not much.  I don’t need much.

  • MVC stuff - Model & Controller abstracts and Views implemented using a fast, simple template engine that is extensible through inheritance.
  • Extends PHP’s autoloading mechanism – just makes everything a little neater and quicker to get started.
  • A configuration & message handling mechanism to ease the debugging and testing of applications in development and the configuration of applications in production.

It’s on GitHub if you want to take a look at it, but I strongly suggest you have a bash at putting something together yourself.  It’s a great learning experience if you are just getting in to PHP.  You can get a handle on organising classes, writing good inline documentation, inheritance, interfaces and lots more.  Frameworks generally push language features to the max; so it’s definitely a good way to polish your knowledge.  Feel free to fork TF and have a play.

~ Cringey summary ~

So, the answer to my slug in the title of this post?  Your own.  I think everybody should have a toolkit of code they use a lot, keep it as a git repo, include it with submodules so it’s easy to roll out updates to all your uses of it.

Cue cringes.

 

I think a touch screen equipped Mac is on the way

In progressive versions of Mac OS X, I think things have become more and more touchy-feely.  By that I mean things are pointing towards the introduction of a touch screen-equipped Apple device, perhaps running OS X and not iOS.

While I have been disappointed by previous dumbing-downs in OS X, this is something I have wanted to see for quite a while; and now I finally think we might see one some time soon.

Recent feature introductions into OS X have all the hallmarks of working well on a touch device; not just of features that have been directly ported across from the hugely successful iPad.  I don’t know if this is just me being a complete dumbass; but I struggled for ages to find a way to dismiss persistent popups without invoking their associated action in the Notification Center, for example the App Store’s “Software Update” popups.  I recently discovered how it’s done – swipe.

This seems a little strange to me given the fact that currently no Apple-built OS X devices ship with touch screen functionality.  The “swipe” is a strange gesture to perform using a mouse – it’s more of a “click and drag” than a swipe anyway.  Granted it’s a little more reasonable on a trackpad (swiping with two fingers dismisses notifications on those); but this feature screams “touch screen” to me.  Some of us are still using a regular mouse you know, Apple?

I know it’s not conclusive, but it certainly indicates that Apple are pushing people away from the mouse and towards other input methods – perhaps even full touch screens a-la-iPad.

We shall see.

A little demo of Aperture Size

This is a short post; just something cool I made while getting to know my new camera and lens.  I thought it makes a great example of the effect of varying aperture size on the photograph.

Probably all too simple for the pros out there, but for us newbies it kinda explains quite well.

Important to note is that the focus point isn’t varied at all here – the focus is manual and is fixed on the front battery (closest to the camera).  The only thing that changes is the f number.

Need for Speed

We recently invested in broadband from Virgin Media.   Previously, we were stuck with BT and their ADSL, which, out in the sticks, tends to be quite poor.  The speeds we used to expect, or rather endure, were around 4Mbps down & 400Kbps up at their very best.  This was with all the improvements we could possibly muster – expensive shielded cabling, expensive ADSL modem/routers, no telephone extensions, short runs of cable… the works.

So we decided to opt for Virgin.  They had been spamming us for some time with offers of ridiculous speeds for prices not too much higher than we were paying BT for their “offering”.  Their installation was a little rocky – they sent the wrong kind of “team” out to start with because they thought we already had a “drop” (A coaxial cable that runs from the tap point in a cabinet a little walk down the street to a box on the front of your house).  Two weeks later they sent some guys to dig up the lawn and install the drop cable, then a week after that the original team came back to do the modem and local wiring installation.  We have had a stable, 100Mbps/10Mbps connection since.  Couldn’t be happier with that.

Speedtest

Looking at technicalities, the connection is based on DOCSIS, or more accurately, EuroDOCSIS 3.0 - The European flavour of the Data-Over-Cable Service Interface Specification.  It’s a standard that describes high speed data transmission over a regular Cable TV (CATV) HFC (Hybrid Fibre-Coaxial) infrastructure.

The router Virgin supply – the Super Hub – is effectively a rebranded Netgear specced with a EuroDOCSIS modem instead of an ADSL one.  It’s… alright… certainly not as Super as the name implies.  There are a number of bugs and it is quite restrictive in what you can do with it.  The best move by far is to place it in “Modem” mode and connect it to another more functional router.

One serious missing piece of functionality is the ability to set the DNS servers used by the router to resolve domain names.  This makes it impossible to easily deploy OpenDNS or Google DNS without use of the aforementioned Modem Mode functionality.

Bugs I have encountered include the crazy data counter that increases by about 4GB a minute under certain conditions:

This is apparently a known issue, however.

I also discovered a number of lesser Cross-Site Request Forgery vulnerabilities affecting the Super Hub Web GUI; perhaps the most serious of which pertains to sites being able to enable remote access to the router and then of course record the IP address of the visitor.  I have documented this in a video here.

These issues aside, however, Virgin have, as the annoying PlusNet man says, done us proud.  We have had practically no downtime on their end and they are offering to upgrade us to 120Mbps/12Mbps in the near future for free too.

Can’t say fairer than that.