简体   繁体   English

mqtt设备定期断开连接

[英]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.

相关问题 无法使用 MQTT 从 esp8266 向 Raspberry (Broker) 发送发布消息。 获取套接字错误<Random Device Id> , 断开 - Unable to send publish messages from esp8266 to Raspberry (Broker) using MQTT. Getting Socket Error <Random Device Id>, Disconnecting 使用 MQTT 进行设备通信 - Device communication using MQTT MQTT客户端不断与Bluemix IOT Foundation断开连接 - MQTT client keeps disconnecting from Bluemix IOT Foundation Apache Camel PAHO MQTT 组件断开连接后收不到消息 - Apache Camel PAHO MQTT component does not receive messages after disconnecting 在Android的多个活动中使用MQTT,而无需断开连接并再次连接 - Using MQTT in multiple activities of Android without disconnecting and connecting again M2MQTT客户端断开连接,没有异常或错误消息 - M2MQTT client disconnecting without an exception or error message python中mqtt如何交替连接和断开切换 - how to switch between connecting and disconnecting alternatingly mqtt in python M2MQTT 在发布时与 Azure IoT 中心断开连接 - M2MQTT Disconnecting from Azure IoT Hub on Publish 为什么MQTT快速连接到主机后仍然断开连接 - Why does MQTT keep disconnecting after it connects to a host on swift Mqtt 代理经常断开连接,即使它具有唯一的客户端 ID - Mqtt broker is disconnecting frequently even though it has a unique client id
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM