Can not connect to ThingSpeak MQTT broker using MQTT X Client

Hello,
I have a problem with the connection to thingspeak MQTT broker using MQTT x client. After pressing the "Connect" button after a few seconds connection is not set.
I have followed the instructions described in: https://de.mathworks.com/help/thingspeak/use-desktop-mqtt-client-to-publish-to-a-channel.html.
Below you can see the settings in the MQTT X client. ClientID, Username and Password I took from the credentials file which was created when I add a new MQTT device in thingspeak.
I have already checked the discussion with a similar problem, but I can not figure out what could be the source of the problem.
I would like to ask your help with this problem.
Thank you,
Levani Meskhiya

 Respuesta aceptada

Vinod
Vinod el 4 de Abr. de 2022
If you're connecting over Secure MQTT, you need to use port 8883, not port 1883 as your screenshot shows.

9 comentarios

I have also used port 8883, this did not help.
Can you share the clientID you are using to connect?
Yes I can, Client ID is the same as Username:
Og8mNRUwOzIyDDkWGyohDRE
Vinod
Vinod el 4 de Abr. de 2022
Editada: Vinod el 4 de Abr. de 2022
What I can see on the server end for this clientID is that the clientID/password being supplied when it attempts connect is incorrect and the connection is being rejected for this reason. The clientID I see on our server end has an extra "-iPhone" tagged on at the end.
Can you regenerate the password and copy the exact clientID and password into your client and try again?
I have regenerated the password and tried again. I have got an error: "connect ETIMEDOUT 18.207.44.162:8883".
I attached the setting in the MQTT client with clientID and Username. I have copied exact clientID from the credentials file.
Maybe the 8883 port is blocked on your end? Try a websocket connection (ws://) on port 80 with SSL turned off. Does that work?
It works with websocet connection. Could you please tell me where I can check if the 8883 port is blocked on my end?
Vinod
Vinod el 4 de Abr. de 2022
Editada: Vinod el 4 de Abr. de 2022
If websocket works, I would reccomend secure websocket (wss://) on port 443 with SSL/TLS enabled and CA signed server.
You'd have to check with your IT administrator about outgoing connection and which network ports are allowed, and specifically if outgoing connections on port 8883 are blocked by your firewall.
Ok, I will check. Thank you very much for your help.

Iniciar sesión para comentar.

Más respuestas (1)

Hoa Vinh
Hoa Vinh el 15 de Feb. de 2024
I have problem cannot connect MQTTX to Thingspeak mqtt server.
host: mqtt:// mqtt3.thingspeak.com & port 1883 -> cannot
host: mqtts:// mqtt3.thingspeak.com & port 8883 -> cannot
What is the issue ?

1 comentario

Milan Tomin
Milan Tomin el 2 de Mzo. de 2024
Editada: Milan Tomin el 2 de Mzo. de 2024
Having the same problem, have you found any solution?
Although im using sp-react-native-mqtt in react native to connect to thingspeak.
I keep getting unknown host exception error, so it seems that the mqtt3.thingspeak.com part is somehow problematic?

Iniciar sesión para comentar.

Comunidades de usuarios

Más respuestas en  ThingSpeak Community

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 4 de Abr. de 2022

Editada:

el 2 de Mzo. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by