I just bought a new OAK-D W camera to evaluate for our robots. I have only gotten the camera to work once, very briefly, with the demo app. I have used an OAK-D Pro successfully, but am having a lot of problems with this new camera.

Camera P/N: OACK-D-W-97
OAK-D Wide OV9782
System: Ubuntu 22.04.2 LTS, Linux 5.19.0-50-generic

I have tried using the depthai_demo.py app, the ros1 launch file examples and the ros2 launch file examples. They generally report the same error:

[1944301071E4722700] [1.1.1.1] [1.718] [ColorCamera(0)] [error] Camera not detected on socket: 0

Here is the full output from the latest fetch of depthai main branch f5d26aade0a88f4180356c74d753515c38ae0e9b

$ python3 depthai_demo.py                                                                                           
Using depthai module from:  /home/travis/.local/lib/python3.10/site-packages/depthai.cpython-310-x86_64-linux-gnu.so
Depthai version installed:  2.21.2.0                                                                                
Setting up demo...                                                                                                  
Available devices:                                                                                                  
[0] 1944301071E4722700 [X_LINK_UNBOOTED]                                                                            
USB Connection speed: UsbSpeed.SUPER                                                                                
Disabling depth...                                                                                                  
Disabling depth preview...                                                                                          
Disabling depthRaw preview...                                                                                       
Disabling left preview...                                                                                           
Disabling rectifiedLeft preview...                                                                                  
Disabling right preview...                                                                                          
Disabling rectifiedRight preview...                                                                                 
[1944301071E4722700] [1.1.1.1] [1.718] [ColorCamera(0)] [error] Camera not detected on socket: 0                    

Subsequent runs of the depthai_demo.py sometimes produce different errors:

❯ python3 depthai_demo.py                                                                                           
Using depthai module from:  /home/travis/.local/lib/python3.10/site-packages/depthai.cpython-310-x86_64-linux-gnu.so
Depthai version installed:  2.21.2.0                                                                                
Setting up demo...                                                                                                  
  File "/home/travis/src/depthai/depthai_demo.py", line 656, in run                                                 
    self.instance.run_all(self.conf)                                                                                
  File "/home/travis/src/depthai/depthai_demo.py", line 132, in run_all                                             
    self.setup(conf)                                                                                                
  File "/home/travis/src/depthai/depthai_demo.py", line 180, in setup                                               
    self._deviceInfo = getDeviceInfo(self._conf.args.deviceId, args.debug)                                          
  File "/home/travis/.local/lib/python3.10/site-packages/depthai_sdk/utils.py", line 226, in getDeviceInfo          
    raise RuntimeError("No DepthAI device found!")                                                                  
RuntimeError: No DepthAI device found!                                                                              

After pulling this latest branch, I re-ran python requirements install (python3 install_requirements.py).

The time that I did get it to work was the first reboot after installing all of the dependencies for the first time. When I tried to change the "SHAVEs" parameter, everything froze, then crashed. After that, I couldn't get reconnected to the camera, even after a reboot.

What do I need to do to fix this? Is this a hardware problem?

    jakaskerl There is no script in the depthai repo called cam_test.py. The only script that is close to that is tests/guided_manual_test.py, which just repeatedly starts the depthai_demo.py script in various modes, but it gets exactly the same errors that I posted above and then reports "Success!" at the end (even though nothing was successful).

      Thank you for the reply.

      I cloned it and it appears to successfully build and install....

      python3 -m pip install .                                                                                                                                                                                                             
      Defaulting to user installation because normal site-packages is not writeable                                                                                                                                                          
      Processing /home/travis/src/depthai-python                                                                                                                                                                                             
        Installing build dependencies ... done                                                                                                                                                                                               
        Getting requirements to build wheel ... done                                                                                                                                                                                         
        Preparing metadata (pyproject.toml) ... done                                                                                                                                                                                         Building wheels for collected packages: depthai                                                                                                                                                                                        
        Building wheel for depthai (pyproject.toml) ... done                                                                                                                                                                                 
        Created wheel for depthai: filename=depthai-2.22.0.0.dev0+236e7ec1b8ac2c7573d980f45efe90e9b3df812f-cp310-cp310-linux_x86_64.whl size=10469558 sha256=c55b6e7395b5949dacdd7a360970d3b5601e9fec87bb2c9ec37dad24bc5d75b4                
        Stored in directory: /home/travis/.cache/pip/wheels/2a/3d/86/f4bcd1b369e97e84ca7ee874b8428bcf470da91836fd2f4795                                                                                                                      
      Successfully built depthai                                                                                                                                                                                                             
      Installing collected packages: depthai                                                                                                                                                                                                 
        Attempting uninstall: depthai                                                                                                                                                                                                        
          Found existing installation: depthai 2.22.0.0.dev0+236e7ec1b8ac2c7573d980f45efe90e9b3df812f                                                                                                                                        
          Uninstalling depthai-2.22.0.0.dev0+236e7ec1b8ac2c7573d980f45efe90e9b3df812f:                                                                                                                                                             Successfully uninstalled depthai-2.22.0.0.dev0+236e7ec1b8ac2c7573d980f45efe90e9b3df812f                                                                                                                                          
      Successfully installed depthai-2.22.0.0.dev0+236e7ec1b8ac2c7573d980f45efe90e9b3df812f

      But, when I try to run cam_test.py, I get a qt error related to xcb:

      python3 utilities/cam_test.py                                                                                                                                                                                                        
      QObject::moveToThread: Current thread (0x5565305d4be0) is not the object's thread (0x5565308a3af0).                                                                                                                                    
      Cannot move to target thread (0x5565305d4be0)                                                                                                                                                                                          
                                                                                                                                                                                                                                             
      qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/travis/.local/lib/python3.10/site-packages/cv2/qt/plugins" even though it was found.                                                                              
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.                                                                                                
                                                                                                                                                                                                                                             Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.                                                                 
                                                                                                                                                                                                                                             
      Stack trace (most recent call last):                                                                                                                                                                                                   
      #28   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in                                                                                                                                                                         
      #27   Object "python3", at 0x55652f207ac4, in _start                                                                                                                                                                                   
      #26   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f4aace5fe3f, in __libc_start_main                                                                                                                                                
      #25   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f4aace5fd8f, in                                                                                                                                                                  
      #24   Object "python3", at 0x55652f207bcc, in Py_BytesMain                                                                                                                                                                             
      #23   Object "python3", at 0x55652f231c3d, in Py_RunMain                                                                                                                                                                               #22   Object "python3", at 0x55652f240a42, in _PyRun_AnyFileObject                                                                                                                                                                     
      #21   Object "python3", at 0x55652f240d47, in _PyRun_SimpleFileObject                                                                                                                                                                  
      #20   Object "python3", at 0x55652f241864, in                                                                                                                                                                                          
      #19   Object "python3", at 0x55652f23a96a, in                                                                                                                                                                                          
      #18   Object "python3", at 0x55652f241b17, in                                                                                                                                                                                          #17   Object "python3", at 0x55652f214c55, in PyEval_EvalCode                                                                                                                                                                          
      #16   Object "python3", at 0x55652f11f175, in                                                                                                                                                                                          #15   Object "python3", at 0x55652f128759, in _PyEval_EvalFrameDefault                                                                                                                                                                 
      #14   Object "python3", at 0x55652f13a4eb, in _PyFunction_Vectorcall                                                                                                                                                                   #13   Object "python3", at 0x55652f1290e6, in _PyEval_EvalFrameDefault                                                                                                                                                                 #12   Object "python3", at 0x55652f1306cb, in _PyObject_MakeTpCall                                                                                                                                                                     #11   Object "/usr/lib/python3/dist-packages/PyQt5/sip.cpython-310-x86_64-linux-gnu.so", at 0x7f4a880ce8b8, in                                                                                                                         #10   Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/QtWidgets.abi3.so", at 0x7f4a79106ffa, in                                                                                                                         #9    Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/QtWidgets.abi3.so", at 0x7f4a79106f1c, in                                                                                                                         #8    Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Widgets.so.5", at 0x7f4a78767aa8, in QApplicationPrivate::init()                                                                                    #7    Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5", at 0x7f4a7956accb, in QGuiApplicationPrivate::init()                                                                                     #6    Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Core.so.5", at 0x7f4a80aa4fe2, in QCoreApplicationPrivate::init()                                                                                   #5    Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5", at 0x7f4a795682ac, in QGuiApplicationPrivate::createEventDispatcher()                                                                    #4    Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5", at 0x7f4a79567f9f, in QGuiApplicationPrivate::createPlatformIntegration()                                                                #3    Object "/home/travis/.local/lib/python3.10/site-packages/PyQt5/Qt5/lib/libQt5Core.so.5", at 0x7f4a808929bb, in QMessageLogger::fatal(char const*, ...) const                                                                     #2    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f4aace5e7f2, in abort                                                                                                                                                            #1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f4aace78475, in raise                                                                                                                                                            #0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f4aacecca7c, in pthread_kill                                                                                                                                                     Aborted (Signal sent by tkill() 308978 1000)                                                                                                                                                                                           [1]    308978 IOT instruction (core dumped)  python3 utilities/cam_test.py
      cmake version 3.22.1

      Unfortunately, I think this error is completely unrelated to the OAK-D W camera. I tried running this with my OAK-D Pro and got the same crash.

        travis_riggs Instead of running python3 cam_test.py, could you try running python3 cam_test.py -rs, which should skip the qt requirement (no GUI), and just use opencv?

        That is a much better proposal.

        Here is the output:

        $ python3 utilities/cam_test.py -rs                                                                   
        Enabled cameras:                                                                                      
            rgb : color                                                                                       
           left : mono                                                                                        
          right : mono                                                                                        
           camd : color                                                                                       
        DepthAI version: 2.21.2.0                                                                             
        DepthAI path: /home/travis/.local/lib/python3.10/site-packages/depthai.cpython-310-x86_64-linux-gnu.so
        [1944301071E4722700] [1.2] [1.435] [ColorCamera(9)] [error] Camera not detected on socket: 3          
        [1944301071E4722700] [1.2] [1.436] [MonoCamera(7)] [error] Camera not detected on socket: 2           
        [1944301071E4722700] [1.2] [1.436] [MonoCamera(5)] [error] Camera not detected on socket: 1           
        [1944301071E4722700] [1.2] [1.437] [ColorCamera(3)] [error] Camera not detected on socket: 0          
        Connected cameras:                                                                                    
        USB speed: SUPER                                                                                      
        IR drivers: []                                                                                        
        Cam:      rgb           left          right         camd     [host | capture timestamp]               
        FPS:   0.00|  0.00   0.00|  0.00   0.00|  0.00   0.00|  0.00                  

        It opened 4 windows: rgb, left, right, and camd. They all showed a black rectangle with a white background, like this:

        Note that this is running 2.21.2.0, which is the version that depthai_demo.py wants. Earlier, I was trying to run with 2.22.0. Does 2.21.2 support the OAK-D W?

        I am hesitant to go through some of those uninstall/reinstall steps because, at the moment, I at least have something working for the OAK-D Pro. I can run depthai_demo.py and the ros2 examples to evaluate my OAK-D Pro camera. Before, while going through some of the troubleshooting steps of messing with my dependencies to get the Wide camera to work, it broke my ability to run the OAK-D Pro.

        • erik replied to this.
          7 days later

          Hello here from Japan. We bought two cameras from a retailer and we seem to have the same kind of issue. Only mono cameras are working on the oak-D PRO WIDE.
          Camera worked on the initial pipeline we tried and since then we have nothing. One thing is that we were using the camera in multi-threading and the issue might be related to a non-clean exit ? However if it is software related, I would supposed it would have been fixed by unplugging the camera

          We tried using the device_manager to reset our devices but it seems to only reset the calibration.
          Running the cam_test here are our logs

          Enabled cameras:
              rgb : color
             left : mono
            right : mono
             camd : color
          DepthAI version: 2.22.0.0
          DepthAI path: /Users/enea.debollivier/dev/aif_internal_oak_d_camera/depthai-python/.venv/lib/python3.11/site-packages/depthai.cpython-311-darwin.so
          /Users/enea.debollivier/dev/aif_internal_oak_d_camera/depthai-python/utilities/cam_test.py:284: DeprecationWarning: Use constructor taking 'UsbSpeed' instead
            with dai.Device(*dai_device_args) as device:
          [184430109160AC0F00] [1.1.4] [0.768] [ColorCamera(9)] [error] Camera not detected on socket: 3
          Connected cameras:
           -socket CAM_A : IMX378 4056 x 3040 focus:auto  - COLOR
           -socket CAM_B : OV9282 1280 x  800 focus:fixed - MONO
           -socket CAM_C : OV9282 1280 x  800 focus:fixed - MONO
          USB speed: SUPER
          IR drivers: [('LM3644', 2, 99)]
          Cam:      rgb           left          right         camd     [host | capture timestamp]
          FPS:   0.00|  0.00  28.12| 28.01  28.12| 28.01   0.00|  0.00 

          To test I built the C++ version of the code from the develop branch but did not have more success.

          We also tried to run our own pipeline with the debug mode.

          USB speed: UsbSpeed.HIGH
          [184430109160AC0F00] [1.1.4] [1.852] [system] [info] Memory Usage - DDR: 35.31 / 340.34 MiB, CMX: 2.40 / 2.50 MiB, LeonOS Heap: 22.74 / 77.23 MiB, LeonRT Heap: 3.73 / 41.14 MiB
          [184430109160AC0F00] [1.1.4] [1.852] [system] [info] Temperatures - Average: 46.40C, CSS: 46.68C, MSS 46.00C, UPA: 46.90C, DSS: 46.00C
          [184430109160AC0F00] [1.1.4] [1.852] [system] [info] Cpu Usage - LeonOS 13.95%, LeonRT: 5.61%
          [184430109160AC0F00] [1.1.4] [2.853] [system] [info] Memory Usage - DDR: 35.31 / 340.34 MiB, CMX: 2.40 / 2.50 MiB, LeonOS Heap: 22.74 / 77.23 MiB, LeonRT Heap: 3.73 / 41.14 MiB
          [184430109160AC0F00] [1.1.4] [2.853] [system] [info] Temperatures - Average: 46.85C, CSS: 47.35C, MSS 46.00C, UPA: 46.90C, DSS: 47.13C
          [184430109160AC0F00] [1.1.4] [2.853] [system] [info] Cpu Usage - LeonOS 10.70%, LeonRT: 1.21%

          We tried to use the camera on a mac and a jetson but on both it was not working.

          Important to note. Running this C++ example worked example/video_mobilenet. So I suppose that it is directly related to the color camera itself.

          As we bought through a japanese retailer we will try to return the camera to them. But as we had this issue twice, It might be interesting investigating it.

          Thanks for your help

          • erik replied to this.
            a month later

            Hi,
            I had the same issue of Camera not detected on socketand Erik helps me
            The solution is to update depthai version:

            pip3 install depthai==2.22.0.0.dev0+874b317ab526d91dde84b68d756334a338d4da58 --extra-index-urlhttps://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local

            And run again the depthai-python/utilities/cam_test.py script

            In addition I created a distilled code for connecting the two rgb cameras and save one image from each camera, maybe it will be useful for someone, just as a sanity check:

            import cv2
            import time
            import time
            import depthai as dai
            
            # Params
            target_path = 'PUT YOUR TARGET PATH FOR SAVING THE IMAGES HERE'
            cam_list = ['rgb', 'camd']
            cam_socket_opts = {
                'rgb'  : dai.CameraBoardSocket.CAM_A,
                'camd' : dai.CameraBoardSocket.CAM_D,
            }
            
            # Start defining a pipeline
            pipeline = dai.Pipeline()
            control = pipeline.createXLinkIn()
            control.setStreamName('control')
            
            cam = {}
            xout = {}
            streams = []
            tofConfig = {}
            for c in cam_list:
                xout[c] = pipeline.createXLinkOut()
                xout[c].setStreamName(c)
                streams.append(c)
                
                cam[c] = pipeline.createColorCamera()
                cam[c].isp.link(xout[c].input)
                cam[c].setBoardSocket(cam_socket_opts[c])
                control.out.link(cam[c].inputControl)
                print(f'Camera {cam_socket_opts[c]} connected')
            
            # Pipeline is defined, now we can connect to the device
            device = dai.Device.getDeviceByMxId('')
            dai_device_args = [pipeline]
            if device[0]:
                dai_device_args.append(device[1])
            
            with dai.Device(*dai_device_args) as device:
                q = {}
                for c in streams:
                    q[c] = device.getOutputQueue(name=c, maxSize=1, blocking=False)
            
                # Save frames
                print('Save one image from each camera')
                for c in streams:
                    time.sleep(2.2) # wait for camera set up
                    try:
                        pkt = q[c].tryGet()
                        frame = pkt.getCvFrame()
                        cv2.imwrite(f'{target_path}/{c}.jpg', frame)
                    except Exception as e:
                        print(e)
            4 months later