This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mqtt subscriber error

I am experiencing an error that I can't figure it out why it is happening and where to go and try to fix it.

I am using the subscriber implementation on my nRF51, Raspberry Pi as router and broker.

To test it i'm using a python program on Raspberry to publish the "led/state" topic. I set the publisher to send a publish message every 0.5 seconds inside a loop to send 1200 packets, than it closes the connection.

I saw in wireshark that the broker send the publish message to the subscriber than the subscriber send Acknowledgement to the broker and the broker send an Acknowledgement to the subscriber.

So, around 1887 packets sent in this 3 way handshake, the subscriber stops executing and the broker disconnects it because of the timeout. But to get subscriber running again I have to restart and connect it again to the Rpi.

I ran this test publishing in many other ways and the subscriber halts every time around 1885 to 1890 packets.

Is there something on the mqtt code that I can change to not have this issue?

Parents Reply
  • Hi Krishna,

    I tested here again and saw something that may be the problem. I saw that in some point, the Broker (Mosquito running on Raspberry Pi) send the publish to the BLE, the BLE Acknowledge it, but the Broker does not send the Acknowledge to the BLE on the 3 way handshake. After that, the Broker and BLE cannot talk correctly anymore and the Broker keeps retransmitting the messages and the BLE Acknowledging the wrong messages.

    Now, I think the problem is with the mosquitto broker and not with the mqtt BLE.

Children
No Data
Related