I built and am running a custom app using Ubuntu 24.04 as the base image (due to current requirements of another software I have installed in the image) and am getting an error when I try to run a python script in the container to run the camera stream example script below.
Script:
import cv2
import depthai as dai
with dai.Pipeline() as pipeline:
# Define source and output
cam = pipeline.create(dai.node.Camera).build()
videoQueue = cam.requestOutput((640,400)).createOutputQueue()
# Connect to device and start pipeline
pipeline.start()
while pipeline.isRunning():
videoIn = videoQueue.get()
assert isinstance(videoIn, dai.ImgFrame)
cv2.imshow("video", videoIn.getCvFrame())
if cv2.waitKey(1) == ord("q"):
break
Error:
[depthai][warning] USB protocol not available - If running in a container, make sure that the following is set: "-v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw'"
I have tried running this as a required mount in the toml file but got an error when installing the app. I also tried putting "allowed_device =[{ allow = true, access = "rmw" }]" in the toml file but I still get the same USB protocol error.
Do I need to install something else in the build commands like some other depthai dependencies or is there a specific way I need to run this mount command in my toml file to allow depthai within the app container to access the device? I ssh'd into the camera and the I don't see a /bus directory when running ls /dev