This topic describes how to use the IoT Platform software development kit (SDK) to develop cellular devices that use communication protocols, such as 2G, 3G, 4G, 5G, and Narrowband Internet of Things (NB-IoT), to connect to the IoT Platform.
Define a product in the IoT Platform
- Create a project.
For more information, see Create a project.
- Create a product.
- Add a test device.
For more information about how to add a test device and set the device binding policy, see Device debugging overview.
Device-side development
For more information about how to download the SDK without AliOS (based on Link Kit v2.3.0), see Get the SDK.
- Recommended SDK configurations
For information about the SDK configurations and the meaning of each option, see the "SDK trimming" section in Compilation instructions.
You can configure the required features by modifying make.settings or by running
make menuconfigin Linux.Feature Description FEATURE_MQTT_COMM_ENABLED y: Use MQTT to connect to Alibaba Cloud IoT Platform. FEATURE_MQTT_DIRECT y: Connect to servers in China.
n: Connect to servers outside China.
FEATURE_Device_MODEL_ENABLED y: Enable the Thing Specification Language model. FEATURE_ALCS_ENABLED n: Disable the local control feature. FEATURE_ALCS_SERVER_ENABLED n: Disable the local control feature for controlled devices. FEATURE_DEV_BIND_ENABLED n: Disable user binding features. FEATURE_SUPPORT_TLS y: Enable TLS encryption. FEATURE_OTA_ENABLED y: Enable OTA. If your device needs to connect to servers outside China, see Device development for Alibaba Cloud International Website.
- HAL adaptation
Implement the Hardware Abstraction Layer (HAL) by following these documents:
- Device identity authentication mode
When a device connects to the Alibaba Cloud IoT Platform, it can be authenticated using a pre-provisioned device certificate or using dynamic registration to obtain a complete device certificate. For more information, see Device authentication.
- Product feature implementation
Implement features on the device based on the product features defined in the cloud. For more information, see TSL model programming.
- OTA development
If you enabled the Over-the-Air (OTA) feature, see OTA programming.
- Device reset development
Design the product with a reset button that clears the device configuration, restores the device to factory settings, and calls the
awss_report_reset()function to notify the cloud to clear the binding between the device and the user.You must add a call to
awss_report_reset()in the logic that handles the reset button./* * After the application calls this API, Link Kit first stores a factory reset flag in the flash memory and reports the reset operation to the cloud. * If no reply is received from the cloud within a specified time (3 seconds), the device re-uploads the reset request until a reply is received. * Some products require the device to restart upon reset. If the reset operation is not successfully reported before the restart, after the next connection to the cloud, * the device first checks if the factory reset flag is set in the flash memory. If the flag is set, the device first reports the reset to the cloud until the operation succeeds. */ int awss_report_reset();