# Sydney Trains Realtime/Trips Feed Down?

**URL:** <https://opendataforum.transport.nsw.gov.au/t/sydney-trains-realtime-trips-feed-down/488>\
**Category:** Uncategorized\
**Created:** [December 12, 2016, 1:44am UTC](https://opendataforum.transport.nsw.gov.au/t/sydney-trains-realtime-trips-feed-down/488 "2016-12-12T01:44:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkotfnsw](https://avatars.discourse-cdn.com/v4/letter/h/77aa72/32.png) [@hkotfnsw](https://opendataforum.transport.nsw.gov.au/u/hkotfnsw)\
**Post date:** [December 12, 2016, 1:44am UTC](https://opendataforum.transport.nsw.gov.au/t/sydney-trains-realtime-trips-feed-down/488/1 "2016-12-12T01:44:54Z")

</div>

I am trying to decode the Sydney trains real-time/trips feed ([https://api.transport.nsw.gov.au/v1/gtfs/realtime/sydneytrains](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](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.

---

<div class="post-metadata">

**Author:** ![alejandro.felman](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@alejandro.felman](https://opendataforum.transport.nsw.gov.au/u/alejandro.felman)\
**Post date:** [December 12, 2016, 3:07am UTC](https://opendataforum.transport.nsw.gov.au/t/sydney-trains-realtime-trips-feed-down/488/2 "2016-12-12T03:07:05Z")

</div>

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](http://opendata.transport.nsw.gov.au/forum/t/illegal-value-error-when-decoding-sydneytrains-gtfs-data/149/4)

---

<div class="post-metadata">

**Author:** ![hkotfnsw](https://avatars.discourse-cdn.com/v4/letter/h/77aa72/32.png) [@hkotfnsw](https://opendataforum.transport.nsw.gov.au/u/hkotfnsw)\
**Post date:** [December 14, 2016, 6:36am UTC](https://opendataforum.transport.nsw.gov.au/t/sydney-trains-realtime-trips-feed-down/488/3 "2016-12-14T06:36:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yvonne.lee](https://avatars.discourse-cdn.com/v4/letter/y/c37758/32.png) [@yvonne.lee](https://opendataforum.transport.nsw.gov.au/u/yvonne.lee)\
**Post date:** [December 15, 2016, 12:29am UTC](https://opendataforum.transport.nsw.gov.au/t/sydney-trains-realtime-trips-feed-down/488/4 "2016-12-15T00:29:22Z")

</div>

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

> **[Illegal value Error when decoding SydneyTrains GTFS data](https://opendataforum.transport.nsw.gov.au/t/illegal-value-error-when-decoding-sydneytrains-gtfs-data/149/5)**
>
> hi guys @nhardy and @jxeeno A kindly developer has passed on the below which you can just drop in and should work. It is a proto file from the google reference site circa 2014 modified to include the VehicleOccupancy. It should work across all...

Note there are recent changes (to include the Xmas Buses) that may require a change to the proto file… Details in the other [thread](http://opendata.transport.nsw.gov.au/forum/t/christmas-buses-now-available-in-the-buses-feed/481/2) and on the Open Data hub under [Troubleshooting](https://opendata.transport.nsw.gov.au/troubleshooting).

---

<div class="post-metadata">

**Author:** ![hkotfnsw](https://avatars.discourse-cdn.com/v4/letter/h/77aa72/32.png) [@hkotfnsw](https://opendataforum.transport.nsw.gov.au/u/hkotfnsw)\
**Post date:** [December 15, 2016, 1:55am UTC](https://opendataforum.transport.nsw.gov.au/t/sydney-trains-realtime-trips-feed-down/488/5 "2016-12-15T01:55:07Z")

</div>

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).
