【发布时间】:2018-11-11 09:22:43
【问题描述】:
我正在使用以下链接设置 Hub 并连接设备以将数据发送到云端。 https://docs.microsoft.com/en-us/azure/iot-hub/quickstart-send-telemetry-dotnet
但它给了我以下错误。
谁能帮忙解决这个问题。
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()
谢谢 拉克什
【问题讨论】:
-
您是否在 SimulatedDevice.cs 文件中添加了设备连接字符串?为什么会出现“skillmatrix.lnttechservices.com:8080”?
-
它现在正在工作..
-
嗨PAKPAT,如何解决这个问题?你能在这里分享你的解决方案吗?
标签: c# azure azure-iot-hub