I have a program sending MQTT messages to Cloud.MQTT. now I want to change it to send these messages to HiveMQ but get no connection. My access data are as follows:
// MQTT (CloudMQTT)
const char* BROKER = “ade64e41caa64820a8546270f1a7fdbc.s1.eu.hivemq.cloud”;
uint16_t BRPORT = 1883;
const char* BRUSER = “ckuehnel”;
const char* BRPWD = “Cksz0801”;
const char* CLIENTID = “ESPNOW”;
The connection is built by
void mqttconnect() {
/* Loop until reconnected */
while (!client.connected()) {
Serial.print(“MQTT connecting …”);
/* connect now */
if (client.connect(CLIENTID, BRUSER, BRPWD)) {
Serial.println("connected");
} else {
Serial.print("failed, status code =");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
/* Wait 5 seconds before retrying */
delay(5000);
}
}
}
Is there anything that I do not see?