256dpi / arduino-mqtt

MQTT library for Arduino
MIT License
1.01k stars 232 forks source link

Looking for complete setWill() example please #201

Closed MrSiO closed 4 years ago

MrSiO commented 4 years ago

Hi, I'm looking (and would like to populate your wiki with) a complete example on how to set the setWill(); parameters...

Read whatever I could find without success... My following code compiles and uploads to arduino Uno w/Ethernet shield but will is not sent after disconnect. Thx alot!

const char* willTopic = "LWT";
const char* willMessage = "DEAD_ARDUINO";

void setWill(const char topic[], const char payload[]) {
    setWill(willTopic, willMessage); 
    }