使用 iotedgehubdev 调试 Azure IoT 模块会引发错误

Debugging Azure IoT Module with iotedgehubdev throws an error

我是 运行:

做了以下步骤:

  1. Azure 上的注册帐户
  2. 创建了免费的 IoT 中心
  3. 已注册边缘设备
  4. (不确定是否需要)创建 VM,安装 Azure 运行时,将其作为步骤 3 中的设备在 IoT 中心注册。
  5. (不确定是否需要)在 docker 中使用命令 docker run -d -p 5000:5000 --restart=always --name registry registry:2
  6. 启动注册表
  7. 在 Visual Studio 中创建了 Win 64 Azure 模块项目,默认设置包括存储库 URL (localhost:5000/moduleName)
  8. 使用从步骤 3 中获取的设备连接字符串设置 iotedgehubdev。
  9. 将模块的项目设置为启动项目
  10. 正在尝试开始调试

模块已构建,但调试未开始。

Visual Studio 中 IoT 中心的输出:

IoT Hub edge module IotEdgeModule1 is using \"input1\" as inputs
C:\Users\MyUser\Documents\Visual Studio 2019\iotedgehubdev\v0.13.0\iotedgehubdev modulecred -l -m "target"
EdgeHubConnectionString=HostName=MyTestHub.azure-devices.net;GatewayHostName=localhost;DeviceId=myEdgeDevice;ModuleId=target;SharedAccessKey=heres_the_key
EdgeModuleCACertificateFile=C:\ProgramData\iotedgehubdev\data\certs\edge-device-ca\cert\edge-device-ca.cert.pem
DOCKER_HOST: 
DOCKER_TLS_VERIFY: 
DOCKER_CERT_PATH: 
Additional Env Variables: 
C:\Users\MyUser\Documents\Visual Studio 2019\iotedgehubdev\v0.13.0\iotedgehubdev start -i "input1"
IoT Edge Simulator has been started in single module mode.
Please run `iotedgehubdev modulecred` to get credential to connect your module.
And send message through:
        curl --header "Content-Type: application/json" --request POST --data '{"inputName": "input1","data":"hello world"}' http://localhost:53000/api/v1/messages
Please refer to https://github.com/Azure/iot-edge-testing-utility/blob/master/swagger.json for detail schema
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
Starting to check connectivity for local port 8883...
[ERROR]: Failed to connect to local port 8883 in specified time, please try again later.
[ERROR]: Failed to start CLI in specified time.
C:\Users\MyUser\Documents\Visual Studio 2019\iotedgehubdev\v0.13.0\iotedgehubdev stop
IoT Edge Simulator has been stopped successfully.

我尝试禁用 Windows Defender,重新启动 - 没有成功。 Visual Studio 以管理员权限启动。是否需要任何其他组件?我已经完全遵循 guide on azure.

我已将 Windows 重新安装到 10 Pro 而不是 Home,这让我可以使用 Docker Desktop 而不是旧的 Docker Toolbox 解决方案。该问题现已解决。