Fixed: call publish_P with non-Progmem string

This commit is contained in:
Dirk Jahnke 2021-05-09 18:09:53 +02:00
parent 1507f55fc1
commit 78718a0bf0
1 changed files with 2 additions and 2 deletions

View File

@ -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()