[英]mqtt device regularly disconnecting
MQTT elements in my Node-RED canvas won't stay connected to a device. 我的Node-RED画布中的MQTT元素将不会保持与设备的连接。 If I add a single MQTT element, it will connect every 15 to 18 seconds for approximately 1 second (sometimes up to 10 seconds) before it disconnects.
如果我添加一个MQTT元素,它将在断开连接之前每隔15到18秒连接大约1秒(有时长达10秒)。 For example here is an extract from the device log.
例如,这是设备日志的摘录。
Token auth succeeded: ClientID='d:pw2bfk:temperature:tempfrontdoor', ClientIP=198.11.231.56 13 Aug 2016 7:53:03 pm
Token auth succeeded: ClientID='d:pw2bfk:temperature:tempfrontdoor', ClientIP=198.11.231.56 13 Aug 2016 7:52:47 pm
Token auth succeeded: ClientID='d:pw2bfk:temperature:tempfrontdoor', ClientIP=198.11.231.56 13 Aug 2016 7:52:41 pm
Token auth succeeded: ClientID='d:pw2bfk:temperature:tempfrontdoor', ClientIP=198.11.231.56 13 Aug 2016 7:52:36 pm
Token auth succeeded: ClientID='d:pw2bfk:temperature:tempfrontdoor', ClientIP=198.11.231.56 13 Aug 2016 7:52:21 pm
Closed connection from 198.11.231.56. The client ID was reused. 13 Aug 2016 7:52:20 pm
I am sure there is a simple issue causing the problem. 我确信有一个简单的问题导致了这个问题。 I've spent many hours to no avail.
我花了很多时间无济于事。
Here is the Node-RED canvas -> https://motion.mybluemix.net/red/# 这是Node-RED画布 - > https://motion.mybluemix.net/red/#
This happens because you have multiple devices using the same MQTT Client ID. 发生这种情况是因为您有多个设备使用相同的MQTT客户端ID。 If you use MQTT 3.1, make sure each device has unique ID.
如果使用MQTT 3.1,请确保每个设备都具有唯一ID。 For MQTT 3.1.1, either make it unique or don't specify it, so that it will be auto-generated.
对于MQTT 3.1.1,要么使其唯一,要么不指定它,以便自动生成它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.