Closed Rotario closed 4 years ago
OK, think I've found the issue: even though the variable header flags are set correctly, fini_message is called with the retain flag 0 https://github.com/jeelabs/esp-link/blob/fe4f565fe83f05e402cc8d8ca3ceefbc39692a1f/mqtt/mqtt_msg.c#L340
The variable header struct is set up but never used????
fini message method: https://github.com/jeelabs/esp-link/blob/4dcd61714b88c56ca293c2ab3cba86cfb05920db/mqtt/mqtt_msg.c#L104
Fixed with 99661ca18ae3c3df3a22c00468260ba22f6e5680
Hi, I've been using the library and it works really well!
Sending messages with retain works perfectly however when the mqtt.lwt method is used, the message does not retain. The retain flag works fine over EL Client connection, and on ESP link the debug page even shows that retain is flagged. However doing some packet sniffing, the actual TCP packet is missing the retain flag. The 04 byte highlighted below should instead be 24 I believe so that retain is flagged. This relates to the flag here, but I've had a look and I can't see where the issue is: https://github.com/jeelabs/esp-link/blob/fe4f565fe83f05e402cc8d8ca3ceefbc39692a1f/mqtt/mqtt_msg.c#L320
I will have a look and try to fix it but I've never built this firmware from source before!
``
``
Thanks, Rowan