All Products
Search
Document Center

IoT Platform:MQTT dynamic registration operational logs

Last Updated:Jun 16, 2026

After running the MQTT dynamic registration sample code, you can view log information on the device.

Prerequisites

The sample code for the MQTT dynamic registration feature of the C Link SDK has been configured. For more information, see MQTT dynamic registration example.

Device logs

You can view the results on the device. If you only dynamically register a device, IoT Platform does not generate logs on the Simple Log Service page.

  • Registration request log:

    The following log shows a dynamic registration request from the device to IoT Platform.

    [1622428788.933][LK-0313] MQTT user calls aiot_mqtt_connect api, connect
    core_sysdep_network_establish host a18wP******.iot-as-mqtt.cn-shanghai.aliyuncs.com 443, type 0
    establish tcp connection with server(host='a18wP******.iot-as-mqtt.cn-shanghai.aliyuncs.com', port=[443])
    success to establish tcp, fd=3
    local port: 53828
    [1622428788.933][LK-1000] establish mbedtls connection with server(host='a18wP******.iot-as-mqtt.cn-shanghai.aliyuncs.com', port=[443])
    [1622428788.999][LK-1000] success to establish mbedtls connection, (cost 44947 bytes in total, max used 47859 bytes)
    [1622428789.166][LK-0313] MQTT connect success in 231 ms
  • Acknowledgement log:

    • If you use pre-registration, IoT Platform returns the following acknowledgement log:

      [LK-030A] < 7B 22 64 65 76 69 63 65  53 65 63 72 65 74 22 3A | {"deviceSecret":
      [LK-030A] < 22 30 66 34 38 31 32 31  65 38 63 62 35 35 63 36 | "0f48121e8cb55c6
      [LK-030A] < 35 65 66 62 61 37 65 30  33 66 37 39 38 37 62 65 | 5efba7e03f******
      [LK-030A] < 65 22 2C 22 70 72 6F 64  75 63 74 4B 65 79 22 3A | *","productKey":
      [LK-030A] < 22 67 37 68 30 66 6A 79  33 52 31 4F 22 2C 22 64 | "a18wP******","d
      [LK-030A] < 65 76 69 63 65 4E 61 6D  65 22 3A 22 4C 69 67 68 | eviceName":"Ligh
      [LK-030A] < 74 53 77 69 74 63 68 50  72 65 41 75 74 68 22 7D | tSwitch"}
      
      device secret: 0f48121e8cb55c65efba7e03f7******
      [1622429683.799][LK-1000] adapter_network_deinit
    • If you register the device without pre-registration, IoT Platform returns the following acknowledgement log:

      [LK-030A] < 7B 22 63 6C 69 65 6E 74  49 64 22 3A 22 34 66 34 | {"clientId":"4f4
      [LK-030A] < 61 71 59 78 44 43 4C 6B  6F 41 50 32 46 4B 4C 70 | aqYxDCLkoAP2FKLp
      [LK-030A] < 79 30 30 30 31 30 30 22  2C 22 70 72 6F 64 75 63 | y******","produc
      [LK-030A] < 74 4B 65 79 22 3A 22 67  37 68 30 66 6A 79 33 52 | tKey":"a18wP****
      [LK-030A] < 31 4F 22 2C 22 64 65 76  69 63 65 4E 61 6D 65 22 | **","deviceName"
      [LK-030A] < 3A 22 4C 69 67 68 74 53  77 69 74 63 68 22 2C 22 | :"LightSwitch","
      [LK-030A] < 64 65 76 69 63 65 54 6F  6B 65 6E 22 3A 22 5E 31 | deviceToken":"^1
      [LK-030A] < 5E 31 36 32 32 34 32 38  37 38 39 31 35 35 5E 32 | ^1622428789155^2
      [LK-030A] < 63 33 66 34 38 33 35 63  30 34 36 39 32 65 22 7D | c3f4835c******"}
      
      clientid: 4f4aqYxDCLkoAP2FKLpy******|authType=connwl,securemode=-2,_ss=1,ext=3,_v=sdk-c-4.1.0|
      username: LightSwitch&a18wP******
      password: ^1^1622428789155^2c3f4835c******
      [1622428789.166][LK-1000] adapter_network_deinit

What to do next

If an error message appears in the operational log, see aiot_dynregmq_api.h for status code descriptions to troubleshoot the error.