Yet another MQTT module?

Posted on
  • 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)?

    • Steffen

    1 Attachment

  • 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.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Yet another MQTT module?

Posted by Avatar for Steffen @Steffen

Actions