【安信可NB-IoT开发板EC-01F-Kit测评】03.讨论:设备入网后频繁掉线问题
本帖最后由 李百仪 于 2021-12-22 21:11 编辑<p style="text-align:justify"> </p>
<p style="text-align:justify"><strong>调试EC-01F MQTT接入阿里正常通信状态出现频繁断网又自动入网,天线已经换成4G吸盘高增益天线。请问什么原因导致?</strong></p>
<p style="text-align:justify"><strong>以下是调试Log:</strong></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CREG: 6</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//</font><font face="宋体">已注册到</font><font face="Calibri">"SMS only"</font><font face="宋体">网络</font><font face="Calibri">(</font><font face="宋体">仅适用于在</font><font face="Calibri"><AcT></font><font face="宋体">为</font><font face="Calibri">E-UTRAN</font><font face="宋体">时</font><font face="Calibri">)</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CEREG: 1</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//1 </font><font face="宋体">已注册到本地网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CREG: 0</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//0 </font><font face="宋体">没有注册网络, </font><font face="Calibri">MT</font><font face="宋体">没有搜索新的网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CEREG: 0</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//0 </font><font face="宋体">没有注册网络, </font><font face="Calibri">MT</font><font face="宋体">没有搜索新的网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CEREG: 2</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//2 </font><font face="宋体">没有注册网络, </font><font face="Calibri">MT</font><font face="宋体">正在搜索新的网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CREG: 6</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//6 </font><font face="宋体">已注册到</font><font face="Calibri">"SMS only"</font><font face="宋体">网络</font><font face="Calibri">(</font><font face="宋体">仅适用于在</font><font face="Calibri"><AcT></font><font face="宋体">为</font><font face="Calibri">E-UTRAN</font><font face="宋体">时</font><font face="Calibri">)</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CEREG: 1</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//</font><font face="宋体">已注册到本地网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTSTAT: 0,1<span style="color:#e74c3c">//+ECMTSTAT URC 消息, 报告链路层状态<err_code> 整型。 错误代码 err_code:1 连接已关闭或由对等方重置</span></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTCONN: 0,0,0<span style="color:#e74c3c;">//+ECMTCONN:<tcpconnectID>,<result>[,<ret_code>]result:0 发送数据成功, 并收到服务器的回复ret_code:0 连接服务器成功</span></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTSTAT: 0,1<span style="color:#e74c3c">//+ECMTSTAT URC 消息, 报告链路层状态<err_code> 整型。 错误代码 err_code:1 连接已关闭或由对等方重置</span></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTCONN: 0,0,0<span style="color:#e74c3c">//+ECMTCONN:<tcpconnectID>,<result>[,<ret_code>]result:0 发送数据成功, 并收到服务器的回复ret_code:0 连接服务器成功</span></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">AT+ECMTPUB=0,0,0,0,"/sys/a1KApkvNNDZ/EVN_2021_4_17/thing/event/property/post",{"params:{"temperature":33.8,"CO2":10.27},"method":"thing.event.property.post","id":1}</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">OK</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTPUB: 0,0,0</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTRECV: 0,0,"/sys/a1KApkvNN</font></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">DZ/EVN_2021_4_17/thing/event/pro</font></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">perty/post_reply",{"code":200,"d</font></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">ata":{},"id":"1","message":"succ</font></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">ess","method":"thing.event.prope</font></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">rty.post","version":"1.0"}</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTSTAT: 0,1<span style="color:#e74c3c">//+ECMTSTAT URC 消息, 报告链路层状态<err_code> 整型。 错误代码 err_code:1 连接已关闭或由对等方重置</span></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CREG: 0</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//0 </font><font face="宋体">没有注册网络, </font><font face="Calibri">MT</font><font face="宋体">没有搜索新的网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CEREG: 0</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//0 </font><font face="宋体">没有注册网络, </font><font face="Calibri">MT</font><font face="宋体">没有搜索新的网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CERE</font></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">G: 2</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//</font><font face="宋体">没有注册网络, </font><font face="Calibri">MT</font><font face="宋体">正在搜索新的网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CREG: 6</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//</font><font face="宋体">已注册到</font><font face="Calibri">"SMS only"</font><font face="宋体">网络</font><font face="Calibri">(</font><font face="宋体">仅适用于在</font><font face="Calibri"><AcT></font><font face="宋体">为</font><font face="Calibri">E-UTRAN</font><font face="宋体">时</font><font face="Calibri">)</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+CEREG: 1</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">//1 </font><font face="宋体">已注册到本地网络</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTCONN: 0,0,0<span style="color:#e74c3c">//+ECMTCONN:<tcpconnectID>,<result>[,<ret_code>]result:0 发送数据成功, 并收到服务器的回复ret_code:0 连接服务器成功</span></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTSTAT: 0,1<span style="color:#e74c3c;">//+ECMTSTAT URC 消息, 报告链路层状态<err_code> 整型。 错误代码 err_code:1 连接已关闭或由对等方重置</span></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri"></font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">+ECMTCONN: 0,0,0<span style="color:#e74c3c">//+ECMTCONN:<tcpconnectID>,<result>[,<ret_code>]result:0 发送数据成功, 并收到服务器的回复ret_code:0 连接服务器成功</span></font></span></span></span></span></p>
<p> </p>
是不是请求太多了,我这里用MQTT连于我的网络,很稳定!半天都没有掉线! lugl4313820 发表于 2021-12-19 21:08
是不是请求太多了,我这里用MQTT连于我的网络,很稳定!半天都没有掉线!
<p>PC通过AT指令测试的,连上没动,每隔一段时间掉线</p>
<p>是不是因为使用PC没有固定时间发送心跳造成的?</p>
annysky2012 发表于 2021-12-20 08:48
是不是因为使用PC没有固定时间发送心跳造成的?
<p>这个应用不用MCU维护心跳。</p>
<p>1.EC-01F支持MQTT协议,MCU只要操作EC-01F的MQTT配置即可:配置保活时间->AT+ECMTCFG="keepalive",0,30\r</p>
<p>2.如果MCU通过TCP搭建MQTT协议需要自己维护保活时间。</p>
李百仪 发表于 2021-12-20 08:37
PC通过AT指令测试的,连上没动,每隔一段时间掉线
<p>20 配置保活时间</p>
<p>AT+ECMTCFG="keepalive",0,30\r </p>
<p>你多偿试一下这个参数。</p>
<p> </p>
<div class='shownolgin' data-isdigest='no'><p>还有就是MQTT服务器也有规定,如果发送非法数据,或者太频繁,也会主动踢你下线。</p>
</div><script>showreplylogin();</script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <div class='shownolgin' data-isdigest='no'> 本帖最后由 李百仪 于 2021-12-20 14:23 编辑
<div class="quote">
<blockquote><font size="2"><a href="forum.php?mod=redirect&goto=findpost&pid=3111773&ptid=1189547" target="_blank"><font color="#999999">lugl4313820 发表于 2021-12-20 12:52</font></a></font> 还有就是MQTT服务器也有规定,如果发送非法数据,或者太频繁,也会主动踢你下线。</blockquote>
</div>
<p><span style="color:#000000;">1.在阿里云帮助文档搜索到:</span></p>
<p><span style="color:#000000;">心跳的时间间隔如何设置?</span></p>
<p><span style="color:#000000;">在IOT_MQTT_Construct里面可以设置keepalive_interval_ms的取值,物联网平台使用这个值来作为心跳间隔时间。keepalive_interval_ms的取值范围是60000~300000。</span></p>
<p><span style="color:#000000;">2.阿里云MQTT协议规范并未提到有这个限制</span><a href="https://help.aliyun.com/document_detail/30540.html" target="_blank"><span style="color:#000000;">https://help.aliyun.com/document_detail/30540.html</span></a><span style="color:#000000;">,我先配置到60+试试。</span></p>
<p><span style="color:#000000;">3.PC发指令调试,可以排除非法数据导致。</span></p>
<p><span style="color:#000000;">4.没用注册到网络跟这个问题有关系吗?</span></p>
<p> </p>
</div><script>showreplylogin();</script> <div class='shownolgin' data-isdigest='no'><p></p>
<p> </p>
<p>应该更MQTT保活时间配置没关系。</p>
</div><script>showreplylogin();</script> <div class='shownolgin' data-isdigest='no'>桨状天线的效果不好吗?为什么换成4G吸盘天线呢</div><script>showreplylogin();</script> <div class='shownolgin' data-isdigest='no'> 本帖最后由 李百仪 于 2022-1-20 16:17 编辑
<div class="quote">
<blockquote><font size="2"><a href="forum.php?mod=redirect&goto=findpost&pid=3118371&ptid=1189547" target="_blank"><font color="#999999">博安通 发表于 2022-1-20 14:47</font></a></font> 桨状天线的效果不好吗?为什么换成4G吸盘天线呢</blockquote>
</div>
<p>桨状天线室内效果不太好,几种天线都试了,问题一样</p>
<p><a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.1e142e8dKBDK6H&id=592809751730&_u=kmm6pvk7e2b" target="_blank">https://item.taobao.com/item.htm?spm=a1z09.2.0.0.1e142e8dKBDK6H&id=592809751730&_u=kmm6pvk7e2b</a></p>
<p>选的是2G/GSM/NB/6dBi/309mm馈线长度:2m</p>
</div><script>showreplylogin();</script>
页:
[1]