Skip to content

Provisioning Your First Device

This tutorial walks through the complete lifecycle of a new manufacturing device: from verifying it exists in the PMS, provisioning it, and finally claiming it into the Fleet Manager.

What you will do

  1. Confirm the device is not yet in the system
  2. Provision the device to a customer
  3. Verify the output configuration file
  4. Claim the device into the Fleet Manager

Prerequisites

  • tlm-cli installed and configured (see Getting Started)
  • A valid customer code on the instance (use tlm-cli admin customers list to find one)
  • A device serial number to provision

Step 1 — Confirm the device does not exist yet

Before provisioning, check whether the serial number is already registered:

tlm-cli pms devices show SN-001234

If the command reports "Device 'SN-001234' not found.", you are ready to provision. If the device detail is displayed instead, it already exists — skip to Step 3 below to retrieve its configuration file, or see Provision a Device for the unprovision workflow.

Step 2 — Preview and provision the device

Always run a --dry-run first to check inputs without making any changes:

tlm-cli pms provisioning provision SN-001234 --customer ACME --dry-run

You will see a table showing: Serial Number, Customer, resolved Tenant ID, planned Config Path, and whether the Device Exists. If everything looks correct, provision for real:

tlm-cli pms provisioning provision SN-001234 --customer ACME

By default the agent configuration file is written to:

./SN-001234/agent.env

Use --output-dir to write it elsewhere:

tlm-cli pms provisioning provision SN-001234 --customer ACME --output-dir /opt/device-configs

Step 3 — Verify the configuration file

Inspect the generated file:

cat ./SN-001234/agent.env

It contains the connection parameters the on-board device agent needs:

# Configuration file for SN-001234. Place into /opt/connhex/configs/

CONNHEX_AGENT_LICENSE_AGENT_HOST=https://registry.compiuta.com
CONNHEX_AGENT_INIT_HOST=https://apis.your-instance.example.com
CONNHEX_AGENT_INIT_ID=SN-001234
CONNHEX_AGENT_INIT_KEY=<init-key>

Copy this file to the device at /opt/connhex/configs/agent.env.

Step 4 — Verify the device in PMS

Confirm the device is now registered:

tlm-cli pms devices show SN-001234

Press D to toggle the detail view and verify the Provisioned field shows ✓.

Step 5 — Claim the device into the Fleet Manager

Once provisioned, the device can be claimed into the Fleet Manager so it appears in the operational fleet:

tlm-cli fm devices claim SN-001234 --name "Gateway-001234"

Verify the claim succeeded:

tlm-cli fm devices show SN-001234

What you have accomplished

  • Provisioned a new device and assigned it to a customer tenant
  • Written the agent configuration file ready for deployment
  • Claimed the device into the Fleet Manager

Next steps