The MQTT protocol provides minimal feedback and error messages are limited. Use these steps to troubleshoot a connection and subscribe to a channel or channel field. The steps all independent possibilities, but they are listed with the most likely problems listed first.
Ensure that your MQTT API Key is correct. This value is different from your
user API Key, the channel Read API Key and the Write API Key. The MQTT API Key
is found on your profile page. Select Account >
The MQTT API Key is required at connection when subscribing to both public and private channels.
Ensure that the client address is
you incorrectly configure your client to connect to the ThingSpeak™ MQTT broker,
your connection request is rejected.
If a connection is successful, the server responds with the last value in the subscribed channel. If you receive no response upon subscription, check that there is data in your channel and that the user name used in the connection is not blank.
Check that you have the correct topic API Key. To subscribe to private channels, your topic must contain the Read API key.
Make sure your QoS is set to 0. Some devices have a default QoS that is different than 0. Some clients require you manually change the setting. Some of the MQTT API examples show how to subscribe with QoS 0.
CleanSession must be set to 1 if it is specified.
Make sure that the port is correct. See MQTT Client Configuration for a list of accepted ports.
If you are having trouble connecting with SSL, be aware that your client may require extra steps to enable a secure connection.