Hello everyone,
I don’t know if something is happening, but I’m trying to connect with MQTTX and it only gives me the wrong username or password. As instructed, I put the token as the password and the username is the name of the token, both from the device.
Is the client ID necessary? If so, where can I get it on the tagoIO platform?
In my aplication from Esp8266, can’t connect:
// Configurações do MQTT (TagoIO)const char* mqtt_server = "mqtt.tago.io"; // Broker MQTT do TagoIOconst int mqtt_port = 1883; // Porta MQTT padrãoconst char* mqtt_token = "5a77969b-7544-4ed1-af5d-35d9d7e4a364"; // Token do dispositivo no TagoIOconst char* mqtt_topic = "sensor/data"; // Tópico MQTT para enviar os dadosconst char* id_profile = "6712ab41ec9a8000097c7103"; // ID do dispositivo TagoIO
And my connect:
void reconnect() {// Loop até reconectarwhile (!client.connected()) {Serial.print("Tentando conectar ao MQTT...");// Cria um ID de cliente aleatório// Create a random client IDString clientId = "ESP8266DHT";clientId += String(random(0xffff), HEX);// Attempt to connectif (client.connect("ESP8266DHT", id_profile, mqtt_token)) {Serial.println("Conectado ao MQTT Broken...");// Once connected, publish an announcement...client.publish("outTopic", "hello world");client.loop();}else {Serial.print("Erro ao conectar, código de erro: ");Serial.print(client.state());delay(5000);}}}
Can someone help me?
