Device ID
The device ID is a unique identifier for your device. For devices onboarded to nRF Cloud, this ID must be unique across all other devices in nRF Cloud. Use it as the MQTT client ID if your device is using MQTT.
The recommended device ID format is a UUID. All nRF9160 SiPs have a factory generated UUID. See also Configuration options for device ID for details on configuring the device ID in your application firmware.
Nordic Semiconductor hardware products, such as the nRF9160 DK or Thingy:91,
ship with a device ID in the format of nrf-[IMEI], for example,
nrf-351358811330130. The IMEI is printed on the product's label. However, you
are not restricted to the nrf- format. To change the device ID, your device
requires new credentials and properly configured
application firmware.
Obtaining a UUID for the nRF9160
Obtaining a UUID for the nRF9160 requires modem firmware v1.3.x or later.
The nRF9160 contains a UUID which can be used as the nRF Cloud device ID (MQTT client ID).
Using an attestation token
The UUID is found in the device identity attestation token, which is a base64-encoded CBOR object. To request and parse an attestation token:
- Enter the
AT%ATTESTTOKENAT command. - Decode and parse the attestation token with the
modem_credentials_parser.py
Python script. The UUID is displayed in the script output on the line
starting
Dev UUID:. See the script documentation for additional details.
Using the KEYGEN command
You can parse the output of the
%KEYGEN
AT command using the modem_credentials_parser.py script to display the UUID.
Using JWT
The UUID is also included in JSON Web Tokens (JWTs) generated by the modem. To
generate a JWT, enter the
AT%JWT
AT command. Decode the Base64 output, where you can find the UUID in the
payload's "iss" claim after nRF9160.
Using libraries and application code
To find the UUID in your device's application code, use the Modem attestation token library or the Modem JWT library.