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

@jmkristian/node-agwpe

v1.8.2

Published

Communicate via AX.25 in the style of node net, using an AGWPE-compatible TNC.

Downloads

28

Readme

node-agwpe

Communicate via AX.25, using an AGWPE-compatible TNC (e.g. Direwolf, SoundModem or AGWPE).

To get started, navigate to your package and run:

npm install @jmkristian/node-agwpe

The programming interface is similar to node Net. For example, connect to another station:

const AGWPE = require('@jmkristian/node-agwpe');

const connection = AGWPE.createConnection ({
    remoteAddress: 'their call sign',
    localAddress: 'your call sign',
    localPort: 0, // TNC port (sound card). default: 0
    host: 'TNC-server-host', // TNC's TCP host. default: 127.0.0.1
    port: 8000, // TNC's TCP port. default: 8000
}, function connectListener() {
    connection.write(...); // transmit data
    connection.pipe(...); // receive data
});
connection.on('error', function(err) {console.log('Uh oh! ' + err);})

Listen for incoming connections:

const AGWPE = require('@jmkristian/node-agwpe');
const Bunyan = require('bunyan');

var server = new AGWPE.Server ({
    host: 'tnc-server-host', // TNC's TCP host. default: 127.0.0.1
    port: 8000, // TNC's TCP port. default: 8000
    logger: Bunyan.createLogger({name: "AGWPE"}), /* default: no logging
        An object compatible with the Bunyan logger interface, or null. */
});
server.on('connection', function(connection) {
    console.log('connection'
                + ' from ' + connection.remoteAddress
                + ' to ' + connection.localAddress);
    connection.write(...); // transmit data
    connection.pipe(...); // receive data
});
server.listen({
        host: ['A1CALL-1', 'B2CALL-10'], // This server's call signs.
        port: [0, 1], // TNC ports to listen to. Default: all ports
    },
    function onListening(info) { // called when the server begins listening
        console.log('TNC listening %o', info);
    });

Monitor all received packets or send any packet:

var socket = server.createSocket({
    recvBufferSize: 8, // The default is 16 packets
    sendBufferSize: 3, // The default is 16 packets
});
socket.on('error', function(err) {
    console.log('bind failed ' + err);
}
socket.bind(function success() {
    socket.pipe(...);
    socket.write({
        port: 0,
        type: 'UI',
        toAddress: 'ID',
        fromAddress: 'TAC',
        info: Buffer.from('A1CALL'),
    });
});

This is somewhat similar to dgram sockets. Unlike dgram, a socket is a duplex stream operating in object mode. Each object in the stream represents a packet, with various possible fields:

{
    port: 0, // TNC port (usually identifies a sound card)
    type: 'UI', // or 'I', 'SABM', 'RR' etc.
    toAddress: 'A6CALL', // the call sign of the intended receiver
    fromAddress: 'N0CALL', // the call sign of the sender
    via: ['DIGIA*', 'DIGIB*', 'DIGIC'], // digipeater call signs
    info: Buffer.from([0x56, 0x23, ...]), // data in an I or UI packet
    NS: 7, // N(S) sequence number of this packet
    NR: 3, // N(R) acknowledges a previous packet
    PID: 2, // protocol ID
    command: true,
    response: true,
    P: true, // poll
    F: true, // final
}

Most of these fields are optional. Many combinations are invalid.

In the via array, call signs with an asterisk at the end represent digipeaters that retransmitted the packet.

Every packet the TNC receives on any port will appear in the Readable stream, regardless of whether the server is listening for them. Packets transmitted by this TNC don't appear in the Readable stream.

Received packets may be discarded if nobody reads from the socket or pipes it to something. (The flow of received packets can't be controlled.) Transmission is flow controlled: a pipeline might stop flowing or writers might see slow callbacks, if packets are offered faster than the TNC can transmit them. Written packets might be discarded if a writer doesn't wait for callbacks.

This package requires node.js version 8.17.0 or later. It works on Windows 8 and Ubuntu 20, with Direwolf version 1.7 and UZ7HO SoundModem version 1.13. It might work with other versions or on Mac.