0
votes

I am using the following link for setting up Hub and connecting the device for sending data to cloud. https://docs.microsoft.com/en-us/azure/iot-hub/quickstart-send-telemetry-dotnet

But it gives me the following errors.

Can anyone help on this.

d-device>dotnet run
IoT Hub Quickstarts #1 - Simulated device. Ctrl-C to exit.

https://skillmatrix.lnttechservices.com:8080/
Unhandled Exception: System.TimeoutException: Operation timeout expired.
   at Microsoft.Azure.Devices.Client.DeviceClient.<>c.<ApplyTimeout>b__74_2(Task t)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at simulated_device.SimulatedDevice.<SendDeviceToCloudMessagesAsync>d__2.MoveNext() in C:\Users\20137539\Downloads\azure-iot-samples-csharp-master\azure-iot-samples-csharp-master\iot-hub\Quickstarts\simulated-device\SimulatedDevice.cs:line 51
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Thanks Rakesh

1
Have you added device connection string in SimulatedDevice.cs file? Why there appears "skillmatrix.lnttechservices.com:8080 "?Rita Han
Its working now..RAKPAT
Hi PAKPAT, how to solve the issue? Can you share your solution here?Rita Han

1 Answers

0
votes

It might happen due to proxy settings if you are running behind firewall.