🗺️ Recording GPS Tracks with GPSlogger on Android for Realtime Trains 🚆

(featured image is a Class 800 test train set spotted at Paddington shortly before the launch of the Intercity 125 replacements in October 2017, operated by GWR and Virgin East Coast)

As a long time user of Realtimetrains.co.uk , and someone with an appreciation of Open Rail Data (having used it myself), I jumped at the chance of helping their development.  They’ve put out an appeal to record GPS tracks of train services that you travel on with the link to the service on the application.

A lot of the work behind the scenes performed by a small team involves maintaining data relating to train positioning and comparing this with the signalling system outputs we use. This is an entirely manual task involving one of us going out with a radio controlled watch and monitoring the passage of trains through stations and junctions. An area of recent interest for us has been attempting to compute this automatically using other known bits of information.

In order to validate this effort, we either have to do the manual task with a watch or collect a large dataset of GPS traces to compare against our dataset. The more data we have will allow us to improve the end product.

Which is awesome.  I wanted to contribute. I found a suitable app for Android called GPSlogger which seemed to fit the bill.  It has quite a few settings, so I thought I’d write a quick guide on what I’ve used to successfully generate a working track for a service.

Wanting to make sure the data I produced was as useful and error free as possible, I asked @Realtimetrains for some guidance

I have put together some settings that should help achieve these goals using GPSlogger.

One of the main things is to make sure that we are recording the data frequently – which isn’t necessarily great for battery life, so be wary of this on long journeys! 


First of all, hit the hamburger menu (stack?), and go into …

Logging Settings

Tick Log to GPX

Set New file creation to Custom file

Set the Custom file name to “%YEAR%MONTH%DAY-” – this will mean when you create your GPX files, you can append the service ID and uniquely identify the service with the ID and the date.

Tick Ask for a file name on every start, so you have the chance to put the WTT schedule UID into the filename when you start a track.

Untick Allow custom file name to change dynamically to prevent multiple files from being created (you can merge them later, but it’s an extra step that’s not really needed!)

Next, go back and navigate to ..

Performance (Timings, filters and listeners)

In Location Providers, have:

  • ✔ GPS enabled
  • ❌ Network disabled
  • ❌ Passive disabled

(this prevents your location from being sourced from the cell network or wifi/bluetooth beacons, which can throw off the accuracy)

Set the Logging interval to 0 (zero) (as frequently as possible).  You’ll need this to ensure your GPX file contains enough points!

Set Distance Filter to 0 (in order to log new points even when you are stationary), and ensure that Don’t log if I’m not moving is turned OFF (the fact you are not moving at a particular time is useful information!)

Set Accuracy Filter to 60 (so that points that are wildly inaccurate are not recorded)

Optional: You might want to tick Keep GPS on between fixes, which will increase the accuracy and frequency of the measurements (as it won’t have to wait to get a lock between each measurement).  However , it will drain your battery a lot faster when combined with the Logging interval set to 0 as above!

You’re pretty much set now…

Creating a Track

First, find your service using the Realtime trains website.  Click the More detail link, and find the WTT schedule UID (which might be something like W07729).

Go into GPSlogger – once the train is at the platform, press Start Logging. If you’ve set it up as I describe above, it’ll prompt your for a filename.  Paste the WTT schedule UID at the end of the filename – so “%YEAR%MONTH%DAY-W07729″ in our example).  This will result in a filename like 20180314-W07729.gpx , which uniquely identifies the service.

The logger will begin recording data points.  Keep your phone out with visibility of the sky to give it the best chance of getting accurate fixes.  When you reach your destination, press stop.

Now hit the share button bottom left, pick the GPX file you just created and email it with a link to the service to Realtime Trains for them to include in their dataset ! Or do whatever else you like with the file (there is integrations for various cloud storage platforms, SFTP, FTP etc).

Why I don’t want a Yahoo ID any more

I was at one time, a BT customer.  They had the best deal for FTTC broadband in my area, so it made sense to go with them.  One of the things they offered at the time was a Yahoo account – which for some inexplicable reason you were forced to link to any previous account with the same email address.

I created one – with my usual online moniker of naxxfish.  What a mistake that turned out to be….

Continue reading “Why I don’t want a Yahoo ID any more”

CanterburyMedia Site to Site Link

One of the unique challenges of CSR FM is it’s structure, where it is part funded by two separate universities each with a presence in Canterbury (University of Kent and Christ Church University) and their respective student unions (Kent Union and CCCU).  Student members could be enrolled at either institution, and as such each institution has it’s own radio studio on campus – each of which has an equal chance of being put on air. The station also invites members of the community to participate. 

This has presented a challenge, in that live audio needs to make it’s way from either studio to the transmitter, hosted at the University of  Kent in Eliot College.  From the outset of the CSR project, the route between the two has always been over IP – there was no other reasonable option.  Up until recently, that was realised using a IP Codec – with it’s packets being routed over the institution’s networks.

This is perfectly fine, and for the most part worked very well.  However, recently CSR has had a fundamental infrastructure change to it’s audio distribution (as part of the Student Media Center project), which has made every single audio source and destination available using Axia’s Livewire Audio over IP protocol over their internal network.  This allows fantastic flexibility and allowing studios to route any source to their mixing consoles, as well as increased interoperability with our automation systems and customisable GPIO control.

However, the second studio (Studio Blue) was still connected via an IP codec link, which was not integrated into the system at all and offered limited capacity for routing over the link (only a stereo pair to and from the router).  Unfortunately the link between the two sites, over the academic networks that link the universities, would not be suitable to transport Livewire (for a number of very good reasons, lack of multicast and custom QoS being one).  It was therefore necessary that we provided a Layer 2 link between the two locations to carry this traffic, which we had complete control over.

Continue reading “CanterburyMedia Site to Site Link”

Keynestock 2014

Once again, I got roped into helping out CSRfm and this time KTV in getting their OBs from Keynstock 2014 on air.

There were some not insignficant challenges. Our normal network access at Keynes was effectively cut off due to some changes to configuration.  This was quite troublesome, as we had always previously relied on this access to get our signals back to our HQ.  The outlook seemed bleak.  What we ended up doing instead, though, actually seemed to work out rather better.

Continue reading “Keynestock 2014”


I’ve been helping with the installation of a brand new Axia Livewire network at CSR FM. The network is a bit different to the usual installation – and that deserves it’s own post.  We’ve been using PathfinderPC to do all of the routing control.

It’s all pretty clever stuff – but we wanted to be able to extract information from Pathfinder so that we could do handy things like find out which studio is on air, and use that information to show the right webcam on the website, or use it to add further information to our Now Playing data.  Pathfinder has a way of doing this – using Protocol Translators.  Basically, it’s a TCP listener (or client, or Serial Port) which accepts and sends commands to a remote device.  The protocol is very well documented in the manual, and is very flexible in what it lets you do.

But, it’s a bit of a pain to connect to from, lets say, PHP – which isn’t really well suited to doing socket operations.  Also, you’d want to cache the results somehow, lest poor Pathfinder get inundated by people looking at the webcam!


So I decided to make a little thingy that sits in between Pathfinder and the potentially unruly web apps on the other end.

Thus, PFInterfaceWeb.  It exposes various data sources over HTTP – like a list of all source, destinations and current routes.  Also – and particularly usefully – memory slots!  This lets us query our Stack Event logic and work out who’s on air, what mics are live…. etc etc.

Oh, also, it optionally can send messages to a STOMP compatible Message Queue server whenever a memory slot, or route, changes, or custom Protocol Translator commands are sent.

At some point, I’ll make it monitor GPIO, and also Silence Detect events.

Hopefully, this will prove handy!