diff --git a/src/main.cpp b/src/main.cpp index 153e894..f5ba5f6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -222,7 +222,7 @@ void reconnect() { 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(lwtTopic, onlineMessage, lwtRetain); // mqttClient.publish("hello","hello world"); // ... and resubscribe Serial.println(F("MQTT subscribe doorbell")); @@ -247,7 +247,7 @@ void reconnect() { void sendMqttMessage(const char *topic, const char *message) { reconnect(); - mqttClient.publish_P(topic, message, true); + mqttClient.publish(topic, message, true); } void setup()