v3.23.1

Getting Started Devices Gateways Integrations Reference
Get The Things Stack

Devices

    Overview
  • Adding Devices
  • ABP vs OTAA
  • Best Practices
  • Class B
  • Class C
  • Multicast
  • Downlink Queue Operations
  • Confirmed Downlinks Behavior
  • MAC Settings
  • ATECC608A/B Secure Elements
  • Device Claiming
  • End Device Templates
  • Generating a QR Code
  • The Things Node
  • The Things Uno
  • Troubleshooting Devices

Generating a QR Code

The Things Stack can generate QR codes for your devices, which can help you identify or claim those devices.

This guide shows how to list QR code formats supported by The Things Stack and generate QR codes using the CLI.

Command-line interface only

The instructions below use the command-line interface (CLI).

Learn how to install the CLI

List QR Code Formats

To show QR code formats for end devices that The Things Stack supports:

ttn-lw-cli end-devices list-qr-formats
Output
{
  "formats": {
    "tr005": {
      "name": "LoRa Alliance TR005",
      "description": "Standard QR code format defined by LoRa Alliance.",
      "field_mask": {
        "paths": [
          "claim_authentication_code.value",
          "ids.dev_eui",
          "ids.join_eui"
        ]
      }
    }
  }
}

The paths object from the output shows the end device fields that are used to generate the QR code.

Generate an Identification QR Code

To generate a QR code to help you easily identify your device:

ttn-lw-cli end-devices generate-qr <application-id> <device-id> --format-id <qr-code-format>

The generated QR code will automatically be saved to the current directory with the device ID as a file name, in PNG format with a default size of 300 pixels. Use the --folder and --size flags to change the save location and image size.

Example of a generated identification QR code
Device QR Code for Identification

If you scan the generated identification QR code, you will see that it stores the information in the following format: LW:<schema-id>:<join-eui>:<dev-eui>:<profile-id>.

The SchemaID value will be D0 as it is the only device schema version described by the LoRaWAN Device Identification QR Codes for Automated Onboarding Technical Recommendation (TR005).

The ProfileID encodes a VendorID, assigned by the LoRa Alliance prior to commercial production of a device, and a VendorProfileID, assigned by the device manufacturer for commercial products. Read more in the TR005 document.

For the example identification QR code presented above, the stored information is: LW:D0:0000000000000000:1122334455667789:00000000.

Generate a Claiming QR Code

Device claiming is a mechanism to transfer devices securely from one application to another. For example, from a device maker to a device owner, or transferring ownership to a new device owner. Learn all about claiming in the Device Claiming section.

To generate a QR code for claiming, you first need to make your device claimable.

When a device is claimable (it contains a claim authentication code), you can use the same command as above to generate a QR code:

ttn-lw-cli end-devices generate-qr <application-id> <device-id> --format-id <qr-code-format>
Example of a generated claiming QR code
Device QR Code for Claiming

If you scan the generated claiming QR code, you will see that it stores the information in the following format: LW:<schema-id>:<join-eui>:<dev-eui>:<profile-id>:<claim-authentication-code>. One can notice that all fields are just the same as described above, only with a claim authentication code appended at the end.

For the example claiming QR code presented above, the stored information is: LW:D0:0000000000000000:1122334455667789:00000000:OABCD, where ABCD is device’s claim authentication code. The O in OABCD stands for OwnerToken according to the LoRaWAN Device Identification QR Codes for Automated Onboarding Technical Recommendation (TR005).

After you have generated the QR claiming code for your end device, follow the instructions to claim your device.

← Assigning EUIs The Things Node →

On this page

  • List QR Code Formats
  • Generate an Identification QR Code
  • Generate a Claiming QR Code

The Things Stack

Getting Started

Devices

Gateways

Integrations

Reference

Contributing

GitHub

Forum

About Us

The Things Network

The Things Industries

About this page

Last changed by Nejra Selimović on 22 Apr 2022.
doc: Improve QR and claiming docs (#854)

Edit on Github