cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

New Contributor

Hello.

I want to change the settings of the keep alive timer of MQTT,

Should I change the defined value of "WICED_AWS_MQTT_KEEP_ALIVE_TIMEOUT" in "aws_common.h"?

Is there a setting value range?

I want to set it to 600 seconds, but it will be disconnected 600 seconds after the last access.

Is there a solution?

Thank you.

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi,

The connection inactivity (keep-alive interval) for MQTT connections is between 30-1200 seconds as part of the MQTT CONNECT message for AWS IOT.

Following link should help

https://docs.aws.amazon.com/iot/latest/developerguide/limits-iot.html

Following attached code should help

In the sample code, if the button isn't pressed to publish within keep alive time the connection is closed.

Thanks and Regards

View solution in original post

0 Likes
Reply
4 Replies
Moderator
Moderator

Hi,

Yes, you can change the value of the Macro "WICED_AWS_MQTT_KEEP_ALIVE_TIMEOUT" in "aws_common.h" file to your specified value of 600 seconds. You can refer to "aws_mqtt.c" where the "keep_alive" interval is replaced with this Macro. The keep_alive is a uint16_t variable.

Thanks

0 Likes
Reply
New Contributor

Hello,

Thank you very much for your answer.

I tried with "600" and it was disconnected 600 seconds after the last access.
And,I tried with "480" and it was not disconnected even after 480 seconds since the last access.

Is it a problem on the AWS server side to be disconnected when the value is "600"?

Thank you.

0 Likes
Reply
Moderator
Moderator

Hi,

The connection inactivity (keep-alive interval) for MQTT connections is between 30-1200 seconds as part of the MQTT CONNECT message for AWS IOT.

Following link should help

https://docs.aws.amazon.com/iot/latest/developerguide/limits-iot.html

Following attached code should help

In the sample code, if the button isn't pressed to publish within keep alive time the connection is closed.

Thanks and Regards

View solution in original post

0 Likes
Reply
New Contributor

Hello,

Thank you very much for your answer.

I'll try.

 

thank you.

0 Likes
Reply