ESP32硬件在和mqtt服务器通讯, 发送某些特殊的消息, 会时不时断开

描述你需要的功能

E(37026)MOTT CLlENT: mqtt_message_receive: transport_read( error: errno-128
(37033)MQTT: MOTT EVENT ERROR
(37037)MOTT:ast error reported from esp-tls:0x8008
(37043)MOTT:last errno string(Success)
(37048)MOTT_CLlENT: mqtt_process_receive: mqtt_message_receive() returned -1
(37056) MOTT: MOTT EVENT DISCONNECTED
什么导致的esp32的mqtt断开
一致返回128,有的时候,有时候不行,而且会断开连接很久 需要重启很久。

为什么你需要这个功能

这个是用来通话用的,现在是小程序打给设备是没有问题的,就是设备(ESP32)打给小程序,会出现mqtt掉线,很奇怪 ,现在不知道怎么排查

{“log”:“2024-03-20 08:22:09.856 [error] \u003c\u003c"CL01202312120002"\u003e\u003e@119.137.0.39:25124 crasher:\n”,“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604876464Z”}
{“log”:" initial call: emqx_connection:init/4\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604924213Z”}
{“log”:" pid: \u003c0.15694.0\u003e\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60493018Z”}
{“log”:" registered_name: \n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604933949Z”}
{“log”:" exception exit: {badarg,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604937502Z”}
{“log”:" [{ets,lookup_element,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604940852Z”}
{“log”:" [emqx_metrics,‘packets.publish.inuse’,4],\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604944223Z”}
{“log”:" },\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604947697Z”}
{“log”:" {emqx_metrics,update_counter,2,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604950789Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604954051Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_metrics.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604957336Z”}
{“log”:" {line,294}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604960814Z”}
{“log”:" {emqx_channel,do_publish,3,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604964146Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604967661Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_channel.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604972069Z”}
{“log”:" {line,416}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604975981Z”}
{“log”:" {emqx_connection,with_channel,3,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604979031Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604982085Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_connection.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60498516Z”}
{“log”:" {line,537}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604988348Z”}
{“log”:" {emqx_connection,process_msg,3,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604991368Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60499443Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_connection.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.604997483Z”}
{“log”:" {line,284}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605000906Z”}
{“log”:" {proc_lib,wake_up,3,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605003926Z”}
{“log”:" [{file,"proc_lib.erl"},{line,259}]}]}\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605006971Z”}
{“log”:" in function emqx_connection:terminate/2 (/emqx_rel/_build/emqx/lib/emqx/src/emqx_connection.erl, line 424)\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605010254Z”}
{“log”:" ancestors: [\u003c0.1591.0\u003e,\u003c0.1590.0\u003e,esockd_sup,\u003c0.1340.0\u003e]\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.6050137Z”}
{“log”:" message_queue_len: 4\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605017243Z”}
{“log”:" messages: [{tcp,#Port\u003c0.5787\u003e,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605020393Z”}
{“log”:" \u003c\u003c60,98,0,6,115,101,114,118,101,114,219,150,123,10,9,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605023887Z”}
{“log”:" 34,99,109,100,34,58,9,34,99,97,108,108,34,44,10,9,34,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60502755Z”}
{“log”:" 99,97,108,108,95,100,97,116,97,34,58,9,123,10,9,9,34,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605046742Z”}
{“log”:" 99,97,108,108,95,105,100,34,58,9,48,44,10,9,9,34,99,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605050585Z”}
{“log”:" 97,108,108,95,116,121,112,101,34,58,9,50,44,10,9,9,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605053812Z”}
{“log”:" 34,99,97,108,108,95,119,97,121,34,58,9,49,10,9,125,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605057789Z”}
{“log”:" 10,125\u003e\u003e},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605061382Z”}
{“log”:" {tcp,#Port\u003c0.5787\u003e,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605064683Z”}
{“log”:" \u003c\u003c60,98,0,6,115,101,114,118,101,114,219,150,123,10,9,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605067893Z”}
{“log”:" 34,99,109,100,34,58,9,34,99,97,108,108,34,44,10,9,34,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605071083Z”}
{“log”:" 99,97,108,108,95,100,97,116,97,34,58,9,123,10,9,9,34,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605074052Z”}
{“log”:" 99,97,108,108,95,105,100,34,58,9,48,44,10,9,9,34,99,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605077007Z”}
{“log”:" 97,108,108,95,116,121,112,101,34,58,9,50,44,10,9,9,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605082519Z”}
{“log”:" 34,99,97,108,108,95,119,97,121,34,58,9,49,10,9,125,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605085402Z”}
{“log”:" 10,125\u003e\u003e},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605088191Z”}
{“log”:" {inet_reply,#Port\u003c0.5787\u003e,ok},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605090948Z”}
{“log”:" {inet_reply,#Port\u003c0.5787\u003e,ok}]\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605093861Z”}
{“log”:" links: [\u003c0.1591.0\u003e]\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605096665Z”}
{“log”:" dictionary: [{outgoing_bytes,434},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605099437Z”}
{“log”:" {{subscribe,\u003c\u003c"CL01202312120002"\u003e\u003e},{allow,1710922494582}},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605102169Z”}
{“log”:" {{publish,\u003c\u003c"server"\u003e\u003e},{allow,1710922925466}},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605105247Z”}
{“log”:" {acl_cache_size,2},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60510823Z”}
{“log”:" {outgoing_pubs,2},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605111082Z”}
{“log”:" {acl_keys_q,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605113778Z”}
{“log”:" {[{publish,\u003c\u003c"server"\u003e\u003e}],\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605116737Z”}
{“log”:" [{subscribe,\u003c\u003c"CL01202312120002"\u003e\u003e}]}},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605119697Z”}
{“log”:" {recv_msg,2},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605122739Z”}
{“log”:" {recv_pkt,4},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605125897Z”}
{“log”:" {guid,{1710922929856684,107477261630798,2}},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605128568Z”}
{“log”:" {send_pkt,12},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605131308Z”}
{“log”:" {incoming_pubs,2},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605133988Z”}
{“log”:" {send_msg,2},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605146462Z”}
{“log”:" {incoming_bytes,280},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605149964Z”}
{“log”:" {‘$logger_metadata$’,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605152685Z”}
{“log”:" #{clientid =\u003e \u003c\u003c"CL01202312120002"\u003e\u003e,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60516038Z”}
{“log”:" peername =\u003e "119.137.0.39:25124"}}]\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605163679Z”}
{“log”:" trap_exit: false\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605166928Z”}
{“log”:" status: running\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605169737Z”}
{“log”:" heap_size: 4185\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605172419Z”}
{“log”:" stack_size: 27\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605175179Z”}
{“log”:" reductions: 57728\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605177817Z”}
{“log”:" neighbours:\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605180582Z”}
{“log”:“\n”,“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60518326Z”}
{“log”:“2024-03-20 08:22:09.858 [error] supervisor: ‘esockd_connection_sup - \u003c0.1591.0\u003e’\n”,“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605186325Z”}
{“log”:" errorContext: connection_crashed\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605189534Z”}
{“log”:" reason: {badarg,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605192221Z”}
{“log”:" [{ets,lookup_element,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605194883Z”}
{“log”:" [emqx_metrics,‘packets.publish.inuse’,4],\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605197689Z”}
{“log”:" },\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605200407Z”}
{“log”:" {emqx_metrics,update_counter,2,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.60520308Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605205787Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_metrics.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605208974Z”}
{“log”:" {line,294}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605212Z”}
{“log”:" {emqx_channel,do_publish,3,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605214787Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605217962Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_channel.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605220643Z”}
{“log”:" {line,416}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605223455Z”}
{“log”:" {emqx_connection,with_channel,3,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605226214Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605228969Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_connection.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605231699Z”}
{“log”:" {line,537}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605234651Z”}
{“log”:" {emqx_connection,process_msg,3,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605237442Z”}
{“log”:" [{file,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605240211Z”}
{“log”:" "/emqx_rel/_build/emqx/lib/emqx/src/emqx_connection.erl"},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605242887Z”}
{“log”:" {line,284}]},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605245688Z”}
{“log”:" {proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,259}]}]}\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605248441Z”}
{“log”:" offender: [{pid,\u003c0.15694.0\u003e},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605251339Z”}
{“log”:" {name,connection},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605254126Z”}
{“log”:" {mfargs,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605256825Z”}
{“log”:" {emqx_connection,start_link,\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605259462Z”}
{“log”:" [[{deflate_options,},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605265968Z”}
{“log”:" {max_conn_rate,1000},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605268774Z”}
{“log”:" {active_n,100},\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605271518Z”}
{“log”:" {zone,external}]]}}]\n",“stream”:“stdout”,“time”:“2024-03-20T08:22:10.605274305Z”}
这个是 日志 可以看看 忘记发了

可以提供一下 emqx 具体是哪个版本么?

4.4的版本