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

microadsb

v0.1.1

Published

NodeJS interface to the microADSB-USB receiver

Downloads

10

Readme

microADSB

NodeJS interface to the microADSB-USB receiver (http://www.microadsb.com/)

Requirements

  • NodeJS
  • serialport (from npm)
  • A compatible ADS-B receiver

Installation

Inside your node_modules directory:

git clone https://www.github.com/jeffwalter/microADSB.git
npm install

Example

var microADSB = require ('microADSB');

var adsb = new microADSB ();
adsb.device = '/dev/ttyUSB0';

adsb.on ('open', function (err) {
	if (err) {
		console.error ('Error: ' + err);
		return;
	}
	console.log ('Notice: ADSB port opened');
});

adsb.on ('message', function (message) {
	console.log (message);
});

adsb.open ();

Output

52 bit squitter

{
	frameid: 690,
	timestamp: {
		string: '0x001310942f70',
		integer: 81882525552
	},
	type: '*',
	downlinkformat: 4,
	data: [ 32, 0, 13, 177, 149, 135, 115 ],
	frame: '*20000DB1958773;'
}

112 bit extended squitter (ADS-B)

{
	frameid: 62904,
	timestamp: {
		string: '0x001310921fb8',
		integer: 81882390456
	},
	type: '*',
	downlinkformat: 17,
	data: [ 141, 171, 31, 254, 153, 148, 205, 134, 104, 76, 8, 88, 72, 160 ],
	frame: '*8DAB1FFE9994CD86684C085848A0;'
}

API

Properties

Serial Device

  • device (string): Path to the serial device presented by the ADS-B receiver
  • baudrate (integer, 115200): Baudrate to use. NOTE: The microADSB-USB uses 115200bps and it can't be changed.
  • databits (integer, 8): Number of bits per "byte". NOTE: The microADSB-USB uses 8 and it can't be changed.
  • parity (integer, 0): Which bits to use for parity. NOTE: The microADSB-USB uses 0 and it can't be changed.
    • 0 - No parity
    • 1 - Odd
    • 2 - Even
  • stopbits (float, 1): Number of bits that indicate a stop. NOTE: The microADSB-USB uses 1 and it can't be changed.

ADS-B

  • frameids (boolean, false): Ask the ADS-B receiver to tag incoming frames with an incrementing ID so you can tell if a frame is dropped.
  • timestamps (boolean, false): As the ADS-B receiver to tag incoming frames with a timestamp. NOTE: The timestamps are pretty useless and NodeJS doesn't support 48bit unsigned integers.
  • heartbeats (boolean, false): Instruct the ADS-B receiver to send a heartbeat frame about every second.
  • raw (boolean, false): Instruct the ADS-B receiver to deliver frames using a binary syntax to use less bandwidth. NOTE: The binary protocol is not implemented in this module yet.
  • mode (integer, 2): Tell the ADS-B receiver which types of frames you'd like to receive:
    • 2 - All frames
    • 3 - Only DF17, DF18, and DF19 frames
    • 4 - Only DF17, DF18, and DF19 frames with valid CRC

Methods

  • on: Sets up a callback for an event. Callback definitions are detailed in the Events section below.
  • open: Open the serial connection to the ADS-B receiver and configure it using the ADS-B properties. Calls the optional passed function or fires the open event when everything is ready or an error occurs.
    • Callback: function (err)
  • close: Closes down the serial connection after attempting to reset the ADS-B receiver. Calls the optional passed function or fires the close event when everything is shut down or an error occurs.
    • Callback: function (err)

Events

  • open: Fires when the ADS-B receiver is opened, configured, and ready to send events, or an error occurred during opening.
    • Callback: function (err)
  • message: Calls the passed function when a message arrives from the ADS-B receiver. Passes a structure containing the message and extra information when available.
    • Callback: function (message)
  • heartbeat: When heartbeats are enabled prior to calling open() the callback for this event is called every time a heartbeat frame is received.
    • Callback: function ()
  • err: A general error event. Any out of call error causes this event to fire.
    • Callback: function (err)
  • close: When the ADS-B receiver goes away (intentional via close() or for some other reason) this event is called. Any error is passed along in the first argument.
    • Callback: function (err)