I was in need for a small MQTT module with Last Will support and builtin reconnect. I've created one for Node and a derived version for Espruino.
The code has been written from scratch after the OASIS 3.1.1 spec (without implementing stateful sessions, with some side glances at Paco-MQTT and Espruino MQTT). It is smaller than the existing MQTT module and very fast.
Is there an interest in having yet another one (file is attached)?
Nice - thanks! If it's doing stuff that isn't served by another library then I'd definitely be interested in having it in, although my preference is to try and improve existing modules rather than create new ones wherever possible.
How does this compare with something like http://www.espruino.com/tinyMQTT ? I believe that should do last will and reconnect already.
tinyMQTT does not have last will, neither the retain flag on publish nor qos for subscribe (QoS 1 might be useful).
Reconnect seems to be implemented for CONNECT only, while the new module reconnects also if a socket.write fails later or a PINGACK is missing.
In case somewhat less than 127 bytes are enough for topic and payload combined tinyMQTT is an excellent choice though.
Your module looks very well featured and configurable and choice is never bad.
Re tinyMQTT.js - it sets retain flag by default and some recent user contributions have (I think) addressed catching socket write fails, and stabilised reconnect functionality in general. The version on Espruino.com will be updated soon with the changes.
Beyond that, you are right, tinyMQTT support for the MQTT spec is limited.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem