IoT Edge模块之一处于具有Raspbian OS的退避状态的Raspberry Pi 4 [英] One of the IoT Edge Module is in Backoff state Raspberry Pi 4 with Raspbian OS

查看:55
本文介绍了IoT Edge模块之一处于具有Raspbian OS的退避状态的Raspberry Pi 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Edge设备在Raspberry Pi 4中运行时,我已经开发了一个模块并为arm64v8体系结构构建了映像.我在config文件夹中正确获得了deployment.arm64v8.json文件.但是,当我右键单击Visual Studio Code中的设备并选择为单个设备创建部署"时,将添加模块,但是其中一个模块显示了退避"状态.这可能是问题所在,并严格遵守此文档.

我还尝试了重新启动服务.

设备信息

主机操作系统:Raspberry OS 架构:Arm64v8 容器操作系统:Linux容器

运行时版本

标记为:iotedge 1.0.9.4 Docker/Moby [运行docker版本]:

更新:

我正在尝试在64位Windows Dev Machine中构建arm32映像,我想这就是我遇到此问题的原因.现在我有3个选择.

  1. 从此处安装Raspberry OS的64位版本
  2. 设置32位虚拟机并将其用作开发机,然后 建立32位图片
  3. 我已经在运行WSL,也许正在运行Visual Studio代码 解决方案在那里?

您能告诉我什么是更好的方法吗?

解决方案

我做错了几个问题.第一件事是我试图在64位Windows Dev Machine中构建arm64映像,然后将映像部署到arm32 Raspbian OS,它将永远无法正常工作.您可以通过运行以下命令来查看版本和其他详细信息.

如果显示aarch64,则为64位.如果显示armv7l,则为32位.就我而言,它是arm71.所以现在我不得不在64 bit Windows Host machine上构建一个arm32容器映像,并在Raspberry Pi 4上使用它.根据module.json文件中的版本,以便当我在右后使用选项Build and Push IoT Edge Solution时,带有新标签的新图像将添加到容器注册表中单击deployment.template.json,然后在Visual Studio Code中右键单击设备名称后使用Create Deployment for Single Device选项.然后,当我监视设备(开始监视内置事件端点"选项)时,我将得到此输出.

在此问题上,Microsoft的支持真的很棒.他们确实帮助我解决了我发布的 GitHub问题.

I have developed a module and built the image for arm64v8 architecture as my Edge device is running in Raspberry Pi 4. I got the file deployment.arm64v8.json in the config folder correctly. But when I right-click on the device in Visual Studio Code and select Create Deployment for Single Device, the modules are getting added, but one of the modules is showing Backoff state. What could be the problem here, and was strictly following this doc.

I also tried restarting the services.

Device Information

Host OS: Raspberry OS Architecture: Arm64v8 Container OS: Linux containers

Runtime Versions

iotedged: iotedge 1.0.9.4 Docker/Moby [run docker version]:

Update:

I am trying to build arm32 image in my 64 bit Windows Dev Machine, I guess that is the reason why I am getting this issue. Now I have 3 options.

  1. Install the 64 bit version of Raspberry OS from here
  2. Set up a 32 bit virtual machine and use it as a dev machine and build 32 bit images
  3. I already have a WSL running, maybe running the Visual Studio code solution there?

Could you please tell me what would be the better way?

解决方案

There were a couple of issues where I was doing wrong. First thing is that I was trying to build an arm64 image in my 64 bit Windows Dev Machine and then deploy the image to the arm32 Raspbian OS, which will never work. You can see the version and other details by running the below commands.

If it says aarch64 then it is 64 bit. If it says armv7l then it is 32 bit. In my case, it is arm71. So now I had to build an arm32 container images on my 64 bit Windows Host machine and use it on my Raspberry Pi 4. According to this doc, it is definitely possible.

You can build ARM32 and ARM64 images on x64 machines, but you will not be able to run them

Running was not my problem, as I just had to build the image and I will use it in my Raspberry Pi. To make it work, I had to change my Dockerfile.arm32v7, specifically the first line where we pull the base image.

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore

COPY . ./
RUN dotnet publish -c Release -o out

FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7
WORKDIR /app
COPY --from=build-env /app/out ./

RUN useradd -ms /bin/bash moduleuser
USER moduleuser

ENTRYPOINT ["dotnet", "SendTelemetry.dll"]

The "build-env" image should be the same architecture as the host OS, the final image should be the target OS architecture. Once I made the changes to the docker file, I changed the version in the module.json file inside my module folder so that the new image with a new tag will be added to the Container Registry when I use the option Build and Push IoT Edge Solution after right-clicking deployment.template.json, and then I used Create Deployment for Single Device option after right-clicking on the device name in Visual Studio Code. And then when I monitor the device (Start Monitoring Built-in Event Endpoint option), I am getting this output.

Support with Microsoft was really cool with this issue. They really helped me to solve this GitHub issue that I had posted.

这篇关于IoT Edge模块之一处于具有Raspbian OS的退避状态的Raspberry Pi 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆