diff --git a/src/main.cpp b/src/main.cpp index 1d8eefe..e925549 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,6 +37,7 @@ byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xEA }; IPAddress ip(192, 168, 89, 205); IPAddress mqttServerIP(192, 168, 89, 95); + const char *mqttUser = "default"; const char *mqttPassword = "12345678"; @@ -204,19 +205,19 @@ void reconnect() { while (!mqttClient.connected()) { Serial.print(F("Attempting MQTT connection...")); // Attempt to connect - if (mqttClient.connect("doorBellGateway", mqttUser, mqttPassword, lwtTopic, lwtQos, lwtRetain, lwtMessage)) { + if (mqttClient.connect("doorBellGW", mqttUser, mqttPassword, lwtTopic, lwtQos, lwtRetain, lwtMessage)) { Serial.println(F("connected")); // Once connected, publish an announcement... mqttClient.publish_P(lwtTopic, onlineMessage, lwtRetain); // mqttClient.publish("hello","hello world"); // ... and resubscribe Serial.println(F("MQTT subscribe doorbell")); - if (!mqttClient.subscribe("doorbell")) { + if (!mqttClient.subscribe("doorBellGW", 1)) { Serial.println(F("ERROR: Failed to subscribe")); } for (unsigned int i=0; i