Connection Refused - Bad Username or Password
Hello, I try to publish to an already working channel. I have created an device and using the credentials shown in the image. I would like connect via TCP and port 1883 to mqtt3.thingspeak.com My Library always returns "Connection Refused - Bad Username or Password". This means it already has got a CONNACK reply. I have already successfully published an item to another server. So, the Lib basically works and I am using it correctly. I do not have mistyped the credentials. Could there be something on the Thingspeak side? Could you please help me with that? Thank you in advance.
11 Comments
Time DescendingCan you confirm that the Client Identifer (a.k.a "ClientId" or "client_id") has been set in the device code to match exactly the value provided by ThingSpeak in the picture you shared?
This is a requirement of ThingSpeak's MQTT broker that is not typical of public test brokers; the username, password, and ClientId must all match exactly the values given.
For background, this answer talks about why the ClientID is important:
I would like to add something to this topic: I can login to this test broker an publish an item: maqiatto.com For test reasons I have set the password to the one in my ThingSpeak device online. - It is still possible to connect and publish. So, I think the issue is located on the ThingSpeak side. It is not possible to establish a TCP connection (port 1883) because the devices username and/or password is not recognized to be correct.