Fixed: call publish_P with non-Progmem string
This commit is contained in:
parent
1507f55fc1
commit
78718a0bf0
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue