Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QoS and retain both set to 1 then MQTT Client goes to MQTT Close session after time greater than keep alive interval and then reconnection #1477

Open
sayali-gadre opened this issue May 3, 2024 · 1 comment
Labels

Comments

@sayali-gadre
Copy link

I am using the MQTT Client library for publishing and subscribing messages to IoT Core service of the AWS Cloud.

When continuously publishing MQTT messages for a topic with QoS and retain flag set to 1, the messages stop publishing after client ID 17 (serially), then client goes to close session after almost twice of keepalive interval (till then task is suspended) and then to reconnection again. After reconnection, same process repeats 2-4 times and then, the task stops.

When seen in debug, time is stuck in PUBACK timer wait function which calls for reading the type of packet. The MQTT task in FreeRTOS gets blocked for that time interval.

Is there any minimum wait period required for PUBACK if publishing to the same topic continuously?
If delay of 1s is given each time after publishing to the topic, then, it works properly without any issue. It is not the issue when retain flag is not set.

Could you please provide some insights into this? Thank you in advance.

@icraggs
Copy link
Contributor

icraggs commented Sep 3, 2024

Sorry for long delay in response. The keepalive interval dictates how long the client will wait for some traffic to occur on a connection, so it is this which will govern how long it would wait for the PUBACK.

If by publishing continuously you mean as fast as you can, then maybe the receiving thread is being starved of CPU time? Anyway, there is a trace function in the Paho library (described in the README) which could shed more light if this is still a problem for you.

I thought that FreeRTOS now has its own MQTT client?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants