MQTT Tcl API中的错误?

时间:2017-10-13 16:03:58

标签: tcl mqtt

我使用Tcl MQTT API运行一个代码为

的简单订阅者客户端
source mqtt.tcl

proc message_callback { topic message } {
    puts stderr "message on topic $topic: $message"
}

set client [mqtt new]
$client connect my-client $::addr
$client subscribe {BCDS/#} message_callback

vwait _done

它适用于本地经纪人,例如。 mosquitto在同一局域网上运行(至少在运行时没有发现任何问题)。

但是通过互联网上的经纪人,例如。 iot.eclipse.org,打印了几条消息后

message on topic BCDS/XDK/single/20:19:AB:F4:04:56/out/stream:  
{"sn":"20:19:AB:F4:04:56","data":{"acc":
{"x":26,"y":32,"z":1012,"unit":"mG"},"gyro":{"x":1220,"y":-6835,"z":-
2319,"unit":"mdeg/s"},"mag":{"x":40,"y":1,"z":-4,"unit":"uT"},"light":
{"value":7466,"unit":"mLux"},"temp":
{"value":50000,"unit":"mCelsius"},"pressure":
{"value":98897,"unit":"Pascal"},"humidity":{"value":39,"unit":"%rh"}}}
message on topic BCDS/XDK/single/20:19:AB:F4:04:53/out/stream: 
{"sn":"20:19:AB:F4:04:53","data":{"acc":
{"x":26,"y":32,"z":1012,"unit":"mG"},"gyro":{"x":1220,"y":-6835,"z":-
2319,"unit":"mdeg/s"},"mag":{"x":40,"y":1,"z":-4,"unit":"uT"},"light":
{"value":13617,"unit":"mLux"},"temp":
{"value":50000,"unit":"mCelsius"},"pressure":
{"value":98897,"unit":"Pascal"},"humidity":{"value":39,"unit":"%rh"}}}2ú
,BCDS/XDK/single/20:19:AB:F4:04:52
/out/strea{"sn":"20:19:AB:F4:04:52","data":{"acc":
{"x":26,"y":32,"z":1012,"unit":"mG"},"gyro":{"x":1220,"y":-6835,"z":-
2319,"unit":"mdeg/s"},"mag":{"x":40,"y":1,"z":-4,"unit":"uT"},"light":
{"value":7789,"unit":"mLux"},"temp":{"value":50000,"unit":"mCelsius"},

使用堆栈跟踪在10秒内失败

1507901608909 (::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"

我的调试表明此API不处理连接上的串联消息?我对么?有没有人用这个API做任何实质性的事情?

2 个答案:

答案 0 :(得分:0)

这可能是一个错误。这不是报告错误的好渠道; Stack Overflow用于更一般的支持问题。

但是,您可以方便地链接到包的Fossil存储库,这样就可以报告错误(Fossil就是这样)。这是 Ticket New ticket,您可以匿名登录并在此时报告一张票(如果您是匿名的,请留下您的联系方式;它让作者回来如有必要,请与您联系。)

答案 1 :(得分:0)