live-icomera-position

1.2.0 • Public • Published

live-icomera-position

Live vehicle geolocation, taken from the on-board Icomera WiFi system.

npm version build status ISC-licensed minimum Node.js version chat with me on Gitter support me on Patreon

Installation

npm install live-icomera-position

Usage

asStream() returns a readable stream in object mode.

const {asStream} = require('live-icomera-position')
const ndjson = require('ndjson')

const positions = asStream()
positions.on('error', console.error)
positions
.pipe(ndjson.stringify())
.pipe(process.stdout)

An individual data point will look like this:

{
	latitude: 50.9069,
	longitude: 7.0649,
	altitude: 36.9,
	speed: 97, // km/h
	nrOfSatellites: 8,
	mode: '3' // see below
}

You can also use the EventEmitter-based API:

const {asEventEmitter} = require('live-icomera-position')

const positions = asEventEmitter()
positions.on('error', console.error)
positions.on('data', data => console.log(data))

Mode

The mode value in a datapoint appears familiar with the one a widespread gps client called GPSD uses. We don't have any confirmation that the icomera system uses GPSD, but if it did the mode values would mean following:

Value State
0 no value seen.
1 no position.
2 2D position, no altitude.
3 3D position, altitude present.

source: GPSD Documentation

Contributing

If you have a question or need support using live-icomera-position, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, use the issues page.

Install

npm i live-icomera-position

DownloadsWeekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

7.37 kB

Total Files

6

Last publish

Collaborators

  • derhuerst