Q: Connection problems with MQTT
A: Check first the TLS /Cypher combination for your modem and (web)server.
T: Cipher availability can be checked using this FAQ.
If TLS and Cyphers are matching the website, there could be other problems.
1) Some Brokers are not “Generic” but part of an IoT platform. They don’t allow free choice of topic names or subscription. In that case, in the Data Logger, the configured “root-topic” has to match the obliged “root-topic” name in the IoT platform. Only the Data Log File can be sent. Configure “Omit Subtopics” and “Clean-Session”.
2) If a data logger establishers a connection (throug TLS /SSL) to the (web)server, but can’t deliver the data (connection is broken), then check for access rights.
- Only authorized client ID’s are allowed, configure this client ID into the Data Logger
- The Data Logger has no publish or subscripe rights to certain topics. Grant access to to “#” or at least “YDOC/#”
3) If a data logger establishes a connection (throug TLS /SSL) to the (web)server, but the connection is broken before the data delivery completes. This could be a timing issue on the (web)server. Some (web)server administrators are decreasing the standard connection time-out to prevent unwanted connections or performance issues. The only way to solve this problem is asking the (web)server administrator to increase the time-out to a standard value. (about 4 seconds).
4) Connection or server access problems. These problems apply to log-in procedure or missing rights on the server.
T: Example error message. MQTT “SERVER_LOGIN;Invalid credentials” (with highlighted, the error number) explained:
AT#SD=1,0,1883,”mqtt.yourserver.org”
CONNECT
Modem data mode
MQTT credentials sent
ERR;SERVER_LOGIN;Invalid credentials (Error 5)
Modem command mode
AT#SGACT=1,0;#SHDN
ERR;MQTT;
Error number Caused by
1 Connection refused, Protocol version not supported!
2 Connection refused, Client ID rejected!
3 Connection refused, Server unavailable!
4 Connection refused, bad user name or password!
5 Connection refused, Client is unauthorized!
Other or no error number available: Unknown reason.
