Main Content

Troubleshoot MQTT Subscribe

The MQTT protocol provides minimal feedback and error messages are limited. Use these steps to troubleshoot issues with connecting and subscribing to receive messages. The steps are all independent possibilities, with the most likely problems listed first.

  1. Ensure that your MQTT device credentials are correct. Select Devices > MQTT. The device configuration details are visible when you click Edit, but if you did not save or make note of the password when you created the device, you can regenerate a new one by clicking The regenerate button.

  2. The MQTT device credentials are required at when connecting the MQTT client to both public and private channels.

  3. Ensure that the client address is mqtt3.thingspeak.com. If you incorrectly configure your client to connect to the ThingSpeak MQTT broker, your connection request is rejected.

  4. Check that you have the correct topic format for Subscribe to a Channel Feed, or Subscribe to a Channel Field Feed.

  5. Check that your channels have the correct permissions in your ThingSpeak MQTT device. Click Devices > MQTT. For your listed device, click Edit. See the Allowed check boxes for each channel.

  6. 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.

  7. CleanSession must be set to 1 if it is specified.

  8. Make sure that the port is correct. See MQTT Client Configuration for a list of accepted ports.

  9. If you are having trouble connecting with SSL, be aware that your client might require extra steps to enable a secure connection.

See Also

Related Topics