LWMQTT set_will implementation

Hi, during the development of a project I noticed that the MQTTClient in the LWMQTT library doesn’t include a method to set LWT on connection. I find that library more stable and better than the standard MQTT one. If possible, how can I edit the LWMQTT library to add the method?

Hi @ViRiccio
To edit the library, head over to :

If anyone is interested, I managed to get a working version editing mqtt.py (I added a python C function wrapper) and lwmqtt_ifc.c (I added the C function to set the will on a topic).
Below there’s the C function, which accepts 2 parameters: the topic and the LWT message, both as strings. I also changed line 15 to

uint8_t *mqtt_client_username, *mqtt_client_password, *mqtt_client_will_topic, *mqtt_client_will_message, *mqtt_clientid;