• DepthAI-v2
  • OAK Camera connectivity errors that resolve after running DepthAI Viewer?

I'm on MacOS, but would also appreciate guidance for Ubuntu 20.04.

I'm trying to run the example CMake project provided by the DepthAI team here, but I see the following output:

[14442C103144DED600] [0.1] [1.287] [ColorCamera(0)] [error] Camera not detected on socket: 0

What's interesting is the program works just fine after I run the DepthAI Viewer python module. I guess it validates my camera working (which is nice) but I need my program to work in isolation. What is DepthAI viewer doing that I'm missing?

I've set up the SDK on my machine following the instructions here for MacOS.

How can I resolve this behavior?

    Here's what the output looks like after running cam_test.py:

    Enabled cameras:
       cama : color
       camb : mono
       camc : mono
    CAM:  cama
    CAM:  camb
    CAM:  camc
    Connected cameras:
     -socket CAM_A : IMX378 4056 x 3040 focus:fixed - COLOR
     -socket CAM_B : OV9282 1280 x  800 focus:fixed - MONO
     -socket CAM_C : OV9282 1280 x  800 focus:fixed - MONO
    USB speed: HIGH
    IR drivers: [('LM3644', 2, 99)]
    Cam:      cama          camb          camc     [host | capture timestamp]
    FPS:   0.00|  0.00   0.00|  0.00   0.00|  0.00 2024-11-11 10:38:13.455 Python[9126:821760] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
    FPS:   7.20|  7.26   7.21|  7.20   7.20|  7.09

    nmhossain02
    OK, the device works.. The script you have linked to is 3y old and deprecated. Use depthai-core/examples to work with the device.

    Thanks,
    Jaka

      jakaskerl These examples work, but I don't understand why.

      Borrowing the source code from the updated examples into the structure of the old example still results in the same behavior. In fact, running the updated examples has the effect of making the older example work again (as with running DepthAI viewer).

      Since I'm building my project from the ground-up as minimally as possible, it would be sweet if I could understand what the old example is missing that's causing connectivity issues

        nmhossain02
        Can you make a MRE? This examples are before my time but I could probably work out the cause if I have a MRE of the code.

        Thanks,
        Jaka

          nmhossain02
          Okay, the script seems to be copied from rgb_video. I see you are building with depthai 2.21.2. Any particular reason for not using the latest? That would be my first recommendation.

          Why it doesn't work? Difficult to say, there might be enumeration issues that are solved on newer version of depthai and are cached, so script works even on older version. You can also try with DEPTHAI_DEBUG=1 environment variable to see if it gives you more in-depth info as to why the socket is not detected.

          Thanks,
          Jaka