我正在运行一个永久脚本,使用以下命令将数据从树莓派 3 发送到 azure-iot-hub,root@raspberrypi3:~# forever start /home/pi/azure/iam/ble_azure.js
工作了大约 1.5 天后,我停止在 auzre-iot-hub 收到消息,当我检查永久列表时,我得到以下信息:
root@raspberrypi3:~# forever list
info: Forever processes running
data: uid command script forever pid id logfile uptime
data: [0] NWgI /usr/bin/nodejs /home/pi/azure/iam/ble_azure.js 8990 3784 /root/.forever/NWgI.log 0:21:17:38.742
当我检查日志文件时,我收到以下错误消息:
/home/pi/azure/iam/node_modules/applicationinsights/AutoCollection/Exceptions.js:27
throw error;
^
NotConnectedError: mqtt.js returned client disconnecting error
at translateError (/home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-translate-error.js:25:11)
at MqttTwinReceiver._handleError (/home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-twin-receiver.js:201:42)
at /home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-twin-receiver.js:64:18
at MqttClient._checkDisconnecting (/home/pi/azure/iam/node_modules/mqtt/lib/client.js:314:7)
at MqttClient.subscribe (/home/pi/azure/iam/node_modules/mqtt/lib/client.js:423:12)
at /home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-twin-receiver.js:62:22
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
error: Forever detected script exited with code: 7
error: Script restart attempt #34
state has changed poweredOn
started scanning
[IoT hub Client] Connect error: mqtt.js returned premature close error
通过日志文件,mqtt错误不断发生多次并永远成功处理,我不明白为什么1.5天后,我得到这个错误:
**error: Forever detected script exited with code: 7
error: Script restart attempt #34**
还有为什么我一直收到这样的 mqtt 错误,为什么它一直断开连接?
**NotConnectedError: mqtt.js returned client disconnecting error**
Forever --version
v0.15.3
root@raspberrypi3:~# uname -a
Linux raspberrypi3 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
谢谢