Facing Issues in building the IoT Sample

Copper Contributor

Hello friends, I am just starting out with Azure Sphere IoT. I am trying to build one of the sample code given on GitHub for IoT but I am facing this error every time when I am trying to run it with my IoT Hub. Where could I be going wrong because I have followed all the  instructions mentioned in the sample Readme.md file and IoTHub.md file. 

 

 Error in monitor built-in event endpoint message: An error occurred during communication with 'DeviceGateway_942fe792a5c6427c8779bb6bc3209405:ihsuprodpnres011dednamespace.servicebus.windows.net:5671'. Check the connection information, then retry.

 

Thanks.

4 Replies

Hi @kenny1597 

It looks like it's the connection between the Cloud Explorer in Visual Studio and the IoT Hub that is having some issues. It's trying to connect to the IoT Hub Default Endpoint to monitor messages that arriving in IoT Hub. This can be caused by several things, and the most common ones are if you are behind a firewall that blocks port 5671 which is the port used by AMQP protocol.
The other potential issue is with consumer groups on this IoT Hub default Endpoint. Do you have another app like IoT Hub explorer or your own custom made app that is monitoring messages on the same port? In which case what can happen is that the "Default" consumer group for that endpoint has reached its max # of readers.

HI @OlivierBloch ,

Thanks for the answer. I think it was because of the firewall. 

Regarding the consumer group, is there a way to solve that?

@kenny1597 unfortunately in the Visual Studio extension you cannot setup the Consumer group. However if you are using Visual Studio Code, you can create a new Consumer Group (in the IoT Hub blade in the Azure Portal) and then configure the Visual Studio code extension to use that new Consumer Group for monitoring events.

@kenny1597 I have already implemented the sample and added the code in the git hub.

https://github.com/rahulshukla422/IoT-Device-To-Cloud