Advanced Capability Issues

更新时间:
复制 MD 格式

This topic describes common issues and solutions when you use the advanced features of C-Link SDK v3.x and v2.3.0.

Background information

If you have not yet connected to IoT Platform, use the latest version of the SDK. For more information, see Overview.

What causes the error "_iotx_linkkit_upstream_sync_callback_list_remove(158): Message Found: 3, Delete It" when a sub-device connects?

This error occurs because a blocking operation in the callback function prevents the SDK's internal API from retrieving the required data to bring the sub-device online. Check your callback function to ensure that it does not contain any blocking operations.

After a gateway goes offline, its sub-devices also go offline automatically. Why don't the sub-devices automatically come online when the gateway comes back online?

Sub-devices connect to IoT Platform through a gateway proxy. When the gateway goes offline, the sub-devices also go offline automatically.

Gateways and sub-devices have different reconnection mechanisms and use different methods to come back online.

  • A gateway device is a directly connected device that establishes a persistent connection with IoT Platform. The default reconnection mechanism in the SDK allows the device to automatically reconnect to IoT Platform if the connection is lost under specific conditions.
  • Sub-devices go online and offline by calling the logon and logoff APIs and do not connect directly to IoT Platform. You must implement the reconnection logic for sub-devices. For example:
    1. Detect that the gateway is offline in the callback for a disconnected MQTT persistent connection.
    2. After the gateway goes offline, the sub-devices also go offline.
    3. When the gateway successfully reconnects, call the logon API from the MQTT persistent connection callback to bring the sub-devices back online asynchronously.

Why is the process of bringing sub-devices online slow when there are many of them?

SDK v3.x and v2.3.0 bring sub-devices online sequentially. Therefore, the registration or online process is slow for many sub-devices.

The latest version of the SDK supports bringing sub-devices online in batches. We recommend that you use the latest version of the SDK. For more information, see Gateways and sub-devices.

How do I resolve the error "The resource count exceeds limit, cur 255, max 255" when bringing a sub-device online?

This error indicates that the number of registered topics for the sub-device has reached the limit. To resolve this issue, modify the code in the following two locations:

  • ./src/protocol/coap/local/CoAPServer.c: param.res_maxcount = 255.
  • ./src/protocol/coap/local/CoAPExport.h file, in the CoAPInitParam struct, change the type of res_maxcount to unsigned int.