该iotedge logs <container>命令公开的日志存储在哪里?
在Linux上通常会在哪里?
我正在为我的 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) 我已按照此处概述的步骤创建了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)
我想念什么?
我正在运行一个 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>
我正在测试新的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门户创建新部署时如何指定选项?
我对 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)
输出打印在哪里?
通常它会在标准输出上,但我的模块在虚拟机的后台运行。显然我可以访问这个虚拟机。我怎样才能看到它?
这对我来说非常有用,可以更好地了解模块如何工作以及如何与物联网中心进行通信。
谢谢你帮助我
是否可以在Windows 10 LTSB(1607)操作系统上运行基于1709的Azure IoT Edge网关容器,或者Azure IoT Edge是否只能与CBB版本的Window 10一起运行?