FAQ about running the Link SDK
This topic describes common issues and solutions for using the Link SDK.
What environments does the Link SDK support?
The Link SDK is cross-platform. You can port it to your target platform. The recommended development environment is Ubuntu 16.04.
How much RAM does the Link SDK use?
For data transmission over the Message Queuing Telemetry Transport (MQTT) protocol with mbedTLS, the Link SDK uses 35 KB of RAM: 8 KB for the stack and 27 KB for the heap.
For the CCP protocol, the Link SDK uses 45 KB of RAM: 32 KB for the stack and 13 KB for the heap. To reduce stack usage, modify the following two macros:
#define TOPIC_MAX_NUM 64: The maximum number of topics. If your device subscribes to fewer topics, change this to a smaller value, such as 16.#define TOPIC_MAX_LEN 128: The maximum length of a topic name. If the topic names for your device subscriptions are short, change this to a smaller value, such as 32.
What are the prerequisites for running the Link SDK?
The main prerequisite for running the Link SDK is support for the TCP/IP protocol stack.
Is porting to the FreeRTOS operating system supported?
FreeRTOS is supported for connecting to Alibaba Cloud IoT Platform. For example, Wi-Fi modules from Espressif use FreeRTOS. For more information, see the open source code from Espressif: FreeRTOS porting reference code.
How do I use the FreeRTOS system on an ECS instance?
Import an image.
Is Keil supported?
The Link SDK does not directly support development in the Keil environment. However, after you configure the software development kit (SDK) features, you can add the extracted code to an existing Keil project. You can also cross-compile the code to generate a destination library for your Keil project to call.
How do I enable SDK logging?
Call the function where you want to view logs. The functions are described below.
IOT_OpenLog: Starts log printing. It accepts a
const char *as an input parameter to specify the module name.IOT_SetLogLeve: Sets the log level. The input parameter is a number from 1 to 5. A higher number produces a more detailed log.
IOT_CloseLog: Stops log printing. It has no input parameters.
IOT_DumpMemoryStats: Prints memory usage statistics. The input parameter is a number from 1 to 5. A higher number produces a more detailed log.
Is multithreading supported?
The IOT_*() APIs are process-level. They support only single-process, single-threaded use. Concurrent re-entry from different threads in the same process is not supported.
How is data transmission security ensured?
The link between a device and the server-side can be encrypted with TLS. Authentication uses the device certificate information (productKey, deviceName, and deviceSecret). Any error causes authentication to fail.
Can one device certificate be used for multiple devices?
No. A device certificate can be used for only one device connection.
What is the cause of the "err log: [error]rate limiter" error?
The device is being rate-limited. The data reporting limit for a single device is 30 messages per second for Quality of Service (QoS) 0 and 10 messages per second for QoS 1. When a device is rate-limited, its reported data is discarded.
What should I do if more than 1,000 devices subscribe to the same broadcast topic?
A broadcast topic supports up to 1,000 subscribers. If you have more than 1,000 devices, group them into sets of 1,000 or fewer. For example, for 5,000 devices, create 5 groups and call the broadcast API 5 times to send the message.
Can a device subscribe to another device's topic?
A device can only subscribe to and publish its own topics. To enable communication between two devices, use one of the following two methods:
Device-to-device communication based on message forwarding
Device-to-device communication based on topic message routing
How do I format a broadcast message topic?
The broadcast topic format is: /broadcast/productKey/xxxx.
Are broadcast messages only for online devices?
Broadcast topics use a default QoS level of 0, which you cannot change. Therefore, only online devices can receive broadcast messages.
Why does my application fail to run on a Linux development board after I configure CMakeLists.txt for C Link SDK Extended and compile with make -j?
The cross compiler is configured incorrectly. It does not match the one required by your Linux development board.
In the
CMakeLists.txtfile, replacearm-linux-gnueabihf-gccin the following code with the cross compiler that matches your Linux development board.set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)The required library files were not copied to the Linux development board.
Copy the library files from the compilation output directory
./output/lib/to your Linux development board's system.
For more information, see Environment requirements and configuration.