I am trying to connect to my mosquitto
broker on esp32
with GSM
using pubsubclient
but sometimes it disconnects to broker with detail malformed packet.
2023-08-30T13:43:14: Client client_id disconnected due to malformed packet.
I have this dump at command on device and it display like this :
13:31:08.540 > DATA ACCEPT:0,2
13:31:08.540 > AT+CIPSEND=0,2
13:31:08.568 >
13:31:08.568 >
13:31:08.570 >
13:31:08.604 > DATA ACCEPT:0,2
13:31:08.604 > AT+CIPRXGET=4,0
13:31:08.660 >
13:31:08.660 > +CIPRXGET: 4,0,0
13:31:08.660 >
13:31:08.660 > OK
13:31:08.660 > AT+CIPSTATUS=0
13:31:08.755 >
13:31:08.755 > +CIPSTATUS: 0,0,"TCP","13.228.184.92","80","CONNECTED"
13:31:08.760 >
13:31:08.760 > OK
13:31:09.762 > AT+CIPRXGET=4,0
13:31:09.780 >
13:31:09.781 > +CIPRXGET: 1,0
13:31:09.817 >
13:31:09.818 > +CIPRXGET: 4,0,370
13:31:09.818 >
13:31:09.818 > OK
13:31:09.818 > AT+CIPSTATUS=0
13:31:09.917 >
13:31:09.918 > +CIPSTATUS: 0,0,"TCP","BROKER IP","80","REMOTE CLOSING"
I have limited some possibilities that are causing the problem.
- After failing to connect to broker I try to connect to server using
http
and it connected without problems. - Tried using public broker like
hivemq
for a short time and it does not have a problem. - I have tried to connect to broker using another device (
Android
,mqttx
, etc.) and they run well also.