edgexfoundry / edgex-examples

Apache License 2.0
51 stars 52 forks source link

Fail to use usb-camera with evam #216

Closed Ianzhou397 closed 1 year ago

presatish commented 1 year ago

@Ianzhou397 We are facing some issues with the latest usb service and the sample app and we are looking into resolving them. But your issues seem to be different, you should not be facing any mqtt related issues. Can you please share which branch/version of sample app and edgex-compose you are using?

Ianzhou397 commented 1 year ago

I reproduced the documentation and encountered the following error: image image Run in a few seconds and stop

My environment: ubuntu20.04 with VMware workstation,edgex-compose-levski,edgex-examples-main

bnevis-i commented 1 year ago

I don't know if this is the cause of your issue, but one of the errors about /dev/video0 is problematic:

The default compose files give access to device major number 81. https://github.com/edgexfoundry/edgex-compose/blob/main/compose-builder/add-device-usb-camera.yml#L43

It looks like you are trying to use /dev/video0, which may not be mapped into the docker container or may have a different major device number. See https://docs.docker.com/compose/compose-file/compose-file-v3/#devices for granting containers device access.

This is the limit of what I can help with.

presatish commented 1 year ago

@Ianzhou397 We don't need to manually add the usb devices. The guide you are referring to is ancient, sorry about that. For the new upcoming Edgex release we have removed that guide from those docs. Please clean up your edgex and device service stack and use https://github.com/edgexfoundry/edgex-examples/tree/main/application-services/custom/camera-management#camera-management-example-app-service to install and let me know if you are still facing issues. With this the device will be auto discovered.

Ianzhou397 commented 1 year ago

@presatish I'm glad you followed my question. That problem with manually adding the device may be due to a problem with my operation. After referencing the relatively recent documentation, I ran into a slight problem where the data would report an error and then run for a few seconds and then stop. I think it could be a mistake in model reasoning or an error in MQTT. I put the details up, please take a look. Thank you again for your interest.

presatish commented 1 year ago

@Ianzhou397 Yes we recently started seeing error when we start a pipeline from the UI. According to my observation this error happens randomly sometimes, other times the pipelines run fine. We are trying to resolve this error. But I did not see at my end the error happening because of MQTT, it was more to do with the Edge-video-analytics microservice that we are using for doing inference. Please make sure you have configured MQTT properly by following step 7 from https://github.com/edgexfoundry/edgex-examples/tree/main/application-services/custom/camera-management#camera-management-example-app-service.

Ianzhou397 commented 1 year ago

@presatish I followed the docs exactly, and the MQTT configuration was fine, but I got the above error. Is your mistake the same as mine? I always reported an error and never succeeded. In addition, I reported an error when playing a video stream with mplayer.

ajcasagrande commented 1 year ago

@Ianzhou397 From your original images before you edited it, I can see the error lies in unable to communicate with mqtt broker. I get the same error when I do not enable the mqtt broker for edgex.

Please confirm that your mqtt-broker is running properly. Use docker ps and check for the edgex-mqtt-broker service. Make sure your make run or make gen commands include the mqtt-broker argument always. See step 1.6 here

Ianzhou397 commented 1 year ago

@ajcasagrande Glad to hear from you. From this command in step 1.6, I don't see information about the mqtt-broker parameters. I executed this command directly. Do you mean to add information about mqtt-broker after this command? The edgex-mqtt-broker service is running normally. image

ajcasagrande commented 1 year ago

@Ianzhou397 no, if the edgex-mqtt-broker is running, that should be good enough. Make sure the example app is pointed to the correct hostname and port of the broker if not. Earlier builds of the service came with its own mqtt-broker in the evam docker-compose, and were run separate from edgex, so there may be some issues with the current integration.

If you have some logs of all of the services in text format I can take a look.

presatish commented 1 year ago

@Ianzhou397 We have new Edgex release coming up, the release is done but the latest docs still need to be released. With this new release the example app should be more stable. Will keep you posted. Thanks.

presatish commented 1 year ago

@Ianzhou397 You can now try with the latest release - https://github.com/edgexfoundry/edgex-examples/tree/main/application-services/custom/camera-management. Please do let us know if you are still facing issues.

Ianzhou397 commented 1 year ago

@presatish I didn't pay attention to this issue for the time being the other day, but I will reproduce this latest version as soon as possible in the next few days. Thank you for your help and reply.

presatish commented 1 year ago

@Ianzhou397 This issue is open from few weeks, so please let us know if you have any more questions or we can close this. Thanks.

presatish commented 1 year ago

Closing this issue as there were no more questions or comments.