After the device tag sample runs, you can view tag reporting logs on the device. In the IoT Platform console, you can also view device tag information and tag reporting logs.
Prerequisites
The C Link SDK device tag sample is configured. For more information, see Use the sample.
Device logs
You can view the results on the device.-
Connection logs:
The following logs indicate that the device is connected to IoT Platform.[1626674158.155][LK-0313] MQTT user calls aiot_mqtt_connect api, connect [1626674158.155][LK-0317] LightSwitch&a1wP****** [1626674158.155][LK-0318] 613F70F16BC4C08B7FDC5BA2F9698B37B428B1C3BF5E1F0E4DAFE9B3EA****** core_sysdep_network_establish host iot-06******.mqtt.iothub.aliyuncs.com port 443, type 0 establish tcp connection with server(host='iot-06******.mqtt.iothub.aliyuncs.com', port=[443]) success to establish tcp, fd=3 local port: 32774 [1626674158.177][LK-1000] establish mbedtls connection with server(host='iot-06******.mqtt.iothub.aliyuncs.com', port=[443]) [1626674158.244][LK-1000] success to establish mbedtls connection, (cost 44947 bytes in total, max used 47859 bytes) [1626674158.244][LK-0319] a1wP******.LightSwitch|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=2,signmethod=hmacsha256,ext=3,_conn=tls_5b| [1626674158.299][LK-0313] MQTT connect success in 145 ms AIOT_MQTTEVT_CONNECT -
Update device tags:
- Acknowledgement logs:
[1626674158.355][LK-0309] pub: /sys/a1wP******/LightSwitch/thing/deviceinfo/update_reply [LK-030A] < 7B 22 63 6F 64 65 22 3A 32 30 30 2C 22 64 61 74 | {"code":200,"dat [LK-030A] < 61 22 3A 7B 7D 2C 22 69 64 22 3A 22 31 22 2C 22 | a":{},"id":"1"," [LK-030A] < 6D 65 73 73 61 67 65 22 3A 22 73 75 63 63 65 73 | message":"succes [LK-030A] < 73 22 2C 22 6D 65 74 68 6F 64 22 3A 22 74 68 69 | s","method":"thi [LK-030A] < 6E 67 2E 64 65 76 69 63 65 69 6E 66 6F 2E 75 70 | ng.deviceinfo.up [LK-030A] < 64 61 74 65 22 2C 22 76 65 72 73 69 6F 6E 22 3A | date","version": [LK-030A] < 22 31 2E 30 22 7D | "1.0"} pk: a1wP******, dn: LightSwitch, code: 200, msg id: 1, data: {}, message: success
- Acknowledgement logs:
-
Delete device tags:
-
Request logs:
[1626687770.800][LK-0309] pub: /sys/a1wP******/LightSwitch/thing/deviceinfo/delete [LK-030A] > 7B 22 69 64 22 3A 22 31 22 2C 22 76 65 72 73 69 | {"id":"1","versi [LK-030A] > 6F 6E 22 3A 22 31 2E 30 22 2C 22 70 61 72 61 6D | on":"1.0","param [LK-030A] > 73 22 3A 5B 7B 22 61 74 74 72 4B 65 79 22 3A 22 | s":[{"attrKey":" [LK-030A] > 74 65 73 74 4B 65 79 22 7D 5D 7D | testKey"}]} aiot_devinfo_send delete msg id: 1 - Acknowledgement logs:
[1626687770.844][LK-0309] pub: /sys/a1wP******/LightSwitch/thing/deviceinfo/delete_reply [LK-030A] < 7B 22 63 6F 64 65 22 3A 32 30 30 2C 22 64 61 74 | {"code":200,"dat [LK-030A] < 61 22 3A 7B 7D 2C 22 69 64 22 3A 22 31 22 2C 22 | a":{},"id":"1"," [LK-030A] < 6D 65 73 73 61 67 65 22 3A 22 73 75 63 63 65 73 | message":"succes [LK-030A] < 73 22 2C 22 6D 65 74 68 6F 64 22 3A 22 74 68 69 | s","method":"thi [LK-030A] < 6E 67 2E 64 65 76 69 63 65 69 6E 66 6F 2E 64 65 | ng.deviceinfo.de [LK-030A] < 6C 65 74 65 22 2C 22 76 65 72 73 69 6F 6E 22 3A | lete","version": [LK-030A] < 22 31 2E 30 22 7D | "1.0"} pk: a1wP******, dn: LightSwitch, code: 200, msg id: 1, data: {}, message: success
-
IoT Platform logs
You can view the tag information and related logs reported by the device in the IoT Platform console.
-
In the left-side navigation pane, choose . Find your device and check its status. A status of Online indicates that the device is successfully connected to IoT Platform.
-
Tag information: In the device list, click View for the device to go to the Device Details page and view tag information.
-
Operational logs: In the navigation pane on the left, choose . Select a product. Then, view logs for tags that are reported or deleted after the device goes online.
What to do next
If an error message appears in the operational logs, see the status code descriptions in aiot_devinfo_api.h to resolve the issue.