Keolis/Blauwnet journey number?

54 views
Skip to first unread message

kmno589

unread,
Jan 13, 2023, 1:36:45 PM1/13/23
to openov
I have noticed that when using the NDOV KV6 feed for Keolis, the journey number that it reports is different from that NS reports on their website (App, Departures/Arrivals API...)

For example:
7970 Real - 10065 Fake (Reported by NDOV)
7961 Real - 10103 Fake(Reported by NDOV)

I assume NDOV is taking them from PUJOPASSXX.TMI can be found in the .zip under /Keolis/ directory.

Is there any way to convert or obtain the journey numbers that are reported by NS from the ones that are reported by the NDOV KV6 feed? (Other than manual remapping)?

Kind regards.

Stefan de Konink

unread,
Jan 13, 2023, 7:33:51 PM1/13/23
to ope...@googlegroups.com
On Friday, January 13, 2023 7:36:45 PM CET, kmno589 wrote:
> Is there any way to convert or obtain the journey numbers that are reported
> by NS from the ones that are reported by the NDOV KV6 feed? (Other than
> manual remapping)?

Don't use KV6 for trains.

--
Stefan

kmno589

unread,
Jan 14, 2023, 7:29:05 AM1/14/23
to openov
Using KV15 or KV17 for  /SYNTUS/ (Keolis) doesn't return anything

```
self.context = zmq.Context()
self.subscriber = self.context.socket(zmq.SUB)
self.subscriber.connect('tcp://pubsub.besteffort.ndovloket.nl:7658')
self.subscriber.setsockopt(zmq.SUBSCRIBE, b"/SYNTUS/KV15message")
self.subscriber.setsockopt(zmq.SUBSCRIBE, b"/SYNTUS/KV17cvlinfo")
...
multipart = basestation_nl_ke.subscriber.recv_multipart()
address = multipart[0]
contents = multipart[1]
contents = gzip.decompress(contents)
data = xmltodict.parse(contents)

print(data)
```

In fact it appears that no matter what address I am trying to access, let it be /ARR/,  /CXX/,  /SYNTUS/, etc... it does not return anything when listening for KV15 or KV17 messages, it does return information with KV6 though. 

I am not completely sure why I shouldn't use KV6 for trains because it works perfectly for Arriva and it works for Keolis, it's just that Keolis reports journey numbers that are different from what NS is using (Arriva doesn't have this problem).

Stefan de Konink

unread,
Jan 14, 2023, 7:37:17 AM1/14/23
to ope...@googlegroups.com
On Saturday, January 14, 2023 1:29:05 PM CET, kmno589 wrote:
> Using KV15 or KV17 for /SYNTUS/ (Keolis) doesn't return anything

Try it with /KEOLIS

(or plainly /)


> In fact it appears that no matter what address I am trying to access, let
> it be /ARR/, /CXX/, /SYNTUS/, etc... it does not return anything when
> listening for KV15 or KV17 messages, it does return information with KV6
> though.

You only receive KV15 or KV17 messages once they are send. Last message was
a few minutes ago.

<VV_TM_PUSH xmlns="http://bison.connekt.nl/tmi8/kv15/msg"
xmlns:tmi8c="http://bison.connekt.nl/tmi8/kv15/core">
<SubscriberID>NDOVLOKET</SubscriberID>
<Version>BISON 8.1.2.0</Version>
<DossierName>KV15messages</DossierName>
<Timestamp>2023-01-14T13:27:03+01:00</Timestamp>
<KV15messages>
<STOPMESSAGE>
<dataownercode>CXX</dataownercode>
<messagecodedate>2023-01-14</messagecodedate>
<messagecodenumber>6</messagecodenumber>
<userstopcodes>
<userstopcode>65311010</userstopcode>
<userstopcode>65311020</userstopcode>
</userstopcodes>
<messagepriority>MISC</messagepriority>
<messagetype>OVERRULE</messagetype>
<messagedurationtype>ENDTIME</messagedurationtype>
<messagestarttime>2023-01-14T13:30:00+01:00</messagestarttime>
<messageendtime>2023-01-27T23:59:00+01:00</messageendtime>
<messagecontent>Let op: halte vervalt t/m 27-1 23:59u ivm
werkzaamheden.</messagecontent>
<reasontype>1</reasontype>
<subreasontype>23</subreasontype>
<messagetimestamp>2023-01-14T13:27:03+01:00</messagetimestamp>
<tmi8c:delimiter/>
</STOPMESSAGE>
</KV15messages>
</VV_TM_PUSH>


> I am not completely sure why I shouldn't use KV6 for trains because it
> works perfectly for Arriva and it works for Keolis, it's just that Keolis
> reports journey numbers that are different from what NS is using (Arriva
> doesn't have this problem).

The correct answer is: Dutch Railways (or more formally DCRI) is the single
source of truth for passenger information for railways. Any hacks may work,
but it is not a surprise it does not always work.

--
Stefan

kmno589

unread,
Jan 14, 2023, 7:52:50 AM1/14/23
to openov
Well I just received my first KV17 message with SYNTUS, however as expected it does not provide the positioning data like KV6 does.

The 'journeynumber' with this type of message is wrong so it still does not really give me a clear answer to this problem.


I am going to assume there is no way to get or convert the 'journeynumber' provided by KV feeds to the one provided by NS API (Which by itself does not report positions of Keolis trains hence the need to use NDOV KV6 feed in this case) other than manual matching of those numbers for now.

Best Regards.

Stefan de Konink

unread,
Jan 14, 2023, 7:57:59 AM1/14/23
to ope...@googlegroups.com
On Saturday, January 14, 2023 1:52:50 PM CET, kmno589 wrote:
> I am going to assume there is no way to get or convert the 'journeynumber'
> provided by KV feeds to the one provided by NS API (Which by itself does
> not report positions of Keolis trains hence the need to use NDOV KV6 feed
> in this case) other than manual matching of those numbers for now.

For NS you want InfoPlus, listen on port port 7664.

--
Stefan

kmno589

unread,
Jan 14, 2023, 8:26:18 AM1/14/23
to openov
Well the InfoPlus also reports the correct journey number (the same that is reported by NS) but it does not report the train number/registration (it reports `ns2:TreinNummer` however it is literally the same as the `ns2:RitId`) meaning it is impossible to match them in real time.

For example, the Blauwnet (Keolis) train with the registration/train number 45 is reported by KV6 feed with the 'journeyNumber' being reported as '16194', where as the real 'journeyNumber' that i would like for it to report would be '31252'.

The same '31252' is reported by the InfoPlus feed however the InfoPlus feed does not report the the registration/train number meaning it is impossible to convert the 'journeyNumber' reported by KV6 feed to the 'journeyNumber' reported by InfoPlus.

If that was possible it would look something like:

```
ns2JourneyNumber   = data['ns1:PutReisInformatieBoodschapIn']['ns2:ReisInformatieProductDAS']['ns2:DynamischeAankomstStaat']['ns2:RitId']
ns2TrainNumber = ns_data['ns1:PutReisInformatieBoodschapIn']['ns2:ReisInformatieProductDAS']['ns2:DynamischeAankomstStaat']['ns2:TreinAankomst']['ns2:TreinNummer']

kv6TrainNumber = kv6_data['vehiclenumber]

if kv6TrainNumber == ns2TrainNumber:
   kv6_data['journeynumber'] = ns2JourneyNumber  
```

However as mentioned above with the `ns2:TreinNummer` in the InfoPlus feed being the same as the `ns2:RitId` it is pretty much impossible

Stefan de Konink

unread,
Jan 14, 2023, 12:48:05 PM1/14/23
to ope...@googlegroups.com
On Saturday, January 14, 2023 2:26:17 PM CET, kmno589 wrote:
> The same '31252' is reported by the InfoPlus feed however the InfoPlus feed
> does not report the the registration/train number meaning it is impossible
> to convert the 'journeyNumber' reported by KV6 feed to the 'journeyNumber'
> reported by InfoPlus.

The problem is that Keolis has a vehicle monitoring system (from INIT)
which is not aligned in line what they publish at NS/Donna.

--
Stefan
Reply all
Reply to author
Forward
0 new messages