ttjs-cli

2.4.3 • Public • Published

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.

/ttjs-cli/

    Package Sidebar

    Install

    npm i ttjs-cli

    Weekly Downloads

    2

    Version

    2.4.3

    License

    ISC

    Unpacked Size

    48.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • the-things-industries