npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tk-103-parser

v1.0.35

Published

Parser for TK-103 GPS Devices

Downloads

67

Readme

TK-103-Parser

A parser for TK-103A and TK-103B GPS Tracker Protocol.

Getting Started with SMS Protocol


import tk103 from 'tk-103-parser';

const test = new Buffer('lat:14.632742\nlong:121.001790\nspeed:0.00\nT:17/06/05 16:21\nhttp://maps.google.com/maps?f=q&q=6.226433,125.075470&z=16\nPwr: ON Door: OFF ACC: OFF')
const smsrawSOSAlert = new Buffer('help me!\nlat:6.319640\nlong:124.975628\nspeed:0.00\nT:17/06/05 16:42\nhttp://maps.google.com/maps?f=q&q=6.319640,124.975628&z=16');


console.log(tk103.parseTK103(test));
console.log(tk103.parseTK103(smsrawSOSAlert));

Output for SMS Protocol

{
  alert: null,
  latitude: '14.632742',
  longitude: '121.001790',
  speed: '0.00',
  date: '16:21',
  parsedDate: undefined,
  dateTime: [Function: Date],
  time: 'http://maps.google.com/maps?f=q&q=6.226433,125.075470&z=16',
  power: 'ON',
  door: 'OFF',
  acc: 'OFF',
  lastlatitude: null,
  lastlongitude: null,
  mnc: null,
  mcc: null,
  timestampsent: null,
  direction: null,
  GPSPosition: null,
  GPSSIgnal: null,
  vehicleBattery: null,
  status: 'Success'
}

{
  alert: 'SOSAlert',
  latitude: '6.319640',
  longitude: '124.975628',
  speed: '0.00',
  date: '17/06/05',
  parsedDate: '2017-06-05',
  dateTime: [Function: Date],
  time: '16:42',
  power: null,
  door: null,
  acc: null,
  lastlatitude: null,
  lastlongitude: null,
  mnc: null,
  mcc: null,
  timestampsent: null,
  direction: null,
  GPSPosition: null,
  GPSSIgnal: null,
  vehicleBattery: null,
  status: 'Success' }

SMS Protocol Format

acc on!
lat:8.467303
long:124.788797
speed:0.00
T:17/06/05 20:08
http://maps.google.com/maps?f=q&q=8.467303,124.788797&z=16

ACC alarm!
lat:14.324082
long:121.027818
speed:9.13
T:17/06/05 16:35
http://maps.google.com/maps?f=q&q=14.324082,121.027818&z=16

acc off!
lat:14.223530
long:121.081455
speed:0.00
T:17/06/06 02:40
http://maps.google.com/maps?f=q&q=14.223530,121.081455&z=16

ACC off! lat:14.223577 long:121.081497 speed:0.00 dir:147
T:05/06/17 23:54
http://maps.google.com/maps?f=q&q=14.223577,121.081497&z=16

lat:14.496282
long:120.993023
speed:0.00
T:17/06/11 00:27
http://maps.google.com/maps?f=q&q=14.496282,120.993023&z=16

speed!
lat:6.424677
long:124.771663
speed:463.00
T:17/07/13 13:12
http://maps.google.com/maps?f=q&q=6.424677,124.771663&z=16

Lac:2FA6,2E68
T:05/06/17 20:35
PWR:ON Door:OFF ACC:OFF
http://maps.google.com/maps?f=q&q=,&z=16

Lac:c7d8 ce08
T:
Last:
T:15:32
http://maps.google.com/maps?f=q&q=8.354022,124.850563&z=16

Lac:2afa 96d3
T:17/06/05 16:21
Last:
T:21:35
http://maps.google.com/maps?f=q&q=14.384938,121.026440&z=16

help me!
lat:6.319640
long:124.975628
speed:0.00
T:17/06/05 16:42
http://maps.google.com/maps?f=q&q=6.319640,124.975628&z=16

help me!
Lac:c742 dc90
T:
Last:
T:00:00
http://maps.google.com/maps?f=q&q=6.049100,124.746815&z=16

speed!
lat:6.424677
long:124.771663
speed:463.00
T:17/07/13 13:12
http://maps.google.com/maps?f=q&q=6.424677,124.771663&z=16

oil 24.32%!
lat:14.696282
long:121.004995
speed:0.00
T:17/07/13 13:42
http://maps.google.com/maps?f=q&q=14.696282,121.004995&z=16

lat:14.632742
long:121.001790
speed:0.00
T:17/06/05 16:21
http://maps.google.com/maps?f=q&q=6.226433,125.075470&z=16
Pwr: ON Door: OFF ACC: OFF