• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

How to get signal data

Status
Not open for further replies.

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
Hello

I am looking at building a realtime train signal board that shows the real time status of the signals and head codes like a opentraintimes map. What is the best/easiest way of getting this data?

Thanks
 
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

JLX5

Member
Joined
4 Jun 2020
Messages
61
Location
West Midlands
Network Rail Open Data feeds.
This is the link:

You may find it difficult because Network Rail limits the number of accounts on the system to 1000 at any one time and I believe they’re at capacity.
 

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
Network Rail Open Data feeds.
This is the link:

You may find it difficult because Network Rail limits the number of accounts on the system to 1000 at any one time and I believe they’re at capacity.
i did have an account with NR but went to log in to it today and it does not reconise my email great

== Doublepost prevention - post automatically merged: ==

If you have no luck with NR you can also use the real time trains API https://www.realtimetrains.co.uk/about/developer/pull/docs/
does RTT do signal data?
 

trainmania100

Established Member
Joined
8 Nov 2015
Messages
3,032
Location
Newhaven
I use Apache Kafka and pull data from here:

It is in an easy to parse JSON format. The hardest part for me, is designing a signal map I actually happy with.

Obviously you need to understand C class (berths and heascodes) and S class data (bits and addresses relating to SOP table which some areas network rail haven't even supplied).

One of the reasons I gave up doing my own area was because the data to actually create a proper map with routes wasn't available. There is no s class mappings for the Hastings area so while berths are possible, routes and signal aspects aren't, unless you have inside access.
 

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
I use Apache Kafka and pull data from here:

It is in an easy to parse JSON format. The hardest part for me, is designing a signal map I actually happy with.

Obviously you need to understand C class (berths and heascodes) and S class data (bits and addresses relating to SOP table which some areas network rail haven't even supplied).

One of the reasons I gave up doing my own area was because the data to actually create a proper map with routes wasn't available. There is no s class mappings for the Hastings area so while berths are possible, routes and signal aspects aren't, unless you have inside access.
thanks

is it free? that would be great
 

trainmania100

Established Member
Joined
8 Nov 2015
Messages
3,032
Location
Newhaven
thanks

is it free? that would be great
Yes it's free , it's better than the NROD platform in my opinion, I found Kafka easier to set up than the likes of STOMP etc.

Once signed up you'll be looking for Train Describer

If you do get access to the publicdatafeeds network rail site, you may as well just consider looking at Openrail (charlwoodhouse) on GitHub. https://github.com/philwieland/openrail as it is easier to get everything you need up and running.
Because just signal Td Data isn't enough, you need schedules as well to work out what a service is. You need VSTP as well because that isn't in the schedule files.
 
Last edited:

takno

Verified Rep - Traksy
Joined
9 Jul 2016
Messages
6,575
I am looking at building a realtime train signal board that shows the real time status of the signals and head codes like a opentraintimes map. What is the best/easiest way of getting this data?
Are you looking to do this to get a map for a specific area, or is it just a project you're interested in trying out?

Yes it's free , it's better than the NROD platform in my opinion, I found Kafka easier to set up than the likes of STOMP etc.
Given that I'm pushing it straight into Kafka as soon as I get it, I'd say that makes sense. STOMP is an absolute pain to deal with.
 

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
Are you looking to do this to get a map for a specific area, or is it just a project you're interested in trying out?


Given that I'm pushing it straight into Kafka as soon as I get it, I'd say that makes sense. STOMP is an absolute pain to deal with.
I want a map of Manchester Piccadilly (MAN) with the live signals and headcodes then I can make a map with a load of LEDs and a Raspberry

== Doublepost prevention - post automatically merged: ==

If you would like some historical data, send me a Direct Message. A days worth of signal data is about 600-700MB but happy to send a few days worth.

Some documentation: https://wiki.openraildata.com/index.php?title=TD
I I'm really looking for live but thank you for the offer

== Doublepost prevention - post automatically merged: ==

Yes it's free , it's better than the NROD platform in my opinion, I found Kafka easier to set up than the likes of STOMP etc.

Once signed up you'll be looking for Train Describer

If you do get access to the publicdatafeeds network rail site, you may as well just consider looking at Openrail (charlwoodhouse) on GitHub. https://github.com/philwieland/openrail as it is easier to get everything you need up and running.
Because just signal Td Data isn't enough, you need schedules as well to work out what a service is. You need VSTP as well because that isn't in the schedule files.
Registered for rail data waiting for them to approve it
 

takno

Verified Rep - Traksy
Joined
9 Jul 2016
Messages
6,575
I want a map of Manchester Piccadilly (MAN) with the live signals and headcodes then I can make a map with a load of LEDs and a Raspberry
Nice project. I suspect the hardware side would be more ambitious for me than the software side.

I'd be a bit concerned that there doesn't seem to be a route and signal aspect mapping publicly available for the MP signalling zone. It's usually possible to work them out, but it's tedious and time-consuming at the best of times, and MP is a pretty large area with lots of signals and routes.

Either way, you've got a fair bit to think through getting the feed set up and parsing the data before you get to that. Best of luck!
 

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
Nice project. I suspect the hardware side would be more ambitious for me than the software side.

I'd be a bit concerned that there doesn't seem to be a route and signal aspect mapping publicly available for the MP signalling zone. It's usually possible to work them out, but it's tedious and time-consuming at the best of times, and MP is a pretty large area with lots of signals and routes.

Either way, you've got a fair bit to think through getting the feed set up and parsing the data before you get to that. Best of luck!
Thank you I've started with the software side as I'm not as good at it as the hardware. once I've got the data I should be off
 

Rhysdabeast

Established Member
Joined
10 Apr 2020
Messages
3,337
Location
Crewe
Thank you I've started with the software side as I'm not as good at it as the hardware. once I've got the data I should be off
I did manage to work out the main signals for the MP area around a year and a half ago, I'll list them below. Decoding S-Class data is a love-hate relationship, it's a painful experience but once you figure some out it gets easier. Took me over a year to decode the Crewe Area which I've put on the Open Rail Data Wiki, I'm in the process of decoding areas M7 and M8 which are the Crewe South and Independent Lines, some of which has already been added to the Wiki. Hopefully this will save you the pain of decoding it yourself:

AddressBitFunction
527S320
532S324
533S326
534S332
535S334
541S340
543S341
545S342
547S343
551S344
553S345
555S346
304S347
306S349
310S350
312S352
314S354
316S362
320S364
322S366
324S368
326S372
330S374
332S376
334S378
336S380
340S382
344S386
351S389
352S390
356S393

Those are pretty much all of the main signals for Platforms 1-14 and some of the signals headings To/From the station, I didn't decode any of the routes but hopefully that helps you somewhat.
 
Last edited:

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
Yes it's free , it's better than the NROD platform in my opinion, I found Kafka easier to set up than the likes of STOMP etc.

Once signed up you'll be looking for Train Describer

If you do get access to the publicdatafeeds network rail site, you may as well just consider looking at Openrail (charlwoodhouse) on GitHub. https://github.com/philwieland/openrail as it is easier to get everything you need up and running.
Because just signal Td Data isn't enough, you need schedules as well to work out what a service is. You need VSTP as well because that isn't in the schedule files.
I've got an account with Rail Data Marketplace and subscribed to NWR Train Describer (TD) just trying to get the data now

== Doublepost prevention - post automatically merged: ==

Surely having some test or reference data would be helpful though?

I did manage to work out the main signals for the MP area around a year and a half ago, I'll list them below. Decoding S-Class data is a love-hate relationship, it's a painful experience but once you figure some out it gets easier. Took me over a year to decode the Crewe Area which I've put on the Open Rail Data Wiki, I'm in the process of decoding areas M7 and M8 which are the Crewe South and Independent Lines, some of which has already been added to the Wiki. Hopefully this will save you the pain of decoding it yourself:

AddressBitFunction
527S320
532S324
533S326
534S332
535S334
541S340
543S341
545S342
547S343
551S344
553S345
555S346
304S347
306S349
310S350
312S352
314S354
316S362
320S364
322S366
324S368
326S372
330S374
332S376
334S378
336S380
340S382
344S386
351S389
352S390
356S393

Those are pretty much all of the main signals for Platforms 1-14 and some of the signals headings To/From the station, I didn't decode any of the routes but hopefully that helps you somewhat.
thank you
 
Last edited:

Tom

Member
Joined
19 Jan 2008
Messages
868
Location
35,000ft
Given that I'm pushing it straight into Kafka as soon as I get it, I'd say that makes sense. STOMP is an absolute pain to deal with.
Just bear in mind that RDM adds another middle man into the process, as the data being pushed into them is being done by CACI / NROD - so you're going NR -> CACI/NROD -> RDM -> you. Just another thing to potentially break and add further SPOF into the mix.
 

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
Just bear in mind that RDM adds another middle man into the process, as the data being pushed into them is being done by CACI / NROD - so you're going NR -> CACI/NROD -> RDM -> you. Just another thing to potentially break and add further SPOF into the mix.
It's a shame I don't find it as easy as getting realtimetrain data from RTT:D

just need it to work most of the time thank you for pointing that out to me though

== Doublepost prevention - post automatically merged: ==

update I now have the code to get a live update on the signal 324

== Doublepost prevention - post automatically merged: ==

Yes it's free , it's better than the NROD platform in my opinion, I found Kafka easier to set up than the likes of STOMP etc.

Once signed up you'll be looking for Train Describer

If you do get access to the publicdatafeeds network rail site, you may as well just consider looking at Openrail (charlwoodhouse) on GitHub. https://github.com/philwieland/openrail as it is easier to get everything you need up and running.
Because just signal Td Data isn't enough, you need schedules as well to work out what a service is. You need VSTP as well because that isn't in the schedule files.
sorry to keep asking does the NWR Train Describer (TD) give the headcodes of the times and location thanks

== Doublepost prevention - post automatically merged: ==

Surely having some test or reference data would be helpful though?
on second thoughts that could help with identifying what paths they take?

thanks
 
Last edited:

Legolash2o

Member
Joined
27 Sep 2018
Messages
687
Random question but related. Can you determine certain signals if you combine signal changes with timings from the movements data?

As a train passes a tiploc, there should be a corresponding TD entry.

== Doublepost prevention - post automatically merged: ==

Surely having some test or reference data would be helpful though?
That's the reason I suggested it. I have seven years worth of TD data. It would be useful to learn which aignals are next to each other.
 

trainmania100

Established Member
Joined
8 Nov 2015
Messages
3,032
Location
Newhaven
sorry to keep asking does the NWR Train Describer (TD) give the headcodes of the times and location thanks
Sorry no it does not. To do that you will also need:
  • NRW schedule / cif timetable
  • Vstp for last minute workings
The schedule matches up to the headcode and it's all a bit of a faff if you're just looking at a small area on the network.
 
Last edited:

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
I did manage to work out the main signals for the MP area around a year and a half ago, I'll list them below. Decoding S-Class data is a love-hate relationship, it's a painful experience but once you figure some out it gets easier. Took me over a year to decode the Crewe Area which I've put on the Open Rail Data Wiki, I'm in the process of decoding areas M7 and M8 which are the Crewe South and Independent Lines, some of which has already been added to the Wiki. Hopefully this will save you the pain of decoding it yourself:

AddressBitFunction
527S320
532S324
533S326
534S332
535S334
541S340
543S341
545S342
547S343
551S344
553S345
555S346
304S347
306S349
310S350
312S352
314S354
316S362
320S364
322S366
324S368
326S372
330S374
332S376
334S378
336S380
340S382
344S386
351S389
352S390
356S393

Those are pretty much all of the main signals for Platforms 1-14 and some of the signals headings To/From the station, I didn't decode any of the routes but hopefully that helps you somewhat.
would i be right is thinking that on platforms 1-8 the berths are the signal number with A, B, C, D, for when there is more then 1 train on the platform?
 

Rhysdabeast

Established Member
Joined
10 Apr 2020
Messages
3,337
Location
Crewe
would i be right is thinking that on platforms 1-8 the berths are the signal number with A, B, C, D, for when there is more then 1 train on the platform?
Correct, e.g Platform 1 would be A350, B350, C350 and D350
 

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
just uploading some photos of where i am up to. nearly finished the hardware

drilled a bit too far through on two of the holes

not sure i've labeled all the signals correctly

I've use the track map from opentimetimes
 

Attachments

  • 20250204_173158.jpg
    20250204_173158.jpg
    936.5 KB · Views: 197
  • 20250204_173207.jpg
    20250204_173207.jpg
    1.1 MB · Views: 198
Last edited:

Trains1

Member
Joined
7 Aug 2024
Messages
148
Location
Manchester
Wow, the wiring looks so complicated! How did you find out how to do it?
I've been working on electronics for years. One thing that I do in most projects is find other bits of projects and put them together. On the other hand, I can't deny that I have used AI to help with the code and finding certain components, but the years of soldering and working with Raspberry Pis definitely helps

== Doublepost prevention - post automatically merged: ==

don't suppose any of you know of a good API to get real time freight train updates it doesn't sound like RTT does this on a API
 
Last edited:

Rhysdabeast

Established Member
Joined
10 Apr 2020
Messages
3,337
Location
Crewe
I've been working on electronics for years. One thing that I do in most projects is find other bits of projects and put them together. On the other hand, I can't deny that I have used AI to help with the code and finding certain components, but the years of soldering and working with Raspberry Pis definitely helps

== Doublepost prevention - post automatically merged: ==

don't suppose any of you know of a good API to get real time freight train updates it doesn't sound like RTT does this on a API
You could use the Train Movements feed, https://wiki.openraildata.com/index.php/Train_Movements. Depends on what you are trying to do.
 

Rhysdabeast

Established Member
Joined
10 Apr 2020
Messages
3,337
Location
Crewe
Thanks, it's so that i can find where a freight train is comeing from and to and if it's on time
The Train Movements will give you pretty much all of that info, it will send messages when a train reaches a timing point on its schedule ao you'll be able to get the Time it was scheduled, the actual Time it passed/arrived/departed that location and also the variation in minutes. What it won't tell you is the Origin and Destination, that's where it gets a bit more difficult, you'll have to have a Database set up that can store schedules (details here https://wiki.openraildata.com/index.php/SCHEDULE) and then you'll have to go through the process of matching messages by the trains TRUST ID to the schedule which can be complicated. It really is a can of worms once you delve into it.
 
Status
Not open for further replies.

Top