• Error when trying to run depthai-python API in a Docker container

Hi Craftonix ,
Does it work outside docker, on the macos directly?

Yes, as I already mention in the first sentence of this post: "I am able to successfully run depthai-python API examples natively on macOS and I have been developing this way for a while."

    Hi Craftonix
    Could you try pinging the device to see if it can correctly access it. I would assume you are running them through a router?

    Thanks,
    Jaka

    Yes, I can ping the device from inside my container. Both the device and my laptop (which is running Docker Desktop for macOS) are connected to the same router which gives them a DHCP address. Somthing like:

    Device: 192.168.1.22
    Laptop: 192.168.1.36

      Hi Craftonix
      That's very strange. Have you tried directly specifying the IP address using DeviceInfo?
      What bootloader version are you using?

      Thanks,
      Jaka

      a month later

      I'm also have a similar issue.
      I'm running docker desktop on Mac m2

      OAK 1 D POE

      This is the error:
      [2023-10-05 18:48:42.156] [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'"

      this is from my docker-compose:
      devices:

      • /dev/bus/usb:/dev/bus/usb

      command: ["--device-cgroup-rule=c 189:* rmw"]

      if I test the camera directly on the host it runs. But in docker I can't access.

        Hi keggy
        AFAIK there is currently no USB pass-through option for MacOS, since it doesn't expose the ports as linux does: /dev/bus/usb:/dev/bus/usb.
        You will need to make a VM/use parallels to achieve that on a mac.

        Thanks,
        Jaka

          jakaskerl thanks for the reply. Even if I use the OAK with POE?
          I use an USB-C<-> Lan Adapter.

          I als try do run it on my VM but my Mac is with Apple Silicon.
          I let u know

          I tried on Ubuntu VM in Parallels and it worked!

          and as suggested I use in my Docker-Compose
          "…

          devices:

            - /dev/bus/usb:/dev/bus/usb

          …"

            keggy I don't understand: are you running Docker inside the Ubuntu VM ?

              Craftonix

              At first I tried directly with docker desktop on may Mac.

              Then i installed docker (but not desktop) on my Ubuntu VM which is running in parallels