admin管理员组文章数量:1200344
I am using Azure IoT hub and deploying one custom modules to an edge device. out of 5 modules 4 are looking good. one of them disappears after deploying successfully in Set Modules area.
This module is nothing but a C++ executable with UI which we are deploying as container in IoT edge device
Problem: UI based Customer module gets deployed but vanishes from set module after running successfully.
Setup: Ubuntu 22.04.
Runtime: Docker and Azure IoT Edge Runtime
Installed: x11 and x Server running as our container based exe has UI to display
Steps to reproduce:
I am performing below steps to reproduce the problem.
In IoT hub >> click on Set Modules >> Click on Add IoT edge module
specify module name and container image URL
Environment Settings: Add DISPLAY with value :0
CreateOptions
{ "HostConfig": { "Binds": [ "/dev/mem:/dev/mem", "/dev/gpiomem:/dev/gpiomem" ], "Mounts": [ { "Source": "/dev", "Target": "/dev", "Type": "bind" }, { "Source": "/tmp", "Target": "/tmp", "Type": "bind" }, { "Source": "/tmp/.X11-unix", "Target": "/tmp/.X11-unix", "Type": "bind" } ], "NetworkMode": "host", "Privileged": true }, "Env": [ "DISPLAY=:0" ], "NetworkingConfig": { "EndpointsConfig": { "host": {} } }, }
3. Now this gets deployed to edge device successfully. and I can see the UI on edge device running.
on Azure portal on IoT hub, I can see module running
Now if I go to Set Modules, I am expecting it is listed there. but this module is not visible.
I am deploying other modules and those are visible all the time but not this specific module.
Any help will be appreciated.
I am looking looking forward to see the custom module in set modules list same as all other modules agent and hub can be seen.
I am using Azure IoT hub and deploying one custom modules to an edge device. out of 5 modules 4 are looking good. one of them disappears after deploying successfully in Set Modules area.
This module is nothing but a C++ executable with UI which we are deploying as container in IoT edge device
Problem: UI based Customer module gets deployed but vanishes from set module after running successfully.
Setup: Ubuntu 22.04.
Runtime: Docker and Azure IoT Edge Runtime
Installed: x11 and x Server running as our container based exe has UI to display
Steps to reproduce:
I am performing below steps to reproduce the problem.
In IoT hub >> click on Set Modules >> Click on Add IoT edge module
specify module name and container image URL
Environment Settings: Add DISPLAY with value :0
CreateOptions
{ "HostConfig": { "Binds": [ "/dev/mem:/dev/mem", "/dev/gpiomem:/dev/gpiomem" ], "Mounts": [ { "Source": "/dev", "Target": "/dev", "Type": "bind" }, { "Source": "/tmp", "Target": "/tmp", "Type": "bind" }, { "Source": "/tmp/.X11-unix", "Target": "/tmp/.X11-unix", "Type": "bind" } ], "NetworkMode": "host", "Privileged": true }, "Env": [ "DISPLAY=:0" ], "NetworkingConfig": { "EndpointsConfig": { "host": {} } }, }
3. Now this gets deployed to edge device successfully. and I can see the UI on edge device running.
on Azure portal on IoT hub, I can see module running
Now if I go to Set Modules, I am expecting it is listed there. but this module is not visible.
I am deploying other modules and those are visible all the time but not this specific module.
Any help will be appreciated.
I am looking looking forward to see the custom module in set modules list same as all other modules agent and hub can be seen.
Share Improve this question edited Jan 22 at 13:33 NILESH asked Jan 22 at 13:22 NILESHNILESH 5511 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 0The main reason the custom module gets deployed but vanishes from the "Set Modules" section after running successfully is due to the specification in the deployment manifest being set to "no". This issue occurs when the image is not properly configured or when there are issues with the Privileged
mode, routes, or binding sensitive host paths.
Refer to this MSDOC to develop Azure IoT Edge modules using Visual Studio Code.
The key change here is how the deployment manifest
is structured to include the custom module, similar to the edgeAgent
and edgeHub
modules. This ensures that the module's configuration is correct in terms of its properties
and mount points
.
Below is a sample of an IoT Edge custom module using a deployment manifest for the SimulatedTemperatureSensor
module:
{
"content": {
"modulesContent": {
"$edgeAgent": {
"properties.desired": {
"schemaVersion": "1.1",
"runtime": {
"type": "docker",
"settings": {
"minDockerVersion": "v1.25",
"loggingOptions": "",
"registryCredentials": {}
}
},
"systemModules": {
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.5",
"createOptions": "{}"
}
},
"edgeHub": {
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.5",
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
}
}
},
"modules": {
"SimulatedTemperatureSensor": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.5",
"createOptions": "{}"
}
}
}
}
},
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.1",
"routes": {
"upstream": "FROM /messages/* INTO $upstream"
},
"storeAndForwardConfiguration": {
"timeToLiveSecs": 7200
}
}
},
"SimulatedTemperatureSensor": {
"properties.desired": {
"SendData": true,
"SendInterval": 5
}
}
}
}
}
To deploy the deployment manifest
, use the following Azure CLI command:
az iot edge set-modules --device-id [device id] --hub-name [hub name] --content [file path]
to deploy deployment manifest
.
Refer to this MSDOC for the full deployment manifest and detailed steps.
UI Steps:
Login azure UI>> IoT hub >> click on Set Modules >> Click on Add IoT edge module.
I have added a sample simulated temperature image with the IoT module name SimulatedTemperatureSensor
for the IoT Edge custom module using the image URI mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:latest
. Additionally, I added a route named SimulatedTemperatureSensorToIoTHub
that sends all messages from the simulated temperature module to the IoT Hub with the value FROM /messages/modules/SimulatedTemperatureSensor/* INTO $upstream
.
本文标签:
版权声明:本文标题:azure - UI based Custom module gets deployed but vanishes from set module after running successfully - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738560922a2099218.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
SimulatedTemperatureSensor
for Iot edge custom module. using Image URImcr.microsoft.com/azureiotedge-simulated-temperature-sensor:latest
Additionally, add a route nameSimulatedTemperatureSensorToIoTHub
that sends all messages from the simulated temperature module to IoT Hub with vaule ofFROM /messages/modules/SimulatedTemperatureSensor/* INTO $upstream
. – Sampath Commented Jan 23 at 5:27