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

tracksix

v1.2.1

Published

Track your [β›΅|πŸš‚|πŸš™|🚜|πŸ›΅|πŸ›·|🚢] with a Raspberry Pi and a GPS.

Downloads

35

Readme

Tracksix

Track your [β›΅|πŸš‚|πŸš™|🚜|πŸ›΅|πŸ›·|🚢] with a Raspberry Pi and a GPS.

Features

  • OwnTracks Compatable Config & Reporting Format
  • MQTT(S) Reporting
  • MQTT over WebSocket Reporting
  • Programmatic usage or executable use
  • Compatable with a huge array of GPS devices through GPSd
  • Replays reports when an internet connection arrises

Install

To communicate with your GPS device, tracksix utilises GPSd (Global Positioning System daemon) which standardises the format from different GPS devices.

On OSX:

$ brew install gpsd

On Debian/Ubuntu:

$ sudo apt install gpsd

Ensure you have Node.js installed on your device, then install tracksix:

$ npm install --global tracksix

Usage

$ tracksix [path to config file]

Tracksix uses the same configuration format as OwnTracks, this can be exported from your OwnTracks mobile app or copy the config.example.json and edit the contents appropriately.

Programmatic Usage

First follow the above steps for installing GPSd. Then install the tracksix library into your nodejs project:

 $ npm install tracksix

Import the library:

const tracksix = require('tracksix')

Load your configuration file:

const path = require('path')
const config = tracksix.readConfigSync(
    path.resolve(__dirname, './config.json')
)

Start tracking:

const tracker = tracksix(config)

To listen for errors, tracksix() returns an EventEmitter which emits 'error' events.

tracker.on('error', (err) => {
    console.error(err)
})

To listen for updates sent to the MQTT server, subscribe to 'location' events. A location event contains the same elements as specified in the OwnTracks location object.

tracker.on('location', (report) => {
    console.log(report)
})

Run as a service

Write the following to /etc/systemd/system/tracksix.service and update the path to node which node and tracksix which tracksix.

[Unit]
Description=Tracksix Service
After=network.target

[Service]
Type=simple
# Another Type: forking
User=pi
WorkingDirectory=/home/pi
ExecStart=/home/pi/.nvm/versions/node/v10.13.0/bin/node /home/pi/.nvm/versions/node/v10.13.0/bin/tracksix
Restart=on-failure
# Other restart options: always, on-abort, etc

# The install section is needed to use
# `systemctl enable` to start on boot
# For a user service that you want to enable
# and start automatically, use `default.target`
# For system level services, use `multi-user.target`
[Install]
WantedBy=multi-user.targe

Afterwards you need to enable the service:

$ sudo systemctl enable tracksix.service

Then start the service with:

$ sudo systemctl start tracksix

You can check the status / logs with:

$ systemctl status tracksix.service

Development

To start a mock GPSd server use gpsd-fake: npm install -g gpsd-fake && gpsd-fake.

Licence

MIT Β© Ben Evans