Cannot connect to mqtt3.thingspeak.com

Ken Kok on 9 May 2023
Latest activity Reply by Ken Kok on 11 May 2023

I have created a mqtt device in thingspeak, allocated a channel for pub and sub. I noted down the credentials for connection when the device was created. I tried to connect using the host mqtt3.thingspeak.com port 1883 and the supplied credentials(user name and password). I tried with node red (mqtt node) and also mqtt lense but still cannot connect. Would appreciate advice some advise. Thanks
Christopher Stapels
Christopher Stapels on 9 May 2023
For the connection, perhaps try a desktop client and see if you can connect, as in this example.
Ken Kok
Ken Kok on 10 May 2023
Thank Chris for the suggestion; I did tried couple of desktop client (mqtt lense and mqttspy) cannot connect for both; However when I try mqtt x, it connected. Not sure on the right track, It would appears that thingspeak need the unique clint id(which is the same as user name) and mqtt x is the only desktop client that allow entering the Client id (others are auto generated) and in nodered, you cant enter the client id and I want to get node red to work.
Is there anyway to get thingspeak to ignore clint id?
Cheers,
Ken
Christopher Stapels
Christopher Stapels on 10 May 2023
MQTTLense is no longer supported (I tried to install it to test if I could change client ID), and MQTTSpy seems to have a client ID in the configurations scripts I found here.
There is no way to get ThingSpeak to ignore the client ID. I'm pretty sure others on the forum have reported sucessful Node Red integration with ThingSpeak, but I havent done it myself.
Ken Kok
Ken Kok on 10 May 2023
Thanks Chris,
You are correct, I managed to connect to thingspeak via nodered after looking at the configaration a bit more. All good now. Appreciated.
Cheers,
Ken,
NZ
Christopher Stapels
Christopher Stapels on 10 May 2023
Ken,
Thanks for letting us know! Can you give us any more hints on what it took to make it work?
Also are you in New Zealand? "NZ"
-Christopher
Ken Kok
Ken Kok on 11 May 2023
Hi Chris,
Most nodered user seems to prefer the "nodered thingspeak node" to connect to thingspeak (which uses the thingspeak api) and is very easy to use but only allow for one feed at a time.
I wanted to try mqtt connection as it allows mutiple feeds with one transmission. The issue with my initial nodered mqtt setup was that I could not find the "client id" in the security tab in the nodered mqtt node (which only accept user name and password), so I assume that client id cannot be set. However, I found later that I can enter the client id in the connection tab. That was the problem (user).
Yes, I live in Auckland, New Zealand, a tinkerer and keen sailor
Cheers,
Ken
NZ