ms-iot / azure-client-tools

Azure Client Tools
Other
43 stars 37 forks source link

Agent connectivity on Windows 10 IoT Enterprise #22

Closed coreypottebaum closed 5 years ago

coreypottebaum commented 5 years ago

I am attempting to connect a Windows 10 IoT Enterprise VM with the device agent and am running into issues (or I am just misunderstanding the documentation). I have created a device in the IoT Hub, copied the connection string, then modified the AzureDeviceManagementClient.json file with the connection string in the "ConnectionString" variable

I have performed these steps but the device has no connectivity in the IoT hub. I have already enabled embedded mode.

The files came directly from the repo (device.agent.2.0.0.1.x64) and I added the device connection string to the AzureDeviceManagementClient.json file in field "connectionString".

I understand that passing the connection string in the configuration file is only for testing but I'm trying to simply set this up for a PoC. My logs are attached below. Thanks in advance for the help!

Thanks in advance.

logs.zip

gmileka commented 5 years ago

Hi coreypottebaum, let me take a look and see what's happening.

gmileka commented 5 years ago

Hi coreypottebaum, I just took a look at the log and the logs show that the connection was successfully established and properties got reported to the twin. However, I have noticed that many agent logs (AzureDM.Core.*) shows error 1740 - which means: "The endpoint is a duplicate." and the time stamps in these logs seem to be within about minute from each other. This makes me think that multiple instances of AzureDeviceManagementClient.exe got spawning concurrently - and this leads to connection problems where all instances are fighting for the connection (when one connects, all others are disconnected). I'd recommend making sure no instances are running. And then start a single instance and wait a little bit. Then, you can check the connectivity status on Azure portal or simply check the contents of the device twin to see if anything got reported from the device... The two commands you can start it with are:

net start AzureDeviceManagementClient

or

AzureDeviceManagementClient.exe -debug
gmileka commented 5 years ago

I've close this issue for now. Please, re-open if it still doesn't work for you.