Updated 2017-10-13 14:15:21 by gambitcomm

MQTT stands for Message Queue Telemetry Transport. It is a publish/subscribe, extremely simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable networks.

2017-06-05 sbron I created an MQTT client library and published it on chiselapp

2017-08-21 dzach Thanks sbron! The client library works nicely with mosquitto. Maybe it should find its place in tcllib?

Is there a way to figure out if a client is currently connected to an mqtt broker?

[gambitcomm] - 2017-10-13 14:15:21

I am running a simple subscriber client with this code, eg.
        set client [mqtt new]

        $client connect uwe-client $::addr

        $client subscribe {BCDS/#} message_callback

and while it works with a local broker, eg. mosquitto, it fails with an internet broker, eg. iot.eclipse.org.

The stack trace is
your script1507901608909 (::oo::Obj22_coro): can't read "msgid": no such variable
    while executing
"dict set rc msgid $msgid"
    (class "::mqtt" method "receive" line 35)
    invoked from within
"my receive"
    (class "::mqtt" method "listen" line 27)
    invoked from within
"my listen"

While debugging this problem, it seems that the API cannot handle concatenated messages into one packet. I cannot prove it without much effort. Can someone tell me yes or no whether concatenated messages are handled properly, eg. the packet to the receive method contains a MQTT request and a half?