Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Noway
Novice
191 Views

How to pass the inference data to EdgeX via MQTT when using VAS

Hi~Team

After I got the video source by using webcam in previous post(https://community.intel.com/t5/Intel-Edge-Software-Hub/How-to-change-the-video-source-through-webcam...) ,and now I tried to pass the inference data to EdgeX via MQTT , but something was wrong after I tried it , below  was what I done for more detail

==============================================================================

1. mkdir -p ~/dev/edge_insights_retail/pipelines/object_detection/1

 

2. copy the pipeline.josn from 

 

~/edge_insights_retail/installation/src/Edge_Insights_for_Retail_1.0.0/5e8448fb2d4cc8002a1f3418/rtsf-at-checkout-reference-design/loss-detection-app/pipelines/object_detection/6

to

./pipelines/object_detection/1/pipeline.json

 

3. Modify pipelines/object_detection/1/pipeline.json to v4l2src device=/dev/video0 

Mqtt_pipeline.png

 

4. Type xhost local:root and sudo docker-compose -f docker-compose.edgex.yml up -d under ~/Desktop/edge_insights_retail/installation/src/Edge_Insights_for_Retail_1.0.0/5e8448fb2d4cc8002a1f3418/rtsf-at-checkout-reference-design/loss-detection-app this path to invoke all micro-service

2.png (we saw the error about mqtt docker can't running)

 

5. Running VAS docker with mount outside pipeline method

    (sudo docker run --rm -d --privileged --net=host -v ~/.Xauthority:/root/.Xauthority -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /tmp:/tmp -v ~/dev/edge_insights_retail/pipelines:/home/video-analytics/pipelines -e DISPLAY=$DISPLAY video_analytics_serving_gstreamer_edgex:0.2.2)

3.png

 

 6. Check VAS docker's pipeline with correctly mount from outside path

4.png

 

7. executed curl command with 

curl localhost:8080/pipelines/object_detection/1 -X POST -H 'Content-Type: application/json' -d '{ "source": { "uri": "file:///nil", "type": "uri" }, "destination": { "type": "mqtt", "host": "mqtt:1883", "topic":"AnalyticsData"}}'

and we got error response as below 

5.png

and I also check the previous command

curl localhost:8080/pipelines/object_detection/2 -X POST -H 'Content-Type: application/json' -d '{ "source": { "uri": "file:///nil", "type": "uri" }}'

then we got the same response 6.png

and I got the logs shown as below

8.png

but when I for back to the previous status (without any change just only have folder /pipeline/2 ) , everything works well 

7.png

Is there anything else I need to pay attention to ??

Many thanks

BR

Noway

 

 

 

0 Kudos
3 Replies
Neelay_S_Intel
Employee
179 Views

In the non working case, it looks as if the service has exited (as the curl request is not able to connect to the port 8080).

Can you attach full logs for the working and non working case?

Neelay

Noway
Novice
166 Views

@Neelay_S_Intel 

Hi~Neelay

Good Day

Non working case's log as below

8.png

About working case , In fact , I don't have any working case to catch the logs , and then I try to reboot system , it still the same problem on it. 

Is any way to check which process occupied mqtt service??

BR

Noway

Neelay_S_Intel
Employee
160 Views

The log doesn't indicate any error on the part of the service itself. The only thing I see that looks suspicious is the line about failing to look up mqtt via the docker dns.

I found a similar issue mentioned here:

https://github.com/docker/for-win/issues/2860

It looks as if it may be related to proxy configuration on docker / windows. 

Are you running behind a proxy? 

Can you also confirm that the service / container exits after this network failure?

You can try a simple curl request to localhost:8080 

One other thought: its possible that as you change the configuration of the VAS container to run in privileged mode with the host network - it may not be able to connect to the mqtt broker in the docker network. Is it possible you would need to change the mqtt broker configuration as well?

@Tobias_M_Intel  Do you know if any special consideration needs to be made once elevating privileges to access the webcamera - are there any other settings that need to be changed so the container can still access the mqtt broker?

Reply