question

sibeeshvenu avatar image
1 Vote"
sibeeshvenu asked SatishBoddu-MSFT edited

The IoT Edge Module is in Backoff state

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.

89305276-bf276c80-d66e-11ea-8fd5-9faf53d22e2f.png

Current Behavior

Only one module "SendTelemetry" is in Backoff state.

Device Information

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

Runtime Versions

iotedged: iotedge 1.0.9.4
Edge Agent [image tag (e.g. 1.0.0)]:
Edge Hub [image tag (e.g. 1.0.0)]:
Docker/Moby [run docker version]:

89305954-8dfb6c00-d66f-11ea-9341-52dba5755188.png

Am I missing anything here?


azure-iot-hubazure-iot-edgeazure-iot
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SatishBoddu-MSFT avatar image
1 Vote"
SatishBoddu-MSFT answered SatishBoddu-MSFT edited

Hello @sibeeshvenu, Thanks for reaching out to us!.
Below is the same thread:

Related to: https://github.com/Azure/iotedge/issues/3353

Are you able to debug your module on your Dev Machine before deploying it?

So before we deploy our module, we make sure it is working properly, for this, we have tools provided by Microsoft that need to be installed on VS2019 or VS Code.

Please follow this document, I always make use of this,

Use Visual Studio 2019 to develop and debug modules for Azure IoT Edge

Use Visual Studio Code to develop and debug modules for Azure IoT Edge

Below is my sample VS2019 IDE snap, where I have the SendTelemetry module, always do debug before deploying it on my Raspberry Pi 3.


15587-image.png

Update 08/07/2020
Thanks to Sibeesh Venu who posted the entire resolution from his research on this issue, worked with the Microsoft team, and posted the complete resolution on Stackoverflow.

Below is the Quote:


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.

enter image description here

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.

16406-image.png



image.png (171.1 KiB)
image.png (153.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.