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

ttjs-cli

v2.4.1

Published

The Things Join Server CLI

Downloads

75

Readme

The Things Join Server Command-line Interface

The Things Join Server is a stand-alone LoRaWAN® Join Server implementation with provisioning and claiming capabilities. The Things Join Server supports LoRaWAN Backend Interfaces 1.0 and 1.1.

The Command-line Interface (CLI) can be used to provision end devices.

Table of Contents

Install

Install The Things Join Server CLI:

$ npm install -g ttjs-cli

Configure

Initialize configuration:

$ ttjs init

The initialization procedure prompts the following configuration settings:

  • Server URL: URL of The Things Join Server
  • Provisioner username: Username of the Provisioner
  • Provisioner password: Password of the Provisioner
  • Configuration file: Path to local file to store the configuration file. This is useful if you work with multiple The Things Join Server instances. You can pass the path of a configuration file to the CLI via the --config (-c) flag.

Device Management

To provision new devices on The Things Join Server, the CLI can upload a file with provisioning information. The Things Join Server may support multiple provisioning formats. To list the formats supported by The Things Join Server:

$ ttjs import list-formats

See the referenced documentation in the output for more information.

To provision end devices from a file named devices.csv:

$ ttjs import --format csv devices.csv

This returns the provisioned end devices, along with their standard QR code for claiming.

To request the current Owner Token and current claim of DevEUI 1122334455667788:

$ ttjs get 1122334455667788

To request the root keys and the nonces:

$ ttjs get 1122334455667788 --nonces --root-keys

WARNING: If you pass --root-keys, the root keys are returned in plain text. This marks the root keys forever as exposed.

To request the Owner Token and current claim of all devices:

$ ttjs list

The Owner Token can be used by Application Servers for claiming, see Claiming.

QR Codes

To generate QR codes for all devices:

$ ttjs qr-code

To generate the QR code for a single device:

$ ttjs qr-code --dev-eui 1122334455667788

This writes the QR code to the current directory with default settings.

You can specify the output folder with --output-folder, the type with --type (png or svg), the scale with --scale, the margin with --margin and the error correction level with --error-correction-level (L, M, Q, H). Pass --help for help.

If you're using a custom QR code generator, you can get the QR code text. For all devices:

$ ttjs list --qr-code

To get the QR code text for a single device:

$ ttjs get 1122334455667788 --qr-code

Example CSV

The Things Join Server supports importing devices from a CSV file out of the box. This is an example CSV file with two devices with LoRaWAN 1.0.x support:

dev_eui;app_key
1122334455667788;11223344556677881122334455667788
8877665544332211;88776655443322118877665544332211

Another example with LoRaWAN 1.1 support, custom owner tokens and a vendor ID and profile ID:

dev_eui;app_key;nwk_key;owner_token;vendor_id;profile_id
1122334455667788;11223344556677881122334455667788;11223344556677881122334455667788;secret1;42;1234
8877665544332211;88776655443322118877665544332211;88776655443322118877665544332211;secret2;42;1234

Legal

Copyright © 2023 The Things Industries B.V.