Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
at_device
MQTT
rtthread 使用paho mqtt 发送数据包畸形
发布于 2020-12-14 17:13:16 浏览:1609
订阅该版
paho-mqtt使用ec200t发送mqtt消息,偶尔在数据包头多了一个回车导致emqx判定数据包畸形被丢弃。 起因是发现偶尔有设备发送数据包后平台没有接收到,并且会触发一次设备mqtt上下线,查看日志发现是数据包有问题,对比正常数据包与异常的发现在数据包头多了一个十进制10,就是16进制的0x0a,就是回车符。 有哪位大神可以帮帮忙看下么。 错误数据包 ``` <<"003D0017-2034334D-0412FFFF">>@36.113.96.72:12434 [MQTT] RECV <<10,50,221,7,0,57,47,115,121,115,47,48,48,51,68,48,48,49,55,45,50,48,51,52,51,51,52,68,45,48,52,49,50,70,70,70,70,47,116,104,105,110,103,47,101,118,101,110,116,47,112,114,111,112,101,114,116,121,47,112,111,115,116,182,75,123,34,105,100,34,58,56,51,52,44,34,104,117,109,105,100,105,116,121,34,58,49,57,46,50,49,52,50,52,57,44,34,116,101,109,112,114,101,97,116,117,114,101,34,58,50,51,46,50,51,51,48,51,50,44,34,118,111,108,116,97,103,101,34,58,50,53,46,52,52,56,48,48,48,44,34,99,117,114,114,101,110,116,34,58,48,46,51,49,54,48,48,48,44,34,100,101,118,105,99,101,73,100,34,58,34,48,48,51,68,48,48,49,55,45,50,48,51,52,51,51,52,68,45,48,52,49,50,70,70,70,70,34,44,34,112,97,114,97,109,115,34,58,123,34,118,119,100,97,116,97,34,58,123,34,99,104,49,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,55,46,52,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,49,56,52,46,51,48,48,48,52,57,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,49,55,57,125,44,34,99,104,50,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,54,46,57,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,50,49,49,46,56,48,48,48,52,57,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,49,57,55,125,44,34,99,104,51,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,49,52,55,46,49,57,57,57,57,55,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,51,49,55,55,46,53,48,48,48,48,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,49,52,125,44,34,99,104,52,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,55,46,52,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,48,49,52,46,49,57,57,57,53,49,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,51,50,125,44,34,99,104,53,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,55,46,49,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,48,57,52,46,56,57,57,57,48,50,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,52,57,125,44,34,99,104,54,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,49,52,56,46,49,48,48,48,48,54,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,56,54,53,46,51,48,48,48,52,57,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,54,55,125,44,34,99,104,55,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,49,44,34,116,101,109,112,34,58,57,57,57,46,57,48,48,48,50,52,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,49,44,34,102,114,101,113,34,58,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,56,52,125,44,34,99,104,56,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,49,44,34,116,101,109,112,34,58,57,57,57,46,57,48,48,48,50,52,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,49,44,34,102,114,101,113,34,58,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,51,48,48,125,125,125>> 2020-12-14 16:58:21.257 [error] <<"003D0017-2034334D-0412FFFF">>@36.113.96.72:12434 [MQTT] Parse failed for function_clause [{emqx_frame,parse_packet,[{mqtt_packet_header,0,true,1,false},<<221,7,0,57,47,115,121,115,47,48,48,51,68,48,48,49,55,45,50,48,51,52,51,51,52,68,45,48,52,49,50,70,70,70,70,47,116,104,105,110,103,47,101,118,101,110,116,47,112,114>>,#{max_size => 1048576,strict_mode => false,version => 4}],[{file,"emqx_frame.erl"},{line,166}]},{emqx_frame,parse_frame,4,[{file,"emqx_frame.erl"},{line,144}]},{emqx_connection,parse_incoming,3,[{file,"emqx_connection.erl"},{line,522}]},{emqx_connection,handle_msg,2,[{file,"emqx_connection.erl"},{line,515}]},{emqx_connection,process_msg,3,[{file,"emqx_connection.erl"},{line,293}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,259}]}] Frame data:<<10,50,221,7,0,57,47,115,121,115,47,48,48,51,68,48,48,49,55,45,50,48,51,52,51,51,52,68,45,48,52,49,50,70,70,70,70,47,116,104,105,110,103,47,101,118,101,110,116,47,112,114,111,112,101,114,116,121,47,112,111,115,116,182,75,123,34,105,100,34,58,56,51,52,44,34,104,117,109,105,100,105,116,121,34,58,49,57,46,50,49,52,50,52,57,44,34,116,101,109,112,114,101,97,116,117,114,101,34,58,50,51,46,50,51,51,48,51,50,44,34,118,111,108,116,97,103,101,34,58,50,53,46,52,52,56,48,48,48,44,34,99,117,114,114,101,110,116,34,58,48,46,51,49,54,48,48,48,44,34,100,101,118,105,99,101,73,100,34,58,34,48,48,51,68,48,48,49,55,45,50,48,51,52,51,51,52,68,45,48,52,49,50,70,70,70,70,34,44,34,112,97,114,97,109,115,34,58,123,34,118,119,100,97,116,97,34,58,123,34,99,104,49,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,55,46,52,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,49,56,52,46,51,48,48,48,52,57,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,49,55,57,125,44,34,99,104,50,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,54,46,57,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,50,49,49,46,56,48,48,48,52,57,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,49,57,55,125,44,34,99,104,51,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,49,52,55,46,49,57,57,57,57,55,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,51,49,55,55,46,53,48,48,48,48,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,49,52,125,44,34,99,104,52,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,55,46,52,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,48,49,52,46,49,57,57,57,53,49,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,51,50,125,44,34,99,104,53,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,55,46,49,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,48,57,52,46,56,57,57,57,48,50,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,52,57,125,44,34,99,104,54,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,49,52,56,46,49,48,48,48,48,54,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,56,54,53,46,51,48,48,48,52,57,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,54,55,125,44,34,99,104,55,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,49,44,34,116,101,109,112,34,58,57,57,57,46,57,48,48,48,50,52,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,49,44,34,102,114,101,113,34,58,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,50,56,52,125,44,34,99,104,56,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,49,44,34,116,101,109,112,34,58,57,57,57,46,57,48,48,48,50,52,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,49,44,34,102,114,101,113,34,58,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,51,54,51,48,48,125,125,125>> ``` 正常数据包 ``` 2020-12-14 13:52:17.103 [debug] <<"003D0017-2034334D-0412FFFF">>@117.132.195.87:50011 [MQTT] RECV <<50,208,7,0,57,47,115,121,115,47,48,48,51,68,48,48,49,55,45,50,48,51,52,51,51,52,68,45,48,52,49,50,70,70,70,70,47,116,104,105,110,103,47,101,118,101,110,116,47,112,114,111,112,101,114,116,121,47,112,111,115,116,182,75,123,34,105,100,34,58,55,57,56,44,34,104,117,109,105,100,105,116,121,34,58,49,56,46,51,48,54,51,53,49,44,34,116,101,109,112,114,101,97,116,117,114,101,34,58,50,52,46,50,56,51,57,56,49,44,34,118,111,108,116,97,103,101,34,58,50,50,46,55,49,56,48,48,48,44,34,99,117,114,114,101,110,116,34,58,48,46,50,56,49,48,48,48,44,34,100,101,118,105,99,101,73,100,34,58,34,48,48,51,68,48,48,49,55,45,50,48,51,52,51,51,52,68,45,48,52,49,50,70,70,70,70,34,44,34,112,97,114,97,109,115,34,58,123,34,118,119,100,97,116,97,34,58,123,34,99,104,49,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,57,46,51,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,49,56,52,46,53,48,48,48,48,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,48,49,50,125,44,34,99,104,50,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,56,46,57,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,50,49,49,46,54,48,48,48,57,56,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,48,51,49,125,44,34,99,104,51,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,49,52,55,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,51,49,51,57,46,56,57,57,57,48,50,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,48,52,57,125,44,34,99,104,52,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,57,46,51,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,48,49,52,46,53,48,48,48,48,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,48,54,54,125,44,34,99,104,53,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,57,46,51,48,48,48,48,48,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,48,57,52,46,54,57,57,57,53,49,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,48,56,51,125,44,34,99,104,54,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,49,52,55,46,56,48,48,48,48,51,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,48,44,34,102,114,101,113,34,58,50,57,49,49,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,49,48,49,125,44,34,99,104,55,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,48,44,34,116,101,109,112,34,58,54,53,51,49,46,50,57,57,56,48,53,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,49,44,34,102,114,101,113,34,58,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,49,49,56,125,44,34,99,104,56,34,58,123,34,116,101,109,112,95,115,116,97,116,117,115,34,58,49,44,34,116,101,109,112,34,58,57,57,57,46,57,48,48,48,50,52,44,34,99,111,105,108,95,115,116,97,116,117,115,34,58,49,44,34,102,114,101,113,34,58,48,44,34,116,101,115,116,95,116,105,109,101,34,58,49,54,48,55,57,50,53,49,51,52,125,125,125,125>> 2020-12-14 13:52:17.105 [debug] <<"003D0017-2034334D-0412FFFF">>@117.132.195.87:50011 [MQTT] RECV PUBLISH(Q1, R0, D0, Topic=/sys/003D0017-2034334D-0412FFFF/thing/event/property/post, PacketId=46667, Payload=<<"{\"id\":798,\"humidity\":18.306351,\"tempreature\":24.283981,\"voltage\":22.718000,\"current\":0.281000,\"deviceId\":\"003D0017-2034334D-0412FFFF\",\"params\":{\"vwdata\":{\"ch1\":{\"temp_status\":0,\"temp\":9.300000,\"coil_status\":0,\"freq\":2184.500000,\"test_time\":1607925012},\"ch2\":{\"temp_status\":0,\"temp\":8.900000,\"coil_status\":0,\"freq\":2211.600098,\"test_time\":1607925031},\"ch3\":{\"temp_status\":0,\"temp\":147,\"coil_status\":0,\"freq\":3139.899902,\"test_time\":1607925049},\"ch4\":{\"temp_status\":0,\"temp\":9.300000,\"coil_status\":0,\"freq\":2014.500000,\"test_time\":1607925066},\"ch5\":{\"temp_status\":0,\"temp\":9.300000,\"coil_status\":0,\"freq\":2094.699951,\"test_time\":1607925083},\"ch6\":{\"temp_status\":0,\"temp\":147.800003,\"coil_status\":0,\"freq\":2911,\"test_time\":1607925101},\"ch7\":{\"temp_status\":0,\"temp\":6531.299805,\"coil_status\":1,\"freq\":0,\"test_time\":1607925118},\"ch8\":{\"temp_status\":1,\"temp\":999.900024,\"coil_status\":1,\"freq\":0,\"test_time\":1607925134}}}}">>) 2020-12-14 13:52:17.106 [info] <<"003D0017-2034334D-0412FFFF">>@117.132.195.87:50011 PUBLISH to /sys/003D0017-2034334D-0412FFFF/thing/event/property/post: <<"{\"id\":798,\"humidity\":18.306351,\"tempreature\":24.283981,\"voltage\":22.718000,\"current\":0.281000,\"deviceId\":\"003D0017-2034334D-0412FFFF\",\"params\":{\"vwdata\":{\"ch1\":{\"temp_status\":0,\"temp\":9.300000,\"coil_status\":0,\"freq\":2184.500000,\"test_time\":1607925012},\"ch2\":{\"temp_status\":0,\"temp\":8.900000,\"coil_status\":0,\"freq\":2211.600098,\"test_time\":1607925031},\"ch3\":{\"temp_status\":0,\"temp\":147,\"coil_status\":0,\"freq\":3139.899902,\"test_time\":1607925049},\"ch4\":{\"temp_status\":0,\"temp\":9.300000,\"coil_status\":0,\"freq\":2014.500000,\"test_time\":1607925066},\"ch5\":{\"temp_status\":0,\"temp\":9.300000,\"coil_status\":0,\"freq\":2094.699951,\"test_time\":1607925083},\"ch6\":{\"temp_status\":0,\"temp\":147.800003,\"coil_status\":0,\"freq\":2911,\"test_time\":1607925101},\"ch7\":{\"temp_status\":0,\"temp\":6531.299805,\"coil_status\":1,\"freq\":0,\"test_time\":1607925118},\"ch8\":{\"temp_status\":1,\"temp\":999.900024,\"coil_status\":1,\"freq\":0,\"test_time\":1607925134}}}}">> 2020-12-14 13:52:17.107 [debug] <<"003D0017-2034334D-0412FFFF">>@117.132.195.87:50011 [MQTT] SEND PUBACK(Q0, R0, D0, PacketId=46667, ReasonCode=0) ``` 就在开头多了个回车,不知道是pahomqt还是atdevice加进去的,或者是通信模块的问题?
查看更多
3
个回答
默认排序
按发布时间排序
flashman2002
2021-03-16
这家伙很懒,什么也没写!
要看源码才能定位问题呀。
古个十
2022-04-13
这家伙很懒,什么也没写!
遇到同样的问题,请问下解决了吗?
抬头看见柠檬树
2024-06-28
这家伙很懒,什么也没写!
遇到了同样的问题,请问下解决了吗?
撰写答案
登录
注册新账号
关注者
1
被浏览
1.6k
关于作者
A.I.R
这家伙很懒,什么也没写!
提问
9
回答
4
被采纳
0
关注TA
发私信
相关问题
1
umqtt 软件包使用后,连接上emqx服务器,过一会儿就掉线了
2
使用正点原子的 潘多拉 开发板 的例程19_iot_mqtt
3
mqtt软件包,不支持直接关闭?
4
kawaii_mqtt 申请内存崩溃
5
_signal_entry() 函数中dbg_enter在哪里定义呢?
6
start to connect mqtt server 失败
7
MQTT 在“ read 0:1, break “后断开重连
8
paho_mqtt线程相关疑问
9
RT thread studio kawaii mqtt 无法连接EMQ
10
调试bc26 ,断言错误failed at rt_thread_timeout
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
UART
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
ulog
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
a1012112796
13
个答案
2
次被采纳
张世争
9
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
本月文章贡献
程序员阿伟
8
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
3
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部