Station Departure Board for the office

So, at about 5:15 each day, about everyone who works in our office start looking for the departures from the local TFL overground station. Via the National Rail website, this information can be found, although gives you a lot of options which wont be relevant to the regular commutor

National Rail Live Departures on a PC screen. No, I don’t want to know about traintracker, or register for an account!

Via national rail, the actual information occupies probably less than half of the screen space. If you are viewing this on a mobile device its very small. If you are viewing this on any device, and suspect you are about to miss a train this is also very inconvenient!

 

National Rail Live Departures on an emulated mobile screen

When you arrive at the train station however, they seem to have got (usually) the array of information about right. Although our station has a low canopy and little platform space (for the patronage), you aren’t offered endless options on-screen for services you don’t want. Therefore:

Why cant we have a simple display in the office?

Maybe… Something like this?

Ok, so I’ve answered this question for myself already, with the live departure board I setup for my old house, however the application remains the same – How can I get live departure information displayed in a custom format?

Fortunately National Rail have already thought about this. They provide a number of ways to access their live running information, in an API nobody knows much about. Railalefan has created a class to attempt to simplify calls to the API, this is extremely useful. However doesn’t solve the issue of field keys changing dynamically, without any documentation. This makes any UI written look extremely buggy over time, with most errors occurring either at the beginning or end of the day (When there are less trains around), or when there are delays and cancellations (When additional fields appear, or disappear).

The process of identifying which fields appear and disappear has therefore been mainly trial and error, most of which was done whilst making the predecessor system to this one, which was used at home.

Adding in TFL Updates

Unfortunately, for whatever political reason (probably) the live running information at Gunnersbury seems to be a little unreliable

Next Upminster service in 1128 minutes?
Disruption between XX and YY?

So, for our departure board in the office to be any use, it also needs to show TFL’s live running information to stand any chance of showing line suspensions when DARWIN hasn’t been updated.

TFL provide a variety of information via their API, which is a little better documented here. The Line Status response which we are interested in is provided in XML, and include some useful fields which can be used in conjunction with CSS to change how the page is displayed based upon how tube lines are performing.

So the final part is to compile each of the different displays into divs, then use the  zIndex property combined with some javascript to switch round the displays based on a timed rotation.  Trying to get javascript to pause for a while, in the same way PHP can has proven to be a bit of a pain. Basically, the function doesn’t exist, so there are ample work-arounds, but the closest I found of any use was “setTimeout(Action, Delay (ms))”.

 

 

Menus but no pictures or sound on Virgin Media box

I’ve never had the joy of using a Virgin Media home setup before, but was surprised when setting up a Virgin Media TIVO box with a new TV.

Traditionally if there was a fault with your video cable, the TV simply wouldn’t show any picture, as below, however HDMI with HDCP makes this a little more complicated.

 

HDMI is a bi-directional communication protocol, and any device using High Definition Content Protection (HDCP) is required to check the suitability of the device at the far end before sending protected material. Under normal circumstances something similar to the following happens

  

Thus, with your TIVO box and TV you get pictures. Unfortunately, in my case the HDMI cable was faulty. I was a little reluctant to believe initially is was the cable which was faulty, as I could see and open menus on-screen from the TIVO box, however couldn’t get any actual television channels to play. Something similar to this was happening.

  

After reading online about other Virgin Media customers who have had similar problems, I was intrigued by people posting suggestions such as

“Turn your TV on first, then the TIVO box, and it works fine”

and

“I use a SCART lead, and it works now. Although its annoying I cant see HD pictures”

So after a little while trying to find a ‘sweet spot’ for the cable to sit, the TV flickered a little, then Eastenders came on. A little bemused, I wonder how many other people are struggling with the same issue?