Issue in publishing data on mqtt topic

mqtt

#1

i have succesfully port your mqtt arduino code for stm32 every thing works well instead one topic when i publish some data like 0_1(format of data ) after sending the publish packet it return ok instead send ok and not publishing any thing.
i have also tried it on tmft terminal results are same.

OK
.
.CONNECT OK
.AT+CIPSEND

.> .!..MQTT…Z…efg…ubuntu…Ags@2019.
.SEND OK
. …AT+CIPSEND

.> .!..MQTT…Z…efg…ubuntu…Ags@2019.
.SEND OK
.
.CLOSED
.AT+CIPSTART=“TCP”,“mqtt.croplytics.com”,“1883”

.OK
.
.CONNECT OK
.at+cipsend

.> .!..MQTT…Z…efg…ubuntu…Ags@2019.
.SEND OK
. …AT+CIPSEND

.> 0…Gateway/pulse/GA1400010_.
.OK
.
.CLOSED


#2

May be you are calculating the publish packet size wrong or you might be sending wrongly formed publish packet. It shows that MQTT broker didnt like what you sent and closed the connection.
It might also be that it didnt like the connect packet itself and closed the connection. But you got the CLOSED URC after publish packet was sent. by MCU


#3

but 3 other topic are working perfectly only this topic creates problem. and i think this closed return after the end of keep alive session i.e 60 sec


#4

Are all topic length same?


#5

no topic length of some topic are smaller than this topic and some are longer .


#6

Asking to check if you have calculated the topic length field correctly. Verify it once.