-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GatewayHostName #64
Comments
Thanks for reporting this. Is the .net framework application able to get its device twin directly from the cloud i.e. without the GatewayHostName? |
Yes, if I run it locally on my machine and same connection string without providing GatewayHost name it works. In customer environment we can't have direct connection over mqtt to iothub hence using iotedge. |
We have a known issue connecting from a .Net framework module to EdgeHub. This issue might be related to that. I am investigating further. |
I was able to reproduce the issue on my setup. What I observed is that connecting with Mqtt is causing an exception in EdgeHub and that is what is preventing the twin operation from succeeding. I would like to confirm that this is the same issue in your setup. Could you please check your EdgeHub logs (sudo docker logs edgeHub) to verify that an exception is being thrown when the device tries to get its twin. A workaround for this issue is to use Amqp to connect. I verified that this works on my setup. Please let me know if you encounter further issues. |
I will file a bug for a leaf device not being to connect to EdgeHub using MQTT. @AdamMachera confirmed that .Net framework and .Net core leaf devices can connect to EdgeHub over AMQP. |
This was related to this issue - Azure/azure-iot-sdk-csharp#558 (comment) |
It is still not working for MQTT for .net framework 4.6.2 after updating Microsoft.Azure.Device.Client to version 1.18.0. SDK team can use this code to replicate this issue
I received exception: In the connection string |
Hi Adam, We actually tested the scenario before we released and it did work for us. We will try again today with your code and get back to you. |
Probably this is not relevant (if this was deviceclient sdk issue) but my iotedge is still using edgeHub and edgeAgent in version 1.0.0 |
So we ran the same code that you provided, and it connected fine. Can you try upgrading to EdgeHub 1.0.1, just in case? Also, could there be any network issues that are preventing you from connecting? (like some firewall, ports, etc?). Btw, you are using Linux containers, right? |
I don't know what I'm doing wrong. mcr.microsoft.com/azureiotedge-hub:1.0.1 "/bin/sh -c 'echo "$…" 6 minutes ago Up 6 minutes 0.0.0.0:443->443/tcp, 0.0.0.0:5671->5671/tcp, 0.0.0.0:8883->8883/tcp I'm able to get device twin using amqp but unable to get it using mqtt. |
Is there any exception on the EdgeHub, when you try to connect or get the twin? |
It is throwing same exception - timeoutexception. Trace for connecting using telnet on port 8883 For application running .net 4.6.2 and latest DeviceClient sdk I see no SYN and ACK packages being exchanged. |
I did some further investigation. On one windows 10 machine that was hosting iotedge on VM I was able to telnet on 8883, connect and get device twin. Once I added on second machine to file c:\Windows\system32\drivers\etc\hosts entry |
Unable to get device twin using GatewayHostName in .net framework 4.6.2 (When using .net core project application is able to download device twin.
The connection string that is used:
HostName=someiothub.azure-devices.net;DeviceId=21219-00260;SharedAccessKey=somekey;GatewayHostName=192.0.2.5
Expected Behavior
Behaviour should be same for .net core and application in .net framework 4.6.2
Current Behavior
When starting 462 application I don't see anything in edge logs.
If I run .net core application I see some logs that were attached to this issue.
Steps to Reproduce
Open DeviceTwinTester.sln and try getting device twin using .net core and later using .net framework 462 application.
Context (Environment)
Device (Host) Operating System
Windows 7 is connecting to iot edge to get device twin.
Iot edge is running on Ubuntu 18.04.
Architecture
amd64
Container Operating System
Runtime Versions
iotedged
iotedge 1.0.0 (52ef77d)
Edge Agent
mcr.microsoft.com/azureiotedge-agent:1.0
Edge Hub
mcr.microsoft.com/azureiotedge-hub:1.0
Docker
Client:
Version: 18.06.0-dev
API version: 1.37
Go version: go1.10.2
Git commit: daf021fe
Built: Mon Jun 25 21:07:53 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: dev
API version: 1.37 (minimum version 1.12)
Go version: go1.10.2
Git commit: 9aac187
Built: Mon Jun 25 20:43:05 2018
OS/Arch: linux/amd64
Experimental: false
logWhenConnectedFromNetCore.txt
DeviceTwin.zip
Logs
Additional Information
The text was updated successfully, but these errors were encountered: