How can I implement the MQTT protocol in the SDK?

  • I checked out the JavaScript mqtt.js module but that comes to a total of 16.000 lines of JS code and as I am not an expert in JS programming, I was wondering if it is really worth to copy&paste this into the module on the hub and try to get it running from there.

    My purpose would be just to publish MQTT requests directly to a MQTT broker. Nothing fancy. (this would be better than using a HTTP-to-MQTT gateway).

    Any hints?

    PS: Better would be to have MQTT already there.

    PPS: Node.js is the basis for the SDK, as I understand, so why not implement MQTT from Node.js as well?

  • I think a mqtt client would be more than enough. Preferably with TLS support.
    No need for a server

  • @xAPPO thx for asking. I started out with the following MQTT implementation (without having tried anything yet):

    I couldn't find a simple "publish" javascript implementation for use - that would have been my ideal solution.

    Any ideas or hints?

  • Is the code you looked at just a client or implements a server too which would really add to the code complexity and size ?

Log in to reply