Activate a Device
Prerequisities
The device must be registered in the Profiles or IAM Service before activating in Trimble IoT. The UUID identifier of the device from Profiles or IAM is needed to activate the device in IoT.
!!!Note Its recommended to activate device in IAM group.
Device Activation in PROFILES
-
Create a device in Profiles
-
Associate the device to a group using “in” query parameter.
-
Create a certificate by adding certCommonName.
Sample request
curl --location '<ProfilesBaseUrl>/profiles/devices?in=trn%253Aprofiles%253Agroups%253Ae79b51ce-5b1f-4a61-8bf2-05dd96e8353e' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer <token>' \--data '{"name" : "1000068321","serialNumber" : "1000068321","certCommonName" : "Device2-Cert","manufacturer" : "Trimble","model" : "IoT"}
-
-
Activate a group in Trimble IoT using the Groups API.
-
(recommended) Check Group and Device creation status before proceeding to activation in Trimble IoT API to prevent unexpected Forbidden error.
Device activation workflow for multiple devices across groups
In IoT, devices associated to a physical device can be activated within various groups.
Consider two devices, ‘Device A’ and ‘Device B’, both linked to a physical device ‘Physical Device 1’. In the past, these devices could only be activated within a single group. However, they can now be independently assigned to two distinct groups: Group A and Group B.
The following process outlines the procedure to set up this configuration using Profiles and IoT.
Workflow
- Create groups in Profiles - ‘Group A’ and ‘Group B’.
- Activate groups in IoT - ‘Group A’ and ‘Group B’.
- Create a device identity for ‘Physical Device 1’ in Profiles.
- In Profiles, provision the device ‘Device A’ and associate it with ‘Group A’ and Physical Device 1.
- In Profiles, provision the device ‘Device B’ and associate it with ‘Group B’ & Physical Device 1.
- Activate the device ‘Device A’ in IoT with ‘Group A’.
- Activate the device ‘Device B’ in IoT with ‘Group B’.
Device Activation in IAM
-
Create a device in IAM
-
Associate the device to a group using “groupId” query parameter.
curl --location'<IAMBaseUrl>/devices?groupId=7ff296ae-5294-4d55-8167-9e47cd0dcb5d' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'Authorization: ••••••' \--data '{"serialNumber": "98793","manufacturer": "Trimble","model": "IOT","firmware": "testFirmware","description":"description about the device"}'
-
-
Associate Device with Certificate
curl --location'{IAMBaseUrl}/devices/{deviceId}/certificates' \--header 'Authorization: Bearer {token}\--header 'Content-Type: application/json' \--data '{"certCommonName":"Device1223-cert"}' -
Activate group in Trimble IoT using Groups API.
Activate a device in IoT
- To activate a device, refer to the Device API
Update device custom policy
The following steps provide instructions for attaching a custom policy to an AWS Device.
-
Disable Open Policy in Groups.
- Set Group OpenPolicy to false using the Update Group Policy API.
-
Add Custom Policy to Devices. Using Device Custom Policy API, define the topicSuffixes to which the device has to publish and subscribe. By default, all the topicSuffixes will be prefixed with groupId.
Bootstrap provisioning workflow
Optionally, you can configure devices to automatically activate in IoT when it turns ON for the first time or comes back online using the Device Bootstrap service. Refer to the Device Bootstrap to get started. The create an operational certificate step in the device bootstrap workflow internally activates the Device in IoT or updates the device certificate due for renewal.
Device in PROFILES
Prerequisites
-
Create a device in Profiles.
- Associate the device to a group using “in” query parameter.
Sample request
curl --location '<ProfilesBaseUrl>/profiles/devices?in=trn:profiles:groups:e78b51ce-5b1f-4a61-8ef2-05dd96e8353e' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer <token>' \--data '{"name" : "1000068321","serialNumber" : "1000068321","manufacturer" : "Trimble","model" : "IoT"} -
Activate a group in Trimble IoT using Groups API.
While using Bootstrap service for provisioning, it is not mandatory to create a certificate for a device (Do not provide ‘certCommonName’).
Device in IAM
Prerequisites
-
Create a device in IAM Service
-
Associate the device to a group using “groupId” query parameter.
curl --location '<IAMBaseUrl>/devices?groupId=7ff296ae-5294-4d55-8167-9e47cd0dcb5d' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'Authorization: ••••••' \--data '{"serialNumber": "98793","manufacturer": "Trimble","model": "IOT","firmware": "testFirmware","description":"description about the device"}'
-
-
Activate group in Trimble IoT using Groups API.
While using Bootstrap service for provisioning, it is not mandatory to create a certificate for a device (Do not provide ‘certCommonName’).