Azure-Samples / azure-iot-starter-kits

Samples for Azure IoT starter kits.
MIT License
30 stars 39 forks source link

Get to the point of deploying modules, but device does not show up in Code #29

Closed mtyeager closed 5 years ago

mtyeager commented 5 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [X ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

I get to Step 5 in the Deploy Modules page, https://github.com/Azure-Samples/azure-iot-starter-kits/blob/master/seeed/DEPLOY-MODULES.md. In VS Code, I right click on the config/deployment.json, there isn't any item named "Create deployment for Edge device", but there is "Create deployment for single device". When I try this, it gives me an empty palette, it does not show a device. But the device is shown in the Code interface on the bottom left under Azure IoT Hub Devices.

I am unable to deploy. Not sure what the issue is.

Any log messages given by the failure

Expected/desired behavior

Being able to select the Device, and doing a deployment of the modules to it.

OS and Version?

Windows 10

Versions

Latest

Mention any other details that might be useful


Thanks! We'll be in touch soon.

mtyeager commented 5 years ago

I believe this is because the device has the capability, iotedge, is set to false. In Azure, the device appears as a iot device, but not as an edge device. Anyone know why this is? Any way to update it to be an edge device so that I can deploy modules to it? Also, I have tried running az iot edge set-modules directly from the CLI, but get error that the device is not an edge device. And yet on the pi, I can see that the docker edge service is running, and the activity in Azure indicates that it is calling in periodically...

mtyeager commented 5 years ago

GOT IT TO WORK FINALLY! In Azure, I deleted the device that was created by configure-device. I then in Azure SDK CLI ran

az iot hub device-identity create --device-id {device name} --hub-name {hub name} --edge-enabled

This created an edge device in Azure, instead of a hub device. Then I ran the configure-device command passing in all the params:

iot --device-ip {ip address} --wifi-ssid {your wifi SSID} --wifi-password {your wifi password} --resource-group {azure resource group} --iothub {hub name} --device {device name} --container-registry {registry name} --device-user pi --device-password raspberry configure-device

and this added the info needed to the edge device just created. Then refreshed Visual Studio code, and it now shows the edge device. Now when I right click on deployment.json it shows the edge device. Ran the deployment. And finally, the code was deployed to the Raspberry Pi and the object recognition started working.

Looks like there is a bug in the configure-device command such that it does not create an Edge device, does not pass the --edge-enabled parameter.

olivierbloch commented 5 years ago

I just published the new version of the pip package for the azure-iot-starterkit-cli tool which addresses the issue. Device is now created as an IoT Edge device properly when invoking iot configure-device. Reinstall or upgrade the tool from pip to get latest version. Please reopen the issue if you still see the problem.