Welcome to Microsoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet> open datafeeds.networkrail.co.uk 61618
Connecting To datafeeds.networkrail.co.uk...Could not open connection to the hos
t, on port 61618: Connect failed
Microsoft Telnet>
--- old post above --- --- new post below ---
I'm just not able to establish a connection at all
I can't IM at work but here's my email <email address removed - Mike395>
I haven't done much with the TD data yet, as I don't have a list of the berth steps yet, but I have been using the train Movement data, and there seem to be a lot of messages missing from this.
For example there are no messages being reported from Scotland, and messages from the rest of the country seem to be sporadic.
Are you subscribed to the all-TOC movement feed? How do you identify whether you've lost messages or not? Are you expecting every train to report at every station?
There are some stations that never get a report at all. Looking at the NRE live departure boards they always show "no report" there too which suggests that some stations simply lack a working monitoring point.
Well you should get a report for all the timing points and station stops shown in the schedule for that train, I would expect. If not then something is wrong. Have you correlated the reported movements against the expected reporting points in the relevant schedule? (You can check this somewhere like www.opentraintimes.com if you haven't developed your own schedule data parser yet.)
From scanning the text file, I didnt see a single result for anywhere in Scotland, no reports from Edinburgh, Glasgow, Aberdeen etc, or even Carlisle. Oxenholme however did appear - nothing north of this though.
It would be great if someone else could subscribe to the ALL data feed and look out for some reports from trains in Scotland, this will then confirm if it is my dodgy code at fault.
publishing to TRAIN_MVT_ALL_TOC
{
"body": {
"actual_timestamp": "1342283100000",
"auto_expected": "true",
"correction_ind": "false",
"current_train_id": "",
"delay_monitoring_point": "false",
"direction_ind": "DOWN",
"division_code": "60",
"event_source": "AUTOMATIC",
"event_type": "DEPARTURE",
"gbtt_timestamp": "",
"line_ind": "",
"loc_stanox": "07246",
"next_report_run_time": "2",
"next_report_stanox": "07257",
"offroute_ind": "false",
"original_loc_stanox": "",
"original_loc_timestamp": "",
"planned_event_type": "DEPARTURE",
"planned_timestamp": "1342283160000",
"platform": "",
"reporting_stanox": "00000",
"route": "2",
"timetable_variation": "1",
"toc_id": "60",
"train_file_address": null,
"train_id": "072G60MR14",
"train_service_code": "13569815",
"train_terminated": "false",
"variation_status": "EARLY"
},
"header": {
"msg_queue_timestamp": "1342279529000",
"msg_type": "0003",
"original_data_source": "SMART",
"source_dev_id": "",
"source_system_id": "TRUST",
"user_id": ""
}
}
Then you must have bugs, I know I've been able to follow EUS-GLC trains "all the way" to Glasgow Central, I'm sure I've seen TRAIN_MVT data reports for Carlisle, Beattock Summit, Lanark Junction, Uddingston Junction, Rutherglen East Junction and arrival at Glasgow Central platform 1.
However I've not seen data for those trains passing say Cambuslang or other intermediate stations, I assume because they're not timing points. Therefore I was trying to map out the TD data so I could interpolate from the berth steps but that TD data is sadly incomplete as of now.
Not so fast - saying somebody has a 'bug' because they might understand isn't good.
Incidentally, there is a data set somewhere with all berth steps and the STANOXes, lines, directions and event types that SMART uses to produce TRUST reports.
Anyone used a C# .Net Client to connect ? .. I'm still struggling
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Apache.NMS;
namespace ApacheNMS
{
class Program
{
static void Main(string[] args)
{
IConnectionFactory factory = new NMSConnectionFactory(new Uri("stomp:tcp://datafeed:61618"));
IConnection connection = factory.CreateConnection("username", "password");
ISession session = connection.CreateSession();
IDestination destination = session.GetDestination("topic://" + "DATA_FEED");
IMessageConsumer consumer = session.CreateConsumer(destination);
connection.Start();
consumer.Listener += new MessageListener(OnMessage);
Console.WriteLine("Consumer started, waiting for messages... (Press ENTER to stop.)");
Console.ReadLine();
connection.Close();
}
private static void OnMessage(IMessage message)
{
try
{
Console.WriteLine("Median-Server (.NET): Message received");
ITextMessage msg = (ITextMessage)message;
message.Acknowledge();
Console.WriteLine(msg.Text);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine("---");
Console.WriteLine(ex.InnerException);
Console.WriteLine("---");
Console.WriteLine(ex.InnerException.Message);
}
}
}
}
I've been trying to get the data feeds for three days now...haven't been successful
This is my php client
<?php
require_once("Stomp.php");
// Network Rail Stomp Handler example by ian13
$server = "tcp://datafeeds.networkrail.co.uk:61618";
$user = "loginUsername";
$password = "loginPassword";
$channel = "TRAIN_MVT_ALL_TOC";
$con = new Stomp($server, $user, $password);
if (!$con) {
die('Connection failed: ' . stomp_connect_error());
}
$con->subscribe("/topic/" . $channel);
while($con){
if ($con->hasFrame()){
$msg = $con->readFrame();
foreach (json_decode($msg->body) as $event) {
// do stuff with $event here
}
$con->ack($msg);
}
}
die('Connection lost: ' . time());
?>
I get the following errors:
Uncaught exception 'StompException' with message 'Socket connection hasn't been established'
Or
User name [ ] or password is invalid
Please note that I have installed activemq and Stomp and was able to run the first.php example successfully.
Any help will be very much appreciated
Regards,
Amy