kishikawa_kit
2019年6月24日 23時09分
お世話になります。
Armadillo-IoT G3(Linux9)にて、電力量計からRS485通信で取得したデータをC用のAzure IoT device SDKを利用してAzure IoTへ送信するシステムを構築しています。
24時間監視で10分ごとに計測したデータをAzure IoTへ送信していますが、以下のエラーが発生したあとはシステムが停止し、再起動してもAzureとの通信を行いません。
「Sending Data~」は当システムが出力しているメッセージです。デバイスIDは伏字(XXXXXXXXXXXXXXXX)にしています。
「IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY」というエラーメッセージは初めて目にします。
エラーの原因と解決方法についてご教示いただけますと幸いです。
Jun 24 01:10:03 armadillo rms.sh[728]: Sending Data:1b 03 00 64 00 02 87 ee Jun 24 01:10:03 armadillo rms.sh[728]: Start sending data to Azure Jun 24 01:10:04 armadillo rms.sh[728]: Info: IoT Hub SDK for C, version 1.1.22 Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SetMessageCallback..essful. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [8] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [18] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [20] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [38] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [39] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [57] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [58] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: IoTHubClient_LL_SendEventAsync accepessage [76] for transmission to IoT Hub. Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 CONNECT | VER: 4 | KEEPA 240 | FLAGS: 192 | USERNAME: IoTHubArmdl001.azure-devices.net/HT-18-shibuyapi-version=2016-11-14&DeviceClientType=iothubclient%2f1.1.22%20(Linux%3b%27l) | PWD: XXXX | CLEAN: 0 Jun 24 01:10:04 armadillo rms.sh[728]: <- 01:10:04 CONNACK | SESSION_PRESENue | RETURN_CODE: 0x0 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 SUBSCRIBE | PACKET_ID: 2PIC_NAME: devices/XXXXXXXXXXXXXXXX/messages/devicebound/# | QOS: 1 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 3 | PAYLOAD_LEN: 76 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 4 | PAYLOAD_LEN: 76 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 5 | PAYLOAD_LEN: 78 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 6 | PAYLOAD_LEN: 77 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 7 | PAYLOAD_LEN: 77 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 8 | PAYLOAD_LEN: 78 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 9 | PAYLOAD_LEN: 78 Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 PUBLISH | IS_DUP: false AIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/XXXXXXXXXXXXXXXX/ges/events/%24.cid=CORE_ID&%24.mid=MSG_ID&%24.ct=application%2Fjson&%24.ce= | PACKET_ID: 10 | PAYLOAD_LEN: 78 Jun 24 01:10:04 armadillo rms.sh[728]: <- 01:10:04 SUBACK | PACKET_ID: 2 | N_CODE: 1 Jun 24 01:10:04 armadillo rms.sh[728]: <- 01:10:04 PUBACK | PACKET_ID: 3 Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[0] received for messageking id = 1 with result = IOTHUB_CLIENT_CONFIRMATION_OK Jun 24 01:10:04 armadillo rms.sh[728]: <- 01:10:04 PUBACK | PACKET_ID: 4 Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[1] received for messageking id = 1992534453 with result = IOTHUB_CLIENT_CONFIRMATION_OK Jun 24 01:10:04 armadillo rms.sh[728]: iothub_client_sample_mqtt has gotten message, call DoWork 8 more time to complete final sending... Jun 24 01:10:04 armadillo rms.sh[728]: -> 01:10:04 DISCONNECT Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[2] received for message Jun 24 01:10:04 armadillo rms.sh[728]: <- 01:10:04 PUBACK | PACKET_ID: 3 Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[0] received for message tracid = 1 with result = IOTHUB_CLIENT_CONFIRMATION_OK Jun 24 01:10:04 armadillo rms.sh[728]: <- 01:10:04 PUBACK | PACKET_ID: 4 Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[1] received for message tracid = 1992534453 with result = IOTHUB_CLIENT_CONFIRMATION_OK Jun 24 01:10:04 armadillo rms.sh[728]: iothub_client_sample_mqtt has gotten quitid = 1992502259 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[3] received for messageking id = 461431749 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[4] received for messageking id = 14419742 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[5] received for messageking id = 0 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY Jun 24 01:10:04 armadillo rms.sh[728]: Confirmation[6] received for messageking id = 6788 with result = IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY Jun 24 01:15:36 armadillo wpa_supplicant[1466]: nl80211: send_and_recv->nl_sgs failed: -33
コメント
kishikawa_kit
at_naomi.todori
2019年6月28日 17時01分
都鳥です。
下記のAzure IoT SDKのドキュメントを確認したところ、
https://github.com/Azure/azure-iot-sdk-c/blob/ae7871abe80e5633962473d3e…
「IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY」はIoTHubClient_Destroy()コール後、
ペンディングされているイベント(テレメトリ送信など)のコールバックに対し
渡されるステータスのようです。
また、ログに下記の記載が含まれています。
これより、IoTHubクライアントが何らかの切断メッセージを受け取っているのではと想定しています。