Skip to content
A JavaScript parser for the NMEA GPS protocol
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Cleanup Oct 24, 2014
codecs
test
util Move parse util under /util/, it was breaking mocha tests Nov 28, 2013
.gitignore Added node_modules to gitignore Nov 8, 2013
LICENSE
README.md
helpers.js Fix UTC month out by one error May 31, 2016
liner.js
nmea.js Added support for PRDID sentances Jun 16, 2015
package.json
test.js

README.md

A NMEA-0183 GPS Protocol parser

An example using the node-serialport library to read a stream of messages from a GlobalSat BU-353 USB GPS receiver:

var serialport = require('serialport');
var nmea = require('nmea');

var port = new serialport.SerialPort('/dev/cu.usbserial', {
                baudrate: 4800,
                parser: serialport.parsers.readline('\r\n')});
    
port.on('data', function(line) {
    console.log(nmea.parse(line));
});

// { type: 'active-satellites',
//   selectionMode: 'A',
//   mode: 1,
//   satellites: [ 29, 18, 21 ],
//   PDOP: '',
//   HDOP: '',
//   VDOP: '',
//   talker_id: 'GP' }
// { type: 'satellite-list-partial',
//   numMsgs: 3,
//   msgNum: 1,
//   satsInView: 11,
//   satellites: 
//    [ { id: '18', elevationDeg: 7, azimuthTrue: 214, SNRdB: 43 },
//      { id: '21', elevationDeg: 5, azimuthTrue: 114, SNRdB: 34 },
//      { id: '26', elevationDeg: 71, azimuthTrue: 234, SNRdB: 0 } ],
//   talker_id: 'GP' }

To add custom codecs

var MyCustom = require('./MyCustom.js');
nmea.traditionalDecoders['MyCustomr'] = MyCustom.decode;
You can’t perform that action at this time.