Sydney Trains Realtime/Trips Feed Down?

I am trying to decode the Sydney trains real-time/trips feed (https://api.transport.nsw.gov.au/v1/gtfs/realtime/sydneytrains) but am getting errors when parsing the GTFS data. The exact same code works for all other real-time/trips feed as well as alerts and vehicle position feeds. Is there any difference between the Sydney Trains real-time/trips feed with others? I am using Node JS with the gtfs-realtime-bindings module (version 0.0.4) to decode.

In addition, I noticed when use debug mode (https://api.transport.nsw.gov.au/v1/gtfs/realtime/sydneytrains?debug=true), instead of the return texts, the Open Data API Explorer returns binary data.

Hi @hkotfnsw, does this resolve your problem by any chance? Illegal value Error when decoding SydneyTrains GTFS data - #4 by yvonne.lee - Real-time Public Transport - Open Data - Transport for NSW forum

Thanks, that worked! I had to update the code to use the proto file given in the URL.

I am still not sure why the same code works for all other feeds except for Sydney Trains trips data, which now needs to use specific proto file.

I think the file referenced here should work across all modes?

Note there are recent changes (to include the Xmas Buses) that may require a change to the proto file… Details in the other thread and on the Open Data hub under Troubleshooting.

Yes, the proto file should work for all modes - given that it works for Sydney Trains now - although I haven’t tried it.

Think I should add more details here for anyone who might be interesed…

I am using Node JS with the module “gtfs-realtime-bindings” version 0.0.4 which works for all except for Sydney Trains.

So to get Sydney Trains working, I got the proto file from the link above and used another module “protobufjs” version 6.1.1 and this works. This should also work for other modes although I haven’t tried.

Maybe there is an issue with “gtfs-realtime-bindings” version 0.0.4 (haven’t investigated further).

1 Like