Failure to reconnect to HiveHQ over 4G

Team,

I have a project where I have been testing a Lily-go T-SIM7600 and 4G connection to broker.hivemq.com 1883.

It has been working well but I am trying to chase a issue that randomly occurs. When I ran out of credit the T-SIM7600 stop data which is as expected. A day later added credit and I understand once I add credit the T-SIM7600 should then be able to pass data again.

I had a scenario where the device wouldnt reconnect to broker.hivemq.com and when checking with a MQTT client it could but was at time reconnecting.

Q. Is there a limit for re-connections? My code attempts to check GPRS and then connect to MQTT broker.hivemq.com I see this in the serial logs as expected but it couldnt connect. Waited 1.5hrs and it still had not connected. In the spec’s I see 100 connections, assume that concurrent?

Any advice on how to handle re-connections?

A basic MQTT broker (broker.hivemq.com port 1883)

Shared MQTT platform

100 connections free

10 GB data traffic per month

MQTT 3.1, 3.1.1, 5.0

MQTT over TLS/SSL

Basic authorization rules

Websocket support

Hi @droidblast,

broker.hivemq.com is a public broker intended for testing, and it has no enforced connection limits and no guaranteed uptime. Since it is public, many different users connect to it, during periods of high traffic, the broker may temporarily slow down and reject new connection attempts to maintain stability.

When this happens, the broker responds more slow and when the connection is not possible, it responds with a CONNACK Reason Code, which your client should check to understand why the connection was refused.

For handling reconnections:

  • Ensure your client properly handles a longer connection times
  • Check your CONNACK Reason Code for specific reason codes when a connection fails.
  • Ensure your client properly handles backoff and retries instead of continuously spamming connection attempts, waiting for reasonable time before the next attempt
  • If your device supports TLS, get an account with a HiveMQ Cloud Serverless (free) broker.

Let us know if you need further insights

Best,
Dasha from The HiveMQ Team