Hi All,
I'm working on a mqtt project where I need to know if the client connection to the broker is still active. If the connection is disconnected, the system must asap come to halt.
The first idea was to set a relative low keepalive value and let the client send periodically some dummy publishings.
But looking into the documentation, I discovered the "refresh_connection_after_ms" member of esp_mqtt_client_config_t.
What is the purpose of this member? Can I use it to chech/ensure the connection between the client(s) and the broker?
Thanks,
Paul
Meaning of esp_mqtt_client_config_t.refrech_connection_after_ms
- PaulVdBergh
- Posts: 58
- Joined: Fri Feb 23, 2018 4:45 pm
- Location: Brasschaat, Belgium
-
- Posts: 69
- Joined: Thu Nov 01, 2018 8:32 am
Re: Meaning of esp_mqtt_client_config_t.refrech_connection_after_ms
Hi Paul,
you can use `keepalive` field from the configuration structure (this would send pings to the broker if no communication for given time)
`refresh_connection_after_ms` would actively disconnect and reconnect to the broker if configured.
you can use `keepalive` field from the configuration structure (this would send pings to the broker if no communication for given time)
`refresh_connection_after_ms` would actively disconnect and reconnect to the broker if configured.
Re: Meaning of esp_mqtt_client_config_t.refrech_connection_after_ms
Hi, I have a question.
Would the ESP32 disconnect and reconnect even when there is a stable connection or it only happen when there is no ping response from broker?
Would the ESP32 disconnect and reconnect even when there is a stable connection or it only happen when there is no ping response from broker?
Who is online
Users browsing this forum: No registered users and 274 guests