Azure-Samples / iotedge-scott-or-not

Sample of running an IoT Edge application on both a Windows PC and a Raspberry Pi 3, and ability to use your own custom vision models.
MIT License
22 stars 11 forks source link

Does this actually work...? #2

Open ghost opened 6 years ago

ghost commented 6 years ago

During the Keynote demo at Build, we were encourage to go try this for ourselves. Has anyone actually got this program to work on their device...? I've spent the better part of two days working through the myriad of issues that had to be addressed to get this to run on a new Pi.

I've worked through the issues of deploying to the Azure Container Registry and pulling from the IoT Edge deployment, getting security errors, etc. There were packages to install, required directories I had to create, required environment variables I had to set -- none of which were documented, so I had to figure that out by dissecting the errors and digging through the code.

I've finally got it to sort of run on the device, that is to say - it starts up and processes images locally and assigns a probability value. But it never actually triggers the startup API to blink the lights, and after a few minutes, it always crashes with a exit code 137, which causes the entire stack and iotedgectl to collapse and stop running.

Should I actually be able to replicate this running on a device? Or am I just crazy for trying?

toddwhitehead commented 6 years ago

I'm getting an issue with the requests package not being found in the StartupContainer. @lluppes3M Is this the library you were referring to? It is listed in the requirements.txt but during the docker build I noticed it doesn't pull it down because a version already exists. Does it require a specific version listed in the requirements.txt?

Also be keen to hear what directories you had to create.

ghost commented 6 years ago

After several attempts, I had to clear out the docker images and give it a fresh go, and that resolved a lot of issues (docker images; docker rmi ; docker container ls --all; docker container rm AzureFunctionContainer; docker container rm CustomVisionContainer; docker container rm StartupContainer)

I had to create the image folder that the camera part of the startup wrote to as that didn't exist.

If you look through the code, there are several environment variables that I had to create that the code uses to connect up.

I still have only managed to get it 75% running - I got the package to deploy, the startup running, started the camera, called the vision analyzer, then it all crashes a few minutes later. Next time I restart the edge control, I have to redeploy the packages again or they don't run.

milesrporter commented 6 years ago

I am having issues getting this to run using Ubuntu 16.04 as the "development" machine. I am running into the error below when I try to build the IoT project and push the containers to the container registry in Azure. (I got this far after I realized that the user that I am running "code" under wasn't part of the docker group on my Ubuntu box.)

Has anyone been able to get this stuff to work using Microsoft "code" on Ubuntu?

Maybe I am not understanding this correctly, but I thought I could clone this repo to an Ubuntu system. From there, compile the containers and push them to Azure, and use IoT hub to deploy the code to a RaspberryPi.

Thanks (and thanks for your patience.)

Miles ("I'm NOT a windows guy") Porter

The details...
... Sending build context to Docker daemon 14.85 kB Step 1/11 : FROM resin/rpi-raspbian:jessie ---> f542b3baa5b3 Step 2/11 : EXPOSE 8082 ---> Using cache ---> 2dc11f917cd7 Step 3/11 : ENV PYTHONUNBUFFERED 1 ---> Using cache ---> e955c4f407a6 Step 4/11 : RUN apt-get update && apt-get upgrade -y ---> Running in 2148da3ab983 standard_init_linux.go:178: exec user process caused "exec format error"

baatch commented 6 years ago

I also have problem. When I try to build and push I get this error:

Step 9/11 : RUN pip install http://ci.tensorflow.org/view/Nightly/job/nightly-pi-python3/179/artifact/output-artifacts/tensorflow-1.7.0-cp34-none-any.whl ---> Running in 6996f0a36649 Collecting tensorflow==1.7.0 from http://ci.tensorflow.org/view/Nightly/job/nightly-pi-python3/179/artifact/output-artifacts/tensorflow-1.7.0-cp34-none-any.whl Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0xf5599b10>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /view/Nightly/job/nightly-pi-python3/179/artifact/output-artifacts/tensorflow-1.7.0-cp34-none-any.whl

Is the URL dead? what does this command do and is it needed?