![]() |
|
|
|
|
|
#16 |
|
Member
Join Date: 29 Jun 2012
Location: Sheffield, South Yorkshire
Posts: 8
|
Thanks B0b for posting your java, I was attempting to get it working using the Stomp rubygem with the ruby example, but it seemed to keep dropping the connection... (and thanks to poggs for clearing up to use /topic and not /queue)
however, all works well with Gozirra, so I'm making progress. Typical timing though, off to North Wales for hols for a couple of weeks, just when I want to do some JSON parsing! |
|
|
|
| Sponsored links - Registered users do not see these banners - join today! |
|
|
|
|
#17 |
|
Does not work for the BBC
Established Member
Join Date: 20 Oct 2008
Location: Hatfield or Surrey
Posts: 5,065
|
Still having trouble with it - though I suspect it is me, not Stomp this time.
Basically trying to get the TSRs on the LNE(S) route, the script connects, subscribes with no Stomp errors but stalls when running the readFrame() method, sending the CPU usage up to 100% and crashing out when reaching the maximum time.
__________________
All posts are my opinion and should not be taken as an authoritative source |
|
|
|
|
|
#18 |
|
Member
Join Date: 12 Apr 2012
Posts: 225
|
Thanks for posting that, metroland - and so quickly after the announcement too! I've got my subscription in.
Has anyone had any luck downloading the train schedules? I don't seem to be able to. For example, the developer pack gives the example of using the URL https://datafeeds.networkrail.co.uk/...Y&day=toc-full to download the Northern Rail daily full schedule (Actually the PDF had an extra space after 'ntrod' which I've removed). But whenever I try that URL in the browser, I just get back the error User not subscribed to CIF_ED_FULL_DAILY. But a quick look at my account shows that's rubbish - it's clearly showing my account as active and subscribed to that schedule. Same thing with all the other schedules I've tried. --- old post above --- --- new post below --- Agreed. And it's even worse for people like me who inhabit the .NET world, since they don't even provide samples in those languages! Last edited by DynamicSpirit; 30th June 2012 at 20:12. Reason: Double post prevention system |
|
|
|
|
|
#19 | ||
|
Sofware Devloper
Member
Join Date: 30 Jun 2012
Posts: 7
|
Quote:
It works for me, I am subscribed to the schedule "All Full Daily" Quote:
Can anyone tell me the port that their stomp service is running on? It's something like ***16 if I remember correctly. I was playing around with it at work on Friday and had it working but I can't seem to download the developer PDF here at home as it's asking me for a login and the one for the datafeeds isn't being accepted. EDIT: Found a cached version (slightly older revision than I was reading on Friday though): https://docs.google.com/viewer?a=v&q...6ST6CMetUZeMKQ It's port 61618 Last edited by robh; 30th June 2012 at 21:52. Reason: Additional info |
||
|
|
|
|
|
#20 | |
|
Member
Join Date: 17 Apr 2008
Posts: 12
|
Quote:
Getting: Code:
Fatal error: Uncaught exception 'StompException' with message 'Could not connect to datafeeds.networkrail.co.uk:61618 (10/10)' in /<path>/Stomp.php:168
Stack trace:
#0 <path>/Stomp.php(190): Stomp->_makeConnection()
#1 <path>/stomp_test.php(7): Stomp->connect()
#2 {main} thrown in <path>/Stomp.php on line 168
|
|
|
|
|
|
|
#21 | |
|
Open Data Geek
Member
Join Date: 28 Aug 2008
Location: London
Posts: 251
|
Quote:
Have you looked at http://activemq.apache.org/nms/ for your .NET requirements? |
|
|
|
|
|
|
#22 | |
|
Does not work for the BBC
Established Member
Join Date: 20 Oct 2008
Location: Hatfield or Surrey
Posts: 5,065
|
Still haven't got to actually parsing a JSON message yet! This is my first experience of ActiveMQ and Stomp, but I'm having more trouble than I expected. Still got the crashing problem...
--- old post above --- --- new post below --- Quote:
__________________
All posts are my opinion and should not be taken as an authoritative source Last edited by ralphchadkirk; 1st July 2012 at 20:51. Reason: Double post prevention system |
|
|
|
|
|
|
#23 |
|
Member
Join Date: 17 Apr 2008
Posts: 12
|
|
|
|
|
|
|
#24 |
|
Member
Join Date: 18 Nov 2010
Posts: 49
|
Ok so i've just got some JSON back. Tried putting the train ID and schedule id that it returned into open train times and it wasn't found? It was just for fun to see what I had gotten back..
The programming I am ok with, understanding the railways inner workings could be trickier than i thought. |
|
|
|
|
|
#25 |
|
Does not work for the BBC
Established Member
Join Date: 20 Oct 2008
Location: Hatfield or Surrey
Posts: 5,065
|
That's me out of suggestions then!
For reference, this is the quick 'n' dirty code I'm using just to try and extract a JSON message to see if it all works (unfortunately, it doesn't yet). PHP Code:
__________________
All posts are my opinion and should not be taken as an authoritative source |
|
|
|
|
|
#26 |
|
Member
Join Date: 17 Jul 2008
Posts: 162
|
My advice in PHP is to completely ignore the developer pack.
First, install the PECL STOMP package (just type "pecl install stomp" in the command line). Then, use code such at the following: PHP Code:
__________________
Want digital train timetables with mileages and maps? Try http://trains.im Last edited by ian13; 1st July 2012 at 21:19. |
|
|
|
|
|
#27 |
|
Does not work for the BBC
Established Member
Join Date: 20 Oct 2008
Location: Hatfield or Surrey
Posts: 5,065
|
Ah, interesting, I can get the RTTPM feed with my code, but not the TSR feed. Haven't tried anything else yet.
I'll try your code in a minute Ian.
__________________
All posts are my opinion and should not be taken as an authoritative source |
|
|
|
|
|
#28 | |
|
Member
Join Date: 12 Apr 2012
Posts: 225
|
Quote:
Out of interest, you say 'I'. Does that mean you had some influence in the choice of platform? (And no problem about the neutral standard. I totally understand that you need something that can be accessed from any platform). On the schedules, do you need to have a your own Amazon S3 account set up to download them? I don't and I had assumed that was fine since the URL to download schedules is a networkrail one, not an amazon one, but now wondering if that's the problem. I see one of my download attempts has caused a page redirect to https://nr-datafeed-cif.s3.amazonaws.com/. |
|
|
|
|
|
|
#29 | |
|
Established Member
Join Date: 16 Apr 2010
Posts: 1,367
|
Quote:
The real-time running data is derived from TRUST/TOPS and uses a completely different set of codes, i.e. STANOX codes for locations (e.g. 88451 for Hither Green, 74446 for Oxford) and TOPS train codes for individual trains, made up of part of the STANOX code for the origin station, the train headcode, and a couple of codes to indicate the rough time of day and date the train started its journey (e.g. 861M58MP01, 121O32MV01 etc.). Translating between these two sets of codes is a whole big job in itself! Some good information on codes here and here. |
|
|
|
|
|
|
#30 |
|
Member
Join Date: 17 Apr 2008
Posts: 12
|
Have tried Ian's way, gone is the 'cannot connect' message and appears to connect but then throws another exception :
Socket connection hasn't been established Confused Update, just altered my password and get the same 'socket' message, so guess it isnt connecting afterall. Last edited by DAH; 2nd July 2012 at 10:59. Reason: tried something different |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|