0

I bought a Huzzah ESP8266 which I'm using to control an LED strip through a web client.

I implemented a rabbitmq mqtt server on a raspberry pi.

I started out using the PubSubClient library for mqtt. Everything was going pretty smoothly until I tried sending a Last will message that would be retained.

byte willQoS = 0;
const char* willTopic = "tv/pixel/status";
const char* willMessage = "turn off";
boolean willRetain = true;

client.connect("Pixel", "username", "password", willTopic, willQoS, willRetain, willMessage);

Which results in the payload being sent on timeout but it does not retain. I'm at a loss I've tried changing the variable around, looked through the .cpp library but I don't know enough about mqtt and C++ to solve it

If this is a bug is there any other mqtt libraries out for arduino/esp8266 that I can send last will messages that can be retained?

1 Answer 1

0

I have used mosquitto and it works perfectly fine. It also provides pubsub library in setup.

This is the will messages for

In MQTT, you use the Last Will and Testament (LWT) feature to notify other clients about an ungracefully disconnected client. Each client can specify its last will message when it connects to a broker.

I hope u expects the same thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.