Skip to main content



      Home
Home » Eclipse Projects » Paho » Connect to Azure IOT - exception 32109(subscribe Microsoft Azure doesn't work (exception 32109))
Connect to Azure IOT - exception 32109 [message #1796305] Wed, 10 October 2018 03:08 Go to next message
Eclipse UserFriend
I am trying to use Paho MQTT Java for connecting to azure iot hub.
I connect sucessful to IoT-Hub and I publish connectly data to endpoint devices/{client ID}/messages/events.
I have a problem when subscrive to endpoint devices/{client ID}/messages/deviceBound/#.
When subscription send I obtain this exception:
Connection lost (32109) - java.io.EOFException
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(Unknown Source)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)

Extracted from my source:

MqttFactory factory;

private void connect() {
try {
factory.setHostname("xxx.azure-devices.net");
factory.setPort(8883);
factory.setClientId("myClient");
factory.setUsername("");
factory.setPassword("");
factory.setPrimaryKey("81ODMIS/bMAjPS+GNnDJ6w8M36ISLcAa+HgzZVZ7WXa+");
factory.setUseSasToken(true);
factory.connect();
}
....
}
private void publish() {
try {
factory.setPubTopic("devices/myClient/messages/events/");
factory.setContent("test");
factory.publish();
}
.....
}


private void subscribe() {
try {
factory.setSubTopic(devices/myClient/messages/devicebound/#);
factory.subscribe();
}
......
}

Re: Connect to Azure IOT - exception 32109 [message #1796415 is a reply to message #1796305] Fri, 12 October 2018 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

What do you see if you look up the disconnection following these instructions: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-troubleshoot-connectivity
Re: Connect to Azure IOT - exception 32109 [message #1800654 is a reply to message #1796415] Fri, 04 January 2019 08:44 Go to previous message
Eclipse UserFriend
Mentioned below article will help you in resolving the issue as we are using MQTT Azure client which helps to send the data of wireless temperature sensor to Azure IoT hub and create stream analytics using Power Bi

https://ncd.io/getting-started-with-microsoft-azure-and-wireless-temperature-humidity-sensor/

[Updated on: Fri, 04 January 2019 08:47] by Moderator

Previous Topic:Mqtt yielding and MQTTCloseSession at the end of cycle function
Next Topic:Reverse MQTT-SN transparent gateway
Goto Forum:
  


Current Time: Mon Jun 23 12:43:36 EDT 2025

Powered by FUDForum. Page generated in 0.20996 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top