DEV Community

Discussion on: Creating an image recognition solution with Azure IoT Edge and Azure Cognitive Services

Collapse
 
tam66662 profile image
Tam66662

@heldss

All of those "ALSA lib" lines have nothing to do with your camera, those are a result of your audio device, so you can ignore them as they are just warnings.

Is there any LED light on your camera that light up when the camera-capture module is running? For example, I have a C922 Logitech webcam, and on the device you can see the white LED lights turn on when camera-capture module starts running.

If you see no lights, or suspect camera-capture module isn't connecting to your camera, then most likely it means your camera device index doesn't match what is in your deployment.template.json file. For example, my webcam shows up as "/dev/video0" and "/dev/video1" whenever I plug it in. Find yours by opening up a terminal window, unplug your camera, type "ls /dev/video*" and see what shows up, then plug in your camera and type "ls /dev/video*" again to determine the number of your camera index. Then in your deployment.template.json, edit the "PathOnHost" and "PathInContainer" parameters to match your device.

                "modules": {
                    "camera-capture": {
                        "version": "1.0",
                        "type": "docker",
                        "status": "running",
                        "restartPolicy": "always",
                        "settings": {
                            "image": "${MODULES.CameraCaptureOpenCV.amd64}",
                            "createOptions": {
                                "Env": [
                                    "Video=0",
                                    "azureSpeechServicesKey=d4f26304e1cc4507b0185e9f257ff292",
                                    "AiEndpoint=http://image-classifier-service:80/image"
                                ],
                                "HostConfig": {
                                    "PortBindings": {
                                        "5678/tcp": [
                                            {
                                                "HostPort": "5678"
                                            }
                                        ]
                                    },
                                    "Devices": [
                                        {
                                            "PathOnHost": "/dev/video0",
                                            "PathInContainer": "/dev/video0",
                                            "CgroupPermissions": "mrw"
                                        },

Restart your camera-capture from Terminal with "iotedge restart camera-capture", and see if it works.