Challenges with MQTT Subscription: Message Truncation and Missed Messages

Hey everyone,

Has anyone encountered issues with MQTT subscription? I’ve been facing a couple of challenges:

  1. Message Truncation: Within the extract_messages() function, I’ve noticed that some messages are getting truncated. They’re coming through incomplete, which is causing some trouble.
  2. Missed Messages: Additionally, the subscription occasionally misses messages. It’s not capturing all or most of them, which can be quite frustrating.

I’m using GSM exclusively, and my setup involves running a tracker in a continuous while True loop. This loop prioritizes GNSS to obtain location data, then focuses on WWAN to publish this location. Finally, it checks the buffer for incoming messages. The subscription process occurs before this loop starts. Overall, this setup operates well, but there are instances where the buffer appears empty when it should contain messages, or it only contains one or two messages instead of more.

Any insights or suggestions would be greatly appreciated!

Hi @nigel.f.francis ,

The recently released MQTT Example tutorial may be helpful for you.