Ferrograph Display with weather and tfl (Transport for London) train data

Posted on Updated on

I got this ferrograph display as scrap about a year ago from the 3 week shelves at rLab and it gathered a lot of dust! So I started looking into testing and could see that it was functional by changing some of the headers. I then had a look on google and these displays were designed to plug into phone systems as such there wasn’t really an in.. until I saw a chap called Robert Coward had created a custom firmware.

I bought the firmware from Robert (which wasn’t cheap) but it is amazingly documented and actually brilliant.

I then hacked the input over to RS232 and plugged a Raspberry Pi into this interface.

The Pi runs a crontab every minute to download the contents of a php page which gets data about the weather and tfl.

So an evening later, I can see if the Metropolitan line is running okay and what time the 8.30 arrival is departing so I make it to the train on time.

I plan to really extend this out a lot as it is really nicely simple and very useful!

PHP code with screen output



// Weather
$json_data = file_get_contents('http://api.openweathermap.org/data/2.5/weather?id=2634451&units=metric');

$json_obj = json_decode($json_data);

// Tube
$tube_status_json_data = file_get_contents('https://api.tfl.gov.uk/line/mode/tube/status');

$tube_status_json_obj = json_decode($tube_status_json_data);

// Journey - use your own key!
$tube_journey_json_data = file_get_contents('https://api.tfl.gov.uk/Journey/JourneyResults/1000111/to/1000149?nationalSearch=False&&time=0845&timeIs=Arriving&&&&&&&&&&&&&alternativeCycle=False&alternativeWalking=True&applyHtmlMarkup=False&useMultiModalCall=False&app_id=XXX&app_key=XXX');

$tube_journey_json_obj = json_decode($tube_journey_json_data);

// Output
print "_01Z00_02A0" .
"Outside now: " . $json_obj->weather[0]->description . " " . round($json_obj->main->temp,1) . "c " . date('jS H:i') . "_0C " .
$tube_status_json_obj[6]->name . " " . $tube_status_json_obj[6]->lineStatuses[0]->statusSeverityDescription . "_0C " .
"Planner: " . $tube_journey_json_obj->journeys[0]->duration . "mins, depart " . date("H:i",strtotime($tube_journey_json_obj->journeys[0]->startDateTime)) . " arrive " . date("H:i",strtotime($tube_journey_json_obj->journeys[0]->arrivalDateTime)) .


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s