When a device is connected to IoT Platform, the device is in the Online state. When a device is disconnected from IoT Platform, the device is in the Offline state.
Connect a device to IoT Platform
Develop a device and connect the device to IoT Platform.
- Develop the device.
IoT Platform provides device SDKs in multiple programming languages. These SDKs encapsulate protocols for communication between devices and IoT Platform. For more information about using a device SDK, see Download device SDKs.
When developing a device, configure the identity information of the device. The identity information is used to authenticate the device when it connects to IoT Platform.
IoT Platform supports the following methods for the authentication of devices that are directly connected:
- Unique-certificate-per-device authentication: This method requires that each device has a unique device certificate installed in advance. The device certificate includes the ProductKey, DeviceName, and DeviceSecret of the device.
- Unique-certificate-per-product authentication: This method allows you to install the same firmware (a product certificate including ProductKey and ProductSecret) on all devices of a product. Then, you can use the product certificate to perform device authentication. To use this method, you need to enable dynamic device registration on the Product Details page of the product. When a device initiates a connection request, IoT Platform verifies the product certificate. After the authentication is passed, IoT Platform assigns the corresponding DeviceSecret to the device.
- Install the device SDK to the device.
- Power on the device, connect the device to the network, and then the device connects to IoT Platform.
Disconnect a device from IoT Platform
After a device is disconnected from IoT Platform, the status of the device in IoT Platform is Offline. Two types of device disconnection are available.
- Active disconnection: a device disconnects from IoT Platform.
- Forcible disconnection: IoT Platform disconnects from the device. For example, if another device uses the same device certificate to access IoT Platform, the current device is forced to disconnect from IoT Platform. A forcible disconnection also occurs when you have deleted or disabled the device in IoT Platform.