wifi-on-ice-position-stream
v1.0.1
Published
A stream of ICE positions, taken from the on-board WiFi.
Downloads
12
Maintainers
Readme
wifi-on-ice-position-stream
A stream of ICE positions, taken from the on-board WiFi.
Installation
npm install wifi-on-ice-position-stream
Usage
const createStream = require('wifi-on-ice-position-stream')
const positions = createStream()
positions.once('data', (position) => {
console.log(position)
positions.destroy()
})
createStream()
returns a readable stream in object mode.
Each position/chunk is in the format of wifi-on-ice-portal-client
with an additional clientTime
field:
{
ok: true,
speed: 245,
gpsOk: true,
latitude: 51.86973533333333,
longitude: 9.989614166666666,
servicelevel: 'AVAILABLE_SERVICE',
wagonClass: 'FIRST',
serverTime: 1504698041985,
clientTime: 1504698041872
}
You may pass these options to createStream(opt)
:
interval
– How often to fetch the current position from the on-board WiFi, in milliseconds. Default:5000
endOnTrainChange
– End the stream as soon as the Triebzugnummer reported by the on-board WiFi changes, e.g. when your client accidentally connects to the WiFi of a different train. Default:true
Related
- Was das neue Bahn-Wifi über seine Nutzer ausplaudert
wifi-on-ice-portal-client
– Query information from the WifiOnICE portal in German ICE trains.record-ice-movement
– Record the movement of any ICE using the on-board WiFi.live-cd-wifi-position
– Live vehicle geolocation of České dráhy (Czech Railways) trains taken from the on-board Icomera WiFi system.
Contributing
If you have a question or have difficulties using wifi-on-ice-position-stream
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.