将 Eclipse Kura 与 Microsoft Azure IoT Hub 连接后出现 MQTT 问题

MQTT issue after connecting Eclipse Kura with Micorosoft Azure IoT Hub

我已经使用 Eclipse Kura 创建了到 Microsoft Azure Cloud 的连接:以下是 Kura 的屏幕截图 UI: Screen Shot of Kura

当我 运行 Kura 服务器时,它正在向 IOT Hub 发送一些消息(一次发送 10-15 条消息)。即使没有在 Kura 上部署包或捆绑包,消息数量也会每隔几秒增加一次。

记录器中还有一个 EndOfFileException。以下是在 Kura 中生成的日志:

2016 - 03 - 08 01: 28: 04, 292[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #------------------------------------------------------------
  2016 - 03 - 08 01: 28: 04, 299[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #Connection Properties
2016 - 03 - 08 01: 28: 04, 300[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #broker = ssl: //iothub00.azure-devices.net:8883
  2016 - 03 - 08 01: 28: 04, 300[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #clientId = myfirstdevice
2016 - 03 - 08 01: 28: 04, 300[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #username = iothub00.azure - devices.net / myfirstdevice
2016 - 03 - 08 01: 28: 04, 300[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #password = XXXXXXXXXXXXXX
2016 - 03 - 08 01: 28: 04, 300[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #keepAlive = 30
2016 - 03 - 08 01: 28: 04, 301[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #timeout = 20
2016 - 03 - 08 01: 28: 04, 301[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #cleanSession = true
2016 - 03 - 08 01: 28: 04, 301[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #MQTT version = 3.1.1
2016 - 03 - 08 01: 28: 04, 301[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #willDestination = $EDC / devices / myfirstdevice / messages / events //myfirstdevice/MQTT/LWT
2016 - 03 - 08 01: 28: 04, 302[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #willMessage =
  2016 - 03 - 08 01: 28: 04, 302[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #
  2016 - 03 - 08 01: 28: 04, 302[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #Connecting...
2016 - 03 - 08 01: 28: 04, 303[pool - 10 - thread - 1] INFO o.e.k.c.s.r.LogStatusRunnable - Notification LED fast blinking
2016 - 03 - 08 01: 28: 04, 315[MQTT Con: myfirstdevice] INFO o.e.k.c.s.SSLSocketFactoryWrapper - SSL Endpoint Identification enabled.
2016 - 03 - 08 01: 28: 05, 633[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #Connected!
  2016 - 03 - 08 01: 28: 05, 633[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - #------------------------------------------------------------
  2016 - 03 - 08 01: 28: 05, 634[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.DataServiceImpl - Notified connected
2016 - 03 - 08 01: 28: 05, 634[pool - 10 - thread - 1] INFO o.e.k.c.s.r.LogStatusRunnable - Notification LED slow blinking
2016 - 03 - 08 01: 28: 05, 634[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.DataServiceImpl - New session established.Unpublishing all in -flight messages.Disregarding the QoS level, this may cause duplicat$
2016 - 03 - 08 01: 28: 05, 635[pool - 10 - thread - 1] INFO o.e.k.c.s.r.LogStatusRunnable - Notification LED on
2016 - 03 - 08 01: 28: 05, 645[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.DataServiceImpl - Storing message on topic: $EDC / #account - name / #client - id / MQTT / BIRTH, priority: 0
2016 - 03 - 08 01: 28: 05, 651[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.DataServiceImpl - Stored message on topic: $EDC / #account - name / #client - id / MQTT / BIRTH, priority: 0
2016 - 03 - 08 01: 28: 05, 657[DataServiceImpl: Submit] INFO o.e.k.c.d.t.m.MqttDataTransport - Publishing message on topic: $EDC / devices / myfirstdevice / messages / events //myfirstdevice/MQTT/BIRTH with QoS: 0
2016 - 03 - 08 01: 28: 05, 667[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.t.m.MqttDataTransport - Subscribing to topic: $EDC / devices / myfirstdevice / messages / events //myfirstdevice/# with QoS: 1
2016 - 03 - 08 01: 28: 05, 778[DataServiceImpl: ReconnectTask] ERROR o.e.k.c.d.t.m.MqttDataTransport - Cannot subscribe to topic: $EDC / devices / myfirstdevice / messages / events //myfirstdevice/#
Connection lost(32109) - java.io.EOFException
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java: 154)
at java.lang.Thread.run(Thread.java: 745)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java: 267)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java: 89)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java: 112)
  ...1 more
2016 - 03 - 08 01: 28: 05, 786[DataServiceImpl: ReconnectTask] WARN o.e.k.c.c.CloudServiceImpl - Cannot setup cloud service connection
2016 - 03 - 08 01: 28: 05, 787[MQTT Rec: myfirstdevice] WARN o.e.k.c.d.t.m.MqttDataTransport - Connection Lost
Connection lost(32109) - java.io.EOFException
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java: 154)
at java.lang.Thread.run(Thread.java: 745)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java: 267)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java: 89)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java: 112)
  ...1 more
2016 - 03 - 08 01: 28: 05, 787[DataServiceImpl: ReconnectTask] INFO o.e.k.c.Cloudlet - Cloud Client Connection Restored
2016 - 03 - 08 01: 28: 05, 788[MQTT Rec: myfirstdevice] INFO o.e.k.c.d.DataServiceImpl - connectionLost
2016 - 03 - 08 01: 28: 05, 789[MQTT Rec: myfirstdevice] INFO o.e.k.c.d.DataServiceImpl - Reconnect task running.Stopping it
2016 - 03 - 08 01: 28: 05, 788[DataServiceImpl: ReconnectTask] INFO o.e.k.c.Cloudlet - Cloud Client Connection Restored
2016 - 03 - 08 01: 28: 05, 789[MQTT Rec: myfirstdevice] INFO o.e.k.c.d.DataServiceImpl - Starting reconnect task with initial delay 5
2016 - 03 - 08 01: 28: 05, 789[pool - 10 - thread - 1] INFO o.e.k.c.s.r.LogStatusRunnable - Notification LED slow blinking
2016 - 03 - 08 01: 28: 05, 789[DataServiceImpl: ReconnectTask] INFO o.e.k.c.Cloudlet - Cloud Client Connection Restored
2016 - 03 - 08 01: 28: 05, 790[DataServiceImpl: ReconnectTask] INFO o.e.k.c.d.DataServiceImpl - Connected.Reconnect task will be terminated.

感谢任何帮助。 另外,由于我是 Kura 的新手,如果有人可以向我推荐有关 DataService 的分步教程,那就太好了。

谢谢

我们(Azure IoT SDK 团队)刚刚与 Kura 开发团队合作启动了一项正在进行的工作,为 Azure IoT 中心提供 Eclipse Kura 连接器。您可以在此处查看正在进行的工作:https://github.com/andrew-buckley/kura/tree/AzureIntegration

  • 奥利维尔