MQTT publishing error


#1

Hi all,

I am using mqttClient api on mangOH Green. I’ve got my program to connect to MQTT broker on AirVantage but I cannot publish. The error log is the following:

Oct 5 13:11:04 | AVmqtt[1438]/component T=main | main.c encodeIntToJSON() 41 | Done JSON encoding: {“greenhouse.testint”: 19}
Oct 5 13:11:04 | AVmqtt[1438]/component T=main | main.c dataUpdateHandler() 74 | Publishing topic 359377069961745/messages/json
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0x34a20100 0x1d333539 0x33373730 0x36393936
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0x31373435 0x2f6d6573 0x73616765 0x732f6a73
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0x6f6e0010 0xbe682fd6 0x59130000 0x002c7baf
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0xbe2424f5 0xb6547baf 0xbeeca1f3 0xb6800000
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0x00010000 0x0050c9f1 0xb640c1f1 0xb6345103
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0x0058cb02 0x00746573 0x742e696e 0x74000000
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0x0014ffee 0xb6483401 0x00a4c9f1 0xb6a8c9f1
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0xb6000000 0x00000000 0x00a8c9f1 0xb6382203
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0x00843b01 0x0040c1f1 0xb6060000 0x00efbead
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 76 | 0xde843b01 0x00000000 0x0070c6ee 0xb62424f5
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 139 | 0xb6483401 0x00
Oct 5 13:11:04 | mqttClient[805]/framework T=main | mqtt_server.c Handle_mqtt_Publish() 592 | Sending response to client session 0x27c4c : 4 bytes sent
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_socketFdEventHandler() 795 | events(0x00000001)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_read() 1389 | read(1)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 155 | 0x50
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_read() 1389 | read(1)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 155 | 0x02
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttPacket.c MQTTPacket_decode() 83 | message length(1)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_read() 1389 | read(2)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 151 | 0x0010
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_socketFdEventHandler() 846 | packet type(5)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_processPubRec() 710 | —> PUBREC
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttPacket.c MQTTPacket_decode() 83 | message length(1)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_processPubRec() 734 | <— PUBREL
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 143 | 0x60020010
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_socketFdEventHandler() 795 | events(0x00000001)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_read() 1389 | read(1)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 155 | 0x70
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_read() 1389 | read(1)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 155 | 0x02
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttPacket.c MQTTPacket_decode() 83 | message length(1)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_read() 1389 | read(2)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_dumpBuffer() 151 | 0x0010
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_socketFdEventHandler() 846 | packet type(7)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_processPubComp() 675 | —> PUBCOMP
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_processPubComp() 681 | le_timer_Stop() failed(-6)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_socketFdEventHandler() 913 | mqttClient_processPubComp() failed(-6)

The essential message is

Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_processPubComp() 681 | le_timer_Stop() failed(-6)
Oct 5 13:11:04 | mqttClient[805]/mqttClientComp T=main | mqttClient.c mqttClient_socketFdEventHandler() 913 | mqttClient_processPubComp() failed(-6)

I don’t understand why the timer is not started (error code -6). What might lead to this issue?

Best regards,

Lichen Yao


#2

Do you have an active data connection? Test by verifying that you can ping eu.airvantage.net


#3

Yes I do. I can ping google and airvantage.