标签: azure-iot-edge

Azure IoT Edge模块日志位置

iotedge logs <container>命令公开的日志存储在哪里?

在Linux上通常会在哪里?

azure-iot-edge

4
推荐指数
2
解决办法
890
查看次数

在物联网边缘模块中传递环境变量

我正在为我的 Linux arm 设备构建 Microsoft IoT Edge python 模块。我必须从我的deployment.template.json 文件访问python 模块中的环境变量。该文件显示了环境变量如何从环境传递到模块。问题是如何在代码中访问它们。

部署.template.json 文件:

  "$schema-template": "2.0.0",
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.0",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {
              "myRegistryName": {
                "username": "$CONTAINER_REGISTRY_USERNAME",
                "password": "$CONTAINER_REGISTRY_PASSWORD",
                "address": "myRegistryAddress.azurecr.io"
              }
            }
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-agent:1.0",
              "createOptions": {}
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-hub:1.0",
              "createOptions": {
                "HostConfig": {
                  "PortBindings": {
                    "5671/tcp": …
Run Code Online (Sandbox Code Playgroud)

python azure-iot-hub azure-iot-edge

3
推荐指数
1
解决办法
4468
查看次数

417-该设备的边缘代理配置为空吗?

我已按照此处概述的步骤创建了Azure IoT Edge设备:

https://docs.microsoft.com/zh-cn/azure/iot-edge/quickstart-linux

创建部署并检查IoT Edge设备时,我看到以下错误消息:

417 - This device has an empty configuration for the edge agent. Please set a deployment manifest.
Run Code Online (Sandbox Code Playgroud)

我想念什么?

azure-iot-hub azure-iot-edge

2
推荐指数
1
解决办法
1584
查看次数

Python 异步函数返回协程对象

我正在运行一个 python 程序来监听 azure iot hub。该函数返回一个协程对象而不是 json。我看到,如果我们使用异步函数并将其作为普通函数调用,就会发生这种情况,但我创建了一个循环来获取事件,然后使用 run_until_complete 函数。我在这里缺少什么?

async def main():
    try:
        client = IoTHubModuleClient.create_from_connection_string(connection_string)
        print(client)
        client.connect() 
        while True:
            message = client.receive_message_on_input("input1")   # blocking call
            print("Message received on input1")
            print(type(message))
            print(message)

        
    except KeyboardInterrupt:
        print ( "IoTHubClient sample stopped" )
    except:
        print ( "Unexpected error from IoTHub" )
        return

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.close()
Run Code Online (Sandbox Code Playgroud)

输出- 在 input1 上收到消息 <class 'coroutine'> <coroutine object receive_message_on_input at 0x7f1439fe3a98>

python-asyncio python-3.6 azure-iot-sdk azure-iot-edge

2
推荐指数
1
解决办法
7198
查看次数

如何为docker run命令指定--device选项?

我正在测试新的Azure IoT Edge V2。我需要使用--device选项运行部署到边缘设备的Docker映像,如下所示(访问串行端口):

$ docker run --device=/dev/serial/by-id/usb-ELT_SENSOR_EK100_V1.0_SN000001-if00-port0 olavt.azurecr.io/testco2sensor-arm32
Run Code Online (Sandbox Code Playgroud)

--device从Azure门户创建新部署时如何指定选项?

docker azure-iot-hub azure-iot-edge

1
推荐指数
1
解决办法
1300
查看次数

了解 Azure IoT Edge 模块

我对 Azure 和 IoT Edge 非常陌生,我正在尝试了解模块的工作原理。

我遵循了这个很好的教程(https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-c-module),一切似乎都运行正常。

我的问题是关于printf 代码中的内容。(例如这里的第3点:https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#update-the-module-with-custom-code

if (NULL == messageInstance)
{
    printf("Failed allocating 'MESSAGE_INSTANCE' for pipelined message\r\n");
}
Run Code Online (Sandbox Code Playgroud)

输出打印在哪里?

通常它会在标准输出上,但我的模块在虚拟机的后台运行。显然我可以访问这个虚拟机。我怎样才能看到它?

这对我来说非常有用,可以更好地了解模块如何工作以及如何与物联网中心进行通信。

谢谢你帮助我

c printf azure azure-iot-hub azure-iot-edge

1
推荐指数
1
解决办法
762
查看次数

Azure IoT Edge是否适用于任何Windows 10版本

是否可以在Windows 10 LTSB(1607)操作系统上运行基于1709的Azure IoT Edge网关容器,或者Azure IoT Edge是否只能与CBB版本的Window 10一起运行?

azure-iot-edge

0
推荐指数
1
解决办法
182
查看次数