2017-10-13 131 views
0

我使用Tcl MQTT API與代碼MQTT Tcl 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 

運行一個簡單的用戶客戶端和正常工作與當地的券商,如。蚊子在同一個局域網上運行(至少在運行時沒有發現問題)。

但與互聯網上的經紀人,例如。 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來做任何實質性的事情?

+0

嘗試將客戶端id my-client改爲random,以確保它不與現有客戶端衝突。 – hardillb

+0

只有一個連接,它打印一些消息,但在10秒內失敗。修改了我原來的帖子。 –

回答

0

這可能是一個錯誤。這不是報告錯誤的好渠道;堆棧溢出是針對更一般的支持問題。

但是,您可以方便地鏈接到Fossil軟件包的存儲庫,因此您可以在這裏報告錯誤(Fossil非常喜歡)。這是一個機票New ticket,您可以匿名登錄並在該點報告機票(如果需要,請留下您的聯繫方式;如果需要,可以讓作者與您取得聯繫)。

+0

如果你已經檢查過你建議你會看到我的票的鏈接。 –