We use libraries that only works with 64 bits system, so we thought about using the original image provided for Raspberry Pi OS (64 bits) (bullseye) and flash it on the RPi CM4 integrated in the camera. We then followed the instructions to install all the required dependencies (link).

However, we are still not able to connect to the camera as we get the following output from the test process (link).

(venv) vue@raspberrypi:~/depthai-python $ python3 examples/ColorCamera/rgb_preview.py
Traceback (most recent call last):
File "/home/vue/depthai-python/examples/ColorCamera/rgb_preview.py", line 24, in <module>
with dai.Device(pipeline) as device:
RuntimeError: No available devices

The RPi cannot even see the USB device: https://docs.luxonis.com/en/latest/pages/troubleshooting/#depthai-can-t-connect-to-an-oak-camera

(venv) vue@raspberrypi:~/depthai-python $ lsusb | grep 03e7
(venv) vue@raspberrypi:~/depthai-python $

We also try using the device manager https://docs.luxonis.com/projects/api/en/latest/components/bootloader/#device-manager to see what was configured, but the device was empty.

Are we missing something in our installation to connect to the camera from the integrated RPi CM4 module? Or is the problem somewhere else?

We tried to activate the USB ports, as they are by default not activated on the RPi CM4. For this, we added the following lines to the file /boot/config.txt:

`[cm4]

Enable host mode on the 2711 built-in XHCI USB controller.

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

dtoverlay=dwc2,dr_mode=host`

After rebooting the camera with sudo shutdown -r now we could see some USB buses but still no camera:

(venv) vue@raspberrypi:~/depthai-python $ dmesg | grep usb
[ 0.139750] usbcore: registered new interface driver usbfs
[ 0.139809] usbcore: registered new interface driver hub
[ 0.139876] usbcore: registered new device driver usb
[ 0.140266] usb_phy_generic phy: supply vcc not found, using dummy regulator
[ 0.140499] usb_phy_generic phy: dummy supplies not allowed for exclusive requests
[ 6.374157] pci 0000:01:00.0: quirk_usb_early_handoff+0x0/0x900 took 4882950 usecs
[ 6.480150] usbcore: registered new interface driver r8152
[ 6.480226] usbcore: registered new interface driver lan78xx
[ 6.480286] usbcore: registered new interface driver smsc95xx
[ 16.482526] usbcore: registered new interface driver uas
[ 16.482594] usbcore: registered new interface driver usb-storage
[ 16.493869] usbcore: registered new interface driver usbhid
[ 16.493884] usbhid: USB HID core driver
[ 19.777323] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
[ 19.787739] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
[ 19.846664] dwc2 fe980000.usb: DWC OTG Controller
[ 19.846731] dwc2 fe980000.usb: new USB bus registered, assigned bus number 1
[ 19.846917] dwc2 fe980000.usb: irq 37, io mem 0xfe980000
[ 19.847300] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
[ 19.847322] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 19.847338] usb usb1: Product: DWC OTG Controller
[ 19.847352] usb usb1: Manufacturer: Linux 6.1.21-v8+ dwc2_hsotg
[ 19.847366] usb usb1: SerialNumber: fe980000.usb

We also try to add otg_mode=1 to /boot/config.txt:

`[cm4]

Enable host mode on the 2711 built-in XHCI USB controller.

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

dtoverlay=dwc2,dr_mode=host,otg_mode=1`

But after rebooting with the same method, the camera was still not detected.

    Hi LucasVandroux
    It might still be missing some packages/drivers, have you sudo apt update and apt upgrade?.

    Another thing I found on some thread

    FWIW, I had the same issue with USB2.0 on the CM4 using core-image-minimal and solved it by just adding the kernel-module-dwc2 and kernel-module-roles packages.

    Thanks,
    Jaka

      jakaskerl Yes we did sudo apt update and apt upgrade, I will try the two packages you proposed. Thank you.

      Hello jakaskerl,

      Could you please link back to the thread where you found the potential fix using the kernel modules?

      On our side, it seems that both those modules are actually already installed:

      kernel-module-dwc2

      vue@raspberrypi:~ $ sudo modinfo dwc2
      filename:    /lib/modules/6.1.21-v8+/kernel/drivers/usb/dwc2/dwc2.ko.xz
      license:    Dual BSD/GPL
      author:     Synopsys, Inc.
      description:  DESIGNWARE HS OTG Core
      srcversion:   448B02D5DC866D41D8D6B6D
      alias:     of:N*T*Cintel,socfpga-agilex-hsotgC*
      alias:     of:N*T*Cintel,socfpga-agilex-hsotg
      alias:     of:N*T*Cst,stm32mp15-hsotgC*
      alias:     of:N*T*Cst,stm32mp15-hsotg
      alias:     of:N*T*Cst,stm32mp15-fsotgC*
      alias:     of:N*T*Cst,stm32mp15-fsotg
      alias:     of:N*T*Cst,stm32f7-hsotgC*
      alias:     of:N*T*Cst,stm32f7-hsotg
      alias:     of:N*T*Cst,stm32f4x9-hsotgC*
      alias:     of:N*T*Cst,stm32f4x9-hsotg
      alias:     of:N*T*Cst,stm32f4x9-fsotgC*
      alias:     of:N*T*Cst,stm32f4x9-fsotg
      alias:     of:N*T*Capm,apm82181-dwc-otgC*
      alias:     of:N*T*Capm,apm82181-dwc-otg
      alias:     of:N*T*Camcc,dwc-otgC*
      alias:     of:N*T*Camcc,dwc-otg
      alias:     of:N*T*Camlogic,meson-g12a-usbC*
      alias:     of:N*T*Camlogic,meson-g12a-usb
      alias:     of:N*T*Camlogic,meson-gxbb-usbC*
      alias:     of:N*T*Camlogic,meson-gxbb-usb
      alias:     of:N*T*Camlogic,meson8b-usbC*
      alias:     of:N*T*Camlogic,meson8b-usb
      alias:     of:N*T*Camlogic,meson8-usbC*
      alias:     of:N*T*Camlogic,meson8-usb
      alias:     of:N*T*Csamsung,s3c6400-hsotgC*
      alias:     of:N*T*Csamsung,s3c6400-hsotg
      alias:     of:N*T*Csnps,dwc2C*
      alias:     of:N*T*Csnps,dwc2
      alias:     of:N*T*Clantiq,xrx200-usbC*
      alias:     of:N*T*Clantiq,xrx200-usb
      alias:     of:N*T*Clantiq,arx100-usbC*
      alias:     of:N*T*Clantiq,arx100-usb
      alias:     of:N*T*Crockchip,rk3066-usbC*
      alias:     of:N*T*Crockchip,rk3066-usb
      alias:     of:N*T*Cingenic,x2000-otgC*
      alias:     of:N*T*Cingenic,x2000-otg
      alias:     of:N*T*Cingenic,x1830-otgC*
      alias:     of:N*T*Cingenic,x1830-otg
      alias:     of:N*T*Cingenic,x1700-otgC*
      alias:     of:N*T*Cingenic,x1700-otg
      alias:     of:N*T*Cingenic,x1600-otgC*
      alias:     of:N*T*Cingenic,x1600-otg
      alias:     of:N*T*Cingenic,x1000-otgC*
      alias:     of:N*T*Cingenic,x1000-otg
      alias:     of:N*T*Cingenic,jz4780-otgC*
      alias:     of:N*T*Cingenic,jz4780-otg
      alias:     of:N*T*Cingenic,jz4775-otgC*
      alias:     of:N*T*Cingenic,jz4775-otg
      alias:     of:N*T*Chisilicon,hi6220-usbC*
      alias:     of:N*T*Chisilicon,hi6220-usb
      alias:     of:N*T*Cbrcm,bcm2835-usbC*
      alias:     of:N*T*Cbrcm,bcm2835-usb
      alias:     acpi*:BCM2848:*
      depends:    roles
      intree:     Y
      name:      dwc2
      vermagic:    6.1.21-v8+ SMP preempt mod_unload modversions aarch64

      kernel-module-roles

      vue@raspberrypi:~ $ sudo modinfo roles
      filename:       /lib/modules/6.1.21-v8+/kernel/drivers/usb/roles/roles.ko.xz
      description:    USB Role Class
      license:        GPL v2
      author:         Hans de Goede <hdegoede@redhat.com>
      author:         Heikki Krogerus <heikki.krogerus@linux.intel.com>
      srcversion:     7F2E2B287CC190D2D26A478
      depends:        
      intree:         Y
      name:           roles
      vermagic:       6.1.21-v8+ SMP preempt mod_unload modversions aarch64

      Also, to clean up the very weirdly formatted information from my previous message, our current /boot/config.txt file is as follows:

      # For more options and information see
      # http://rpf.io/configtxt
      # Some settings may impact device functionality. See link above for details
      
      # uncomment if you get no picture on HDMI for a default "safe" mode
      #hdmi_safe=1
      
      # uncomment the following to adjust overscan. Use positive numbers if console
      # goes off screen, and negative if there is too much border
      #overscan_left=16
      #overscan_right=16
      #overscan_top=16
      #overscan_bottom=16
      
      # uncomment to force a console size. By default it will be display's size minus
      # overscan.
      #framebuffer_width=1280
      #framebuffer_height=720
      
      # uncomment if hdmi display is not detected and composite is being output
      #hdmi_force_hotplug=1
      
      # uncomment to force a specific HDMI mode (this will force VGA)
      #hdmi_group=1
      #hdmi_mode=1
      
      # uncomment to force a HDMI mode rather than DVI. This can make audio work in
      # DMT (computer monitor) modes
      #hdmi_drive=2
      
      # uncomment to increase signal to HDMI, if you have interference, blanking, or
      # no display
      #config_hdmi_boost=4
      
      # uncomment for composite PAL
      #sdtv_mode=2
      
      #uncomment to overclock the arm. 700 MHz is the default.
      #arm_freq=800
      
      # Uncomment some or all of these to enable the optional hardware interfaces
      #dtparam=i2c_arm=on
      #dtparam=i2s=on
      #dtparam=spi=on
      
      # Uncomment this to enable infrared communication.
      #dtoverlay=gpio-ir,gpio_pin=17
      #dtoverlay=gpio-ir-tx,gpio_pin=18
      
      # Additional overlays and parameters are documented /boot/overlays/README
      
      # Enable audio (loads snd_bcm2835)
      dtparam=audio=on
      
      # Automatically load overlays for detected cameras
      camera_auto_detect=1
      
      # Automatically load overlays for detected DSI displays
      display_auto_detect=1
      
      # Enable DRM VC4 V3D driver
      dtoverlay=vc4-kms-v3d
      max_framebuffers=2
      
      # Run in 64-bit mode
      arm_64bit=1
      
      # Disable compensation for displays with overscan
      disable_overscan=1
      
      [cm4]
      # Enable host mode on the 2711 built-in XHCI USB controller.
      # This line should be removed if the legacy DWC2 controller is required
      # (e.g. for USB device mode) or if USB support is not required.
      dtoverlay=dwc2,dr_mode=host
      
      [all]
      
      [pi4]
      # Run as fast as firmware / board allows
      arm_boost=1
      
      [all]

      The command lsusb gives us the following output:

      vue@raspberrypi:~/depthai $ lsusb
      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

      The command dmesg | grep usb gives us the following output:

      vue@raspberrypi:~/depthai $ dmesg | grep usb
      [    0.139891] usbcore: registered new interface driver usbfs
      [    0.139951] usbcore: registered new interface driver hub
      [    0.140020] usbcore: registered new device driver usb
      [    0.140407] usb_phy_generic phy: supply vcc not found, using dummy regulator
      [    0.140646] usb_phy_generic phy: dummy supplies not allowed for exclusive requests
      [    6.398317] pci 0000:01:00.0: quirk_usb_early_handoff+0x0/0x900 took 4882946 usecs
      [    6.500307] usbcore: registered new interface driver r8152
      [    6.500395] usbcore: registered new interface driver lan78xx
      [    6.500455] usbcore: registered new interface driver smsc95xx
      [   16.502715] usbcore: registered new interface driver uas
      [   16.502781] usbcore: registered new interface driver usb-storage
      [   16.516953] usbcore: registered new interface driver usbhid
      [   16.516967] usbhid: USB HID core driver
      [   19.832670] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
      [   19.843883] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
      [   19.918822] dwc2 fe980000.usb: DWC OTG Controller
      [   19.918899] dwc2 fe980000.usb: new USB bus registered, assigned bus number 1
      [   19.923445] dwc2 fe980000.usb: irq 37, io mem 0xfe980000
      [   19.923902] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
      [   19.923936] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
      [   19.923953] usb usb1: Product: DWC OTG Controller
      [   19.923967] usb usb1: Manufacturer: Linux 6.1.21-v8+ dwc2_hsotg
      [   19.923980] usb usb1: SerialNumber: fe980000.usb

      And when testing the connection with the camera using ~/depthai/depthai_demo.py, we are getting the following error:

      vue@raspberrypi:~/depthai $ source venv/bin/activate
      (venv) vue@raspberrypi:~/depthai $ python3 depthai_demo.py
      Using depthai module from:  /home/vue/depthai/venv/lib/python3.10/site-packages/depthai.cpython-310-aarch64-linux-gnu.so
      Depthai version installed:  2.21.2.0
      Setting up demo...
      Traceback (most recent call last):
        File "/home/vue/depthai/depthai_demo.py", line 1053, in <module>
          runOpenCv()
        File "/home/vue/depthai/depthai_demo.py", line 1043, in runOpenCv
          demo.run_all(confManager)
        File "/home/vue/depthai/depthai_demo.py", line 132, in run_all
          self.setup(conf)
        File "/home/vue/depthai/depthai_demo.py", line 180, in setup
          self._deviceInfo = getDeviceInfo(self._conf.args.deviceId, args.debug)
        File "/home/vue/depthai/venv/lib/python3.10/site-packages/depthai_sdk/utils.py", line 226, in getDeviceInfo
          raise RuntimeError("No DepthAI device found!")
      RuntimeError: No DepthAI device found!
      Exception ignored in atexit callback: <bound method Demo.stop of <__main__.Demo object at 0x7fa27ac940>>
      Traceback (most recent call last):
        File "/home/vue/depthai/depthai_demo.py", line 334, in stop
          self._pm.closeDefaultQueues()
      AttributeError: 'Demo' object has no attribute '_pm'

      And it is the same, even forcing the use of the USB-2:

      (venv) vue@raspberrypi:~/depthai $ python3 depthai_demo.py -usbs usb2
      Using depthai module from:  /home/vue/depthai/venv/lib/python3.10/site-packages/depthai.cpython-310-aarch64-linux-gnu.so
      Depthai version installed:  2.21.2.0
      Setting up demo...
      Traceback (most recent call last):
        File "/home/vue/depthai/depthai_demo.py", line 1053, in <module>
          runOpenCv()
        File "/home/vue/depthai/depthai_demo.py", line 1043, in runOpenCv
          demo.run_all(confManager)
        File "/home/vue/depthai/depthai_demo.py", line 132, in run_all
          self.setup(conf)
        File "/home/vue/depthai/depthai_demo.py", line 180, in setup
          self._deviceInfo = getDeviceInfo(self._conf.args.deviceId, args.debug)
        File "/home/vue/depthai/venv/lib/python3.10/site-packages/depthai_sdk/utils.py", line 226, in getDeviceInfo
          raise RuntimeError("No DepthAI device found!")
      RuntimeError: No DepthAI device found!
      Exception ignored in atexit callback: <bound method Demo.stop of <__main__.Demo object at 0x7f8f83c940>>
      Traceback (most recent call last):
        File "/home/vue/depthai/depthai_demo.py", line 334, in stop
          self._pm.closeDefaultQueues()
      AttributeError: 'Demo' object has no attribute '_pm'

      I tried to reproduce the steps from the documentation created by @erik on Google Docs to support USB3 (link):

      1. Clone rpi-eeprom to ~/Documents/rpi-eeprom, and checkout to 45935788fddd94fb2c17105855500d345d751187.
      2. Collected FW013705.bin from another already installed OAK-D CM4 PoE camera with the 32 bits version of Raspberry Pi OS provided by Luxonis.
      3. Created the waveshare directory in ~/Documents/rpi-eeprom/firmware/.
      4. Uploaded FW013705.bin to ~/Documents/rpi-eeprom/firmware/waveshare/.
      5. Ran sudo ~/Documents/rpi-eeprom/firmware/vl805 -w ~/Documents/rpi-eeprom/firmware/waveshare/FW013705.bin.

      Unfortunately, at the last step, I got the following error:

      vue@raspberrypi:~ $ sudo ~/Documents/rpi-eeprom/firmware/vl805 -w ~/Documents/rpi-eeprom/firmware/waveshare/FW013705.bin
      * no VL805 found

      Hello erik,

      Thank you for your answer. The vl805 is available at its supposed location and with its supposed size:

      vue@raspberrypi:~/Documents/rpi-eeprom/firmware $ ls -lah
      total 408K
      drwxr-xr-x 7 vue vue 4.0K Oct 10 20:45 .
      drwxr-xr-x 6 vue vue 4.0K Oct 10 20:44 ..
      drwxr-xr-x 2 vue vue 4.0K Oct 10 20:44 beta
      drwxr-xr-x 2 vue vue 4.0K Oct 10 20:44 critical
      drwxr-xr-x 5 vue vue 4.0K Oct 10 20:44 old
      -rw-r--r-- 1 vue vue  11K Oct 10 20:44 release-notes.md
      drwxr-xr-x 2 vue vue 4.0K Oct 10 20:44 stable
      -rwxr-xr-x 1 vue vue 366K Oct 10 20:44 vl805
      drwxr-xr-x 2 vue vue 4.0K Oct 10 20:46 waveshare
        13 days later