Giter VIP home page Giter VIP logo

tracking-parser's Introduction

tracking-parser

npm version npm downloads Build Status Coverage Status Maintainability dependency Status devDependency Status

Parse raw data from tracking devices

Parser availables:

Installation

npm i -S tracking-parser

Use

Try on Tonic

const tracking = require('tracking-parser')

const raw = new Buffer('$$B6869444005480041|91$GPRMC,194329.000,A,3321.6735,S,07030.7640,W,0.00,0.00,090216,,,A*6C|02.1|01.3|01.7|000000000000|20160209194326|13981188|00000000|32D3A03F|0000|0.6376|0100|7B20\r\n')
const options = {
  mcc: 730, // Necessary in TZ devices. Used for get geolocation. Default 730
  mnc: 1, // Necessary in TZ devices. Used for get geolocation. Default 1
  apiKey: 'googleApiKey' // Used for get address or geolocation. Default null
}
const data = tracking.simpleParse(raw)
console.log(data)
/*{
  raw: '$$B6869444005480041|91$GPRMC,194329.000,A,3321.6735,S,07030.7640,W,0.00,0.00,090216,,,A*6C|02.1|01.3|01.7|000000000000|20160209194326|13981188|00000000|32D3A03F|0000|0.6376|0100|7B20\r\n',
  manufacturer: 'tz',
  device: 'TZ-AVL05',
  type: 'data',
  imei: '869444005480041',
  alarm: { type: 'Sleep', status: true },
  loc: { type: 'Point', coordinates: [ -70.51273333, -33.361225 ] },
  gpsStatus: true,
  speed: 0,
  track: '0.00',
  magneticVariation: null,
  gpsMode: 'Autonomous'
  pdop: 2.1,
  hdop: 1.3,
  vdop: 1.7,
  status: {
    raw: '000000000000',
    sos: false,
    input: { '1': false, '2': false, '3': false, '4': false, '5': false },
    output: { '1': false, '2': false },
    charge: true
  },
  datetime: Tue Feb 09 2016 19:43:26 GMT+0000 (UTC),
  voltage: { battery: 3.98, inputCharge: 11.88, ada: 0, adb: 0 },
  lac: 13011,
  cid: 41023,
  temperature: 0,
  odometer: 0.6376,
  serialId: 100,
  valid: true,
  currentData: { isCurrent: false, diff: '22 días' }
}*/
tracking.parse(raw, options).then(console.log)
/*{
  raw: '$$B6869444005480041|91$GPRMC,194329.000,A,3321.6735,S,07030.7640,W,0.00,0.00,090216,,,A*6C|02.1|01.3|01.7|000000000000|20160209194326|13981188|00000000|32D3A03F|0000|0.6376|0100|7B20\r\n',
  manufacturer: 'tz',
  device: 'TZ-AVL05',
  type: 'data',
  imei: '869444005480041',
  alarm: { type: 'Sleep', status: true },
  loc: { type: 'Point', coordinates: [ -70.51273333, -33.361225 ] },
  gpsStatus: true,
  speed: 0,
  track: '0.00',
  magneticVariation: null,
  gpsMode: 'Autonomous'
  pdop: 2.1,
  hdop: 1.3,
  vdop: 1.7,
  status: {
    raw: '000000000000',
    sos: false,
    input: { '1': false, '2': false, '3': false, '4': false, '5': false },
    output: { '1': false, '2': false },
    charge: true
  },
  datetime: Tue Feb 09 2016 19:43:26 GMT+0000 (UTC),
  voltage: { battery: 3.98, inputCharge: 11.88, ada: 0, adb: 0 },
  lac: 13011,
  cid: 41023,
  temperature: 0,
  odometer: 0.6376,
  serialId: 100,
  valid: true,
  currentData: { isCurrent: false, diff: '22 días' },
  gps: 'enable',
  address: 'Robles 13180, Lo Barnechea'
}*/

License

MIT

tracking-parser's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar lgaticaq avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tracking-parser's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency eslint-plugin-standard to v5
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency lint-staged to v15
  • chore(deps): update dependency mocha to v10
  • chore(deps): update dependency node to v20
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • cellocator-parser 2.2.9
  • meitrack-parser 2.0.0
  • mobile-locator 0.6.3
  • queclink-parser 1.4.1
  • simple-reverse-geocoder 2.0.1
  • tz-parser 3.1.3
  • chai 4.3.6
  • eslint 4.19.1
  • eslint-config-standard 11.0.0
  • eslint-plugin-import 2.25.4
  • eslint-plugin-node 6.0.1
  • eslint-plugin-promise 3.8.0
  • eslint-plugin-standard 3.1.0
  • generate-changelog 1.8.0
  • husky 0.14.3
  • istanbul 0.4.5
  • lint-staged 7.3.0
  • mocha 5.2.0
  • prettier-standard 8.0.1
  • proxyquire 1.8.0
  • node >=8
nvm
.nvmrc
  • node v9
travis
.travis.yml
  • node 8
  • node 9

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.