Skip to main content
4 of 7
added 2 characters in body; edited title
Bence Kaulics
  • 7.8k
  • 8
  • 42
  • 90

MQTT Connection Using Keep-Alive > 5 Minutes Behaves Inconsistently?

Summary of the issue:

  1. Connecting to test.mosquitto.org or iot.eclipse.org with a keep alive of more than 5 minutes, and everything seems to work just as expected.

  2. Connecting to my broker (both on Azure hosted VMs - one is Mosquitto and one is Emqttd), my clients don't send a ping if the keep-alive is longer than 5 minutes. They just die. The broker disconnects them eventually for not pinging.

The thing is, the connected device doesn't know it's been disconnected if its over a cell network (not sure why?)

Over an Ethernet network, it'll reconnect itself as it should.

Not sure if there is something unique about the Azure VM's that is causing my disconnection/timeout issue with longer keep-alives?

Lastly, if I use a 2 minutes or shorter keep-alive, everything works.