This module handles the registration and management of the devices. These devices are mapped to the physical end-devices sending data to the server. We will demonstrate how to manage a device on the UCW IoT Platform.
Table of Contents
1.0 Device panel
To start, navigate to project panel (Projects → Manage Projects → Browse)
Select Devices under Device Management section in the menu sidebar, as shown below.
You should see the registered devices if they are any:
1.1 Register a device
To register a device, click on the Add Device button located on the top right of the page.
A dialog box appears for the user to provide desired device information such as name, type, and description of the device. Other information about the physical device, such as the serial number of the device, can be provided.
If the device has been successfully added, your screen should look like this:
1.2 Device properties
These are the information used to describe a device. Apart from the deviceId, all other device properties are provided by the end-user. The major properties are briefly explained below:
- Device ID - It uniquely identifies each device across all projects. The server automatically generates it. The user uses it in the firmware for each end device.
- Name - The user provides a unique name to identify the device. It is similar in function to the Device ID, but it's defined by the user. The name is unique within the project, and Device ID is unique across all projects.
- Type - Specifies the device type such as Arduino, RaspberryPi, Particle, etc.
- State - A device has to be Enabled to be active for data and command processing. It can be changed in the device properties by checking the Enable box in the Add/Edit device dialogue box.
- Status interval - Identifies the period, in seconds, after which the system confirms if the device is connected to the server still.
- Last connection - Identifies the last time when the device has been connected to the server.
1.3 Device actions
These are the operations that can be carried on a device. Currently, we have three action buttons: Edit, Remove, and Sensors.
- Edit - When the user clicks on this button, it provides a dialog box similar to that when you clicked on the Add Device button. You can make changes to the device information provided earlier. However, the Device ID and Device Type properties can not be edited once a device has been added.
- Remove - This button removes the device. It prompts a dialog box requiring the user to confirm if the device is to be removed.
- Sensors - Stores data of specific categories or types. For instance, temperature and humidity data values stored as sensor type DHT. It makes retrieval of data easy.
2.0 Sending data to the UCW IoT Platform
The deviceId of a device is required to send data to the UCW IoT Platform. This information is provided in the firmware, as shown below:
- Using UCW Arduino Library, the deviceId is provided in the sendData method. An example of this can be found here.
- If you are not using UCW Arduino Library, the deviceId is provided as part of the REST API endpoint. You can see the format below.
You can see an example here.