@jakaskerl I tried the following:

1.

python3 -c "import depthai; print(depthai.Device.getAllAvailableDevices())"

[]

2.

ping -c 4 169.254.1.222

PING 169.254.1.222 (169.254.1.222) 56(84) bytes of data.

64 bytes from 169.254.1.222: icmp_seq=1 ttl=64 time=0.191 ms

64 bytes from 169.254.1.222: icmp_seq=2 ttl=64 time=0.187 ms

64 bytes from 169.254.1.222: icmp_seq=3 ttl=64 time=0.251 ms

64 bytes from 169.254.1.222: icmp_seq=4 ttl=64 time=0.200 ms

--- 169.254.1.222 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3064ms

rtt min/avg/max/mdev = 0.187/0.207/0.251/0.025 ms

3.

ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

   valid_lft forever preferred_lft forever

inet6 ::1/128 scope host noprefixroute 

   valid_lft forever preferred_lft forever

2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

link/ether 2c:cf:67:28:a3:97 brd ff:ff:ff:ff:ff:ff

3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

link/ether 2c:cf:67:28:a3:98 brd ff:ff:ff:ff:ff:ff

inet 192.168.1.14/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0

   valid_lft 83359sec preferred_lft 83359sec

inet6 fe80::b789:c0a5:e83a:b43f/64 scope link noprefixroute 

   valid_lft forever preferred_lft forever

4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

link/ether 00:e0:94:0a:0c:02 brd ff:ff:ff:ff:ff:ff

inet 169.254.1.10/24 scope global eth1

   valid_lft forever preferred_lft forever

4.

python3 depthai_demo.py -dev 169.254.1.222

Using depthai module from: /home/sarvesh/Desktop/depthai_venv/lib/python3.11/site-packages/depthai.cpython-311-aarch64-linux-gnu.so

Depthai version installed: 2.24.0.0

Logging and crash reporting disabled! No module named 'sentry_sdk'

Logging and crash reporting disabled! No module named 'sentry_sdk'

Setting up demo...

Traceback (most recent call last):

File "/home/sarvesh/Desktop/depthai/depthai_demo.py", line 1054, in <module>

runOpenCv()

File "/home/sarvesh/Desktop/depthai/depthai_demo.py", line 1044, in runOpenCv

demo.run_all(confManager)

File "/home/sarvesh/Desktop/depthai/depthai_demo.py", line 132, in run_all

self.setup(conf)

File "/home/sarvesh/Desktop/depthai/depthai_demo.py", line 180, in setup

self._deviceInfo = getDeviceInfo(self._conf.args.deviceId, args.debug)

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/sarvesh/Desktop/depthai_venv/lib/python3.11/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 0x7ffeb5ded210>>

Traceback (most recent call last):

File "/home/sarvesh/Desktop/depthai/depthai_demo.py", line 335, in stop

self._pm.closeDefaultQueues()

^^^^^^^^

AttributeError: 'Demo' object has no attribute '_pm'

5)

sudo nmap -sn 169.254.1.0/24

Starting Nmap 7.93 ( https://nmap.org ) at 2025-02-09 22:17 IST

Nmap scan report for 169.254.1.222

Host is up (0.00077s latency).

MAC Address: 44:A9:2C:33:BD:BD (Ieee Registration Authority)

Nmap scan report for 169.254.1.10

Host is up.

Nmap done: 256 IP addresses (2 hosts up) scanned in 10.03 seconds

    Sarvesh
    One thing I'd recommend is using depthai-viewer instead of depthai-demo which is deprecated.
    Also try manually specifying the IP in depthai.DeviceInfo().

    Thanks,
    Jaka

    Sarvesh
    Whatever script you use to run the pipeline.

    eg:

    #!/usr/bin/env python3
    
    import cv2
    import depthai as dai
    
    # Create pipeline
    pipeline = dai.Pipeline()
    
    # Define source and output
    camRgb = pipeline.create(dai.node.ColorCamera)
    xoutVideo = pipeline.create(dai.node.XLinkOut)
    
    xoutVideo.setStreamName("video")
    
    # Properties
    camRgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)
    camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
    camRgb.setVideoSize(1920, 1080)
    
    xoutVideo.input.setBlocking(False)
    xoutVideo.input.setQueueSize(1)
    
    # Linking
    camRgb.video.link(xoutVideo.input)
    
    device_info = dai.DeviceInfo("10.12.118.101") # set you device's IP
    # Connect to device and start pipeline
    with dai.Device(pipeline, deviceInfo=device_info) as device:
    
        video = device.getOutputQueue(name="video", maxSize=1, blocking=False)
    
        while True:
            videoIn = video.get()
    
            # Get BGR frame from NV12 encoded video frame to show with opencv
            # Visualizing the frame on slower hosts might have overhead
            cv2.imshow("video", videoIn.getCvFrame())
    
            if cv2.waitKey(1) == ord('q'):
                break

    Thanks,
    Jaka

    • Edited

    @jakaskerl Right now, i am running

    python3 -m depthai_viewer

    So should i edit the init.py or main script?

    BTW, when i create a new file, copy the above code and run it separately, i get the following output:

    python manual_ip_program.py

    Traceback (most recent call last):

    File "/home/sarvesh/Desktop/depthai/manual_ip_program.py", line 28, in <module>

    with dai.Device(pipeline, deviceInfo=device_info) as device:
    
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    TypeError: init(): incompatible constructor arguments. The following argument types are supported:

    1\. depthai.Device(pipeline: depthai.Pipeline)
    
    2\. depthai.Device(pipeline: depthai.Pipeline, usb2Mode: bool)
    
    3\. depthai.Device(pipeline: depthai.Pipeline, maxUsbSpeed: depthai.UsbSpeed)
    
    4\. depthai.Device(pipeline: depthai.Pipeline, pathToCmd: Path)
    
    5\. depthai.Device(pipeline: depthai.Pipeline, devInfo: depthai.DeviceInfo, usb2Mode: bool = False)
    
    6\. depthai.Device(pipeline: depthai.Pipeline, deviceInfo: depthai.DeviceInfo, maxUsbSpeed: depthai.UsbSpeed)
    
    7\. depthai.Device(pipeline: depthai.Pipeline, devInfo: depthai.DeviceInfo, pathToCmd: Path)
    
    8\. depthai.Device(version: depthai.OpenVINO.Version = <Version.???: 7>)
    
    9\. depthai.Device(version: depthai.OpenVINO.Version, usb2Mode: bool = False)
    
    10\. depthai.Device(version: depthai.OpenVINO.Version, maxUsbSpeed: depthai.UsbSpeed)
    
    11\. depthai.Device(version: depthai.OpenVINO.Version, pathToCmd: Path)
    
    12\. depthai.Device(version: depthai.OpenVINO.Version, deviceInfo: depthai.DeviceInfo, usb2Mode: bool = False)
    
    13\. depthai.Device(version: depthai.OpenVINO.Version, deviceInfo: depthai.DeviceInfo, maxUsbSpeed: depthai.UsbSpeed)
    
    14\. depthai.Device(version: depthai.OpenVINO.Version, deviceDesc: depthai.DeviceInfo, pathToCmd: Path)
    
    15\. depthai.Device(config: depthai.Device.Config)
    
    16\. depthai.Device(config: depthai.Device.Config, deviceInfo: depthai.DeviceInfo)
    
    17\. depthai.Device(deviceInfo: depthai.DeviceInfo)
    
    18\. depthai.Device(deviceInfo: depthai.DeviceInfo, maxUsbSpeed: depthai.UsbSpeed)
    
    19\. depthai.Device(nameOrDeviceId: str)
    
    20\. depthai.Device(nameOrDeviceId: str, maxUsbSpeed: depthai.UsbSpeed)

    Invoked with: <depthai.Pipeline object at 0x7fff27bd3530>; kwargs: deviceInfo=DeviceInfo(name=169.254.1.222, mxid=, X_LINK_ANY_STATE, X_LINK_ANY_PROTOCOL, X_LINK_ANY_PLATFORM, X_LINK_SUCCESS)

      Sarvesh
      Not in viewer program. Try the script I have sent. You seem to have multiple network interfaces which interfere with eachother. Manually specifying IP as in the script i sent above should solve the issues.

      Thanks,
      Jaka

      @jakaskerl

      #!/usr/bin/env python3

      import cv2

      import depthai as dai

      # Create pipeline

      pipeline = dai.Pipeline()

      # Define source and output

      camRgb = pipeline.create(dai.node.ColorCamera)

      xoutVideo = pipeline.create(dai.node.XLinkOut)

      xoutVideo.setStreamName("video")

      # Properties

      camRgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)

      camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)

      camRgb.setVideoSize(1920, 1080)

      xoutVideo.input.setBlocking(False)

      xoutVideo.input.setQueueSize(1)

      # Linking

      camRgb.video.link(xoutVideo.input)

      device_info = dai.DeviceInfo("169.254.1.222") # set you device's IP

      # Connect to device and start pipeline

      with dai.Device(pipeline, deviceInfo=device_info) as device:

      video = device.getOutputQueue(name="video", maxSize=1, blocking=False)
      
      while True:
      
          videoIn = video.get()
      
          # Get BGR frame from NV12 encoded video frame to show with opencv
      
          # Visualizing the frame on slower hosts might have overhead
      
          cv2.imshow("video", videoIn.getCvFrame())
      
          if cv2.waitKey(1) == ord('q'):
      
              break

      The above is the script that i copied from your above suggestion and changed the ip to 169.254.1.222. But i get the above error. what do you think i did wrong?

        Sarvesh
        You seem to be using an older depthai version. The constructor args for pipeline and deviceInfo were added in 2.26 I think. Please update to 2.29.0

        Thanks,
        Jaka

        @jakaskerl
        after i upgraded the depthai version and ran the script , I am getting the following error

        [2025-02-15 22:57:08.995] [depthai] [warning] [1844301091159D0F00] [169.254.1.222] Flashed bootloader version 0.0.22, less than 0.0.28 is susceptible to bootup/restart failure. Upgrading is advised, flashing main/factory (not user) bootloader. Available: 0.0.28

        Traceback (most recent call last):

        File "/home/sarvesh/Desktop/depthai/manual_ip_program.py", line 28, in <module>

        with dai.Device(pipeline, deviceInfo=device_info) as device:
        
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND

        Update:

        I also updated the bootloader version. But still showing same error:

        RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND

          Sarvesh
          Ok, now it does sound like a power issue. Please check you have enough power delivery through the POE switch.

          Thanks,
          Jaka

          How do I check if it's receiving power? Is their a script to read the current and voltage recieved?

            Sarvesh
            Unfortunately no. What are you using to power on the device? Make sure it supports POE 802.3af.

            Thanks,
            Jaka

            The green cable is going to the raspberrypi

            What is the difference between 802.3at vs 802.3af?

            @jakaskerl
            Command:

            DEPTHAI_LEVEL=debug python3 -c "import depthai as dai; dai.Device()"

            Output:

            [2025-02-19 14:17:48.545] [depthai] [debug] Python bindings - version: 2.29.0.0 from build: 2024-11-24 11:10:53 +0000

            [2025-02-19 14:17:48.545] [depthai] [debug] Library information - version: 2.29.0, commit: from , build: 2024-11-24 09:23:54 +0000, libusb enabled: true

            [2025-02-19 14:17:48.552] [depthai] [debug] Initialize - finished

            [2025-02-19 14:17:48.705] [depthai] [debug] Resources - Archive 'depthai-bootloader-fwp-0.0.28.tar.xz' open: 3ms, archive read: 152ms

            [2025-02-19 14:17:49.214] [depthai] [debug] Resources - Archive 'depthai-device-fwp-4d360b5c56225f23e9a3d3a3999ce46c90cfdeaf.tar.xz' open: 7ms, archive read: 660ms

            Traceback (most recent call last):

            File "<string>", line 1, in <module>

            RuntimeError: No available devices

            @jakaskerl

            dmesg | grep -i usb

            [ 0.031212] usbcore: registered new interface driver usbfs

            [ 0.031220] usbcore: registered new interface driver hub

            [ 0.031230] usbcore: registered new device driver usb

            [ 0.463165] usbcore: registered new device driver r8152-cfgselector

            [ 0.463173] usbcore: registered new interface driver r8152

            [ 0.463186] usbcore: registered new interface driver lan78xx

            [ 0.463193] usbcore: registered new interface driver smsc95xx

            [ 0.463411] usbcore: registered new interface driver uas

            [ 0.463418] usbcore: registered new interface driver usb-storage

            [ 0.476347] usbcore: registered new interface driver usbhid

            [ 0.476348] usbhid: USB HID core driver

            [ 0.633312] xhci-hcd xhci-hcd.0: new USB bus registered, assigned bus number 1

            [ 0.633841] xhci-hcd xhci-hcd.0: new USB bus registered, assigned bus number 2

            [ 0.633844] xhci-hcd xhci-hcd.0: Host supports USB 3.0 SuperSpeed

            [ 0.633896] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06

            [ 0.633900] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

            [ 0.633903] usb usb1: Product: xHCI Host Controller

            [ 0.633905] usb usb1: Manufacturer: Linux 6.6.51+rpt-rpi-2712 xhci-hcd

            [ 0.633908] usb usb1: SerialNumber: xhci-hcd.0

            [ 0.634030] hub 1-0:1.0: USB hub found

            [ 0.634179] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06

            [ 0.634182] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1

            [ 0.634184] usb usb2: Product: xHCI Host Controller

            [ 0.634187] usb usb2: Manufacturer: Linux 6.6.51+rpt-rpi-2712 xhci-hcd

            [ 0.634189] usb usb2: SerialNumber: xhci-hcd.0

            [ 0.634278] hub 2-0:1.0: USB hub found

            [ 0.634576] xhci-hcd xhci-hcd.1: new USB bus registered, assigned bus number 3

            [ 0.635101] xhci-hcd xhci-hcd.1: new USB bus registered, assigned bus number 4

            [ 0.635104] xhci-hcd xhci-hcd.1: Host supports USB 3.0 SuperSpeed

            [ 0.635145] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06

            [ 0.635148] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1

            [ 0.635151] usb usb3: Product: xHCI Host Controller

            [ 0.635153] usb usb3: Manufacturer: Linux 6.6.51+rpt-rpi-2712 xhci-hcd

            [ 0.635156] usb usb3: SerialNumber: xhci-hcd.1

            [ 0.635249] hub 3-0:1.0: USB hub found

            [ 0.635389] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06

            [ 0.635392] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1

            [ 0.635394] usb usb4: Product: xHCI Host Controller

            [ 0.635397] usb usb4: Manufacturer: Linux 6.6.51+rpt-rpi-2712 xhci-hcd

            [ 0.635399] usb usb4: SerialNumber: xhci-hcd.1

            [ 0.635491] hub 4-0:1.0: USB hub found

            [ 0.887832] usb 1-1: new high-speed USB device number 2 using xhci-hcd

            [ 1.044274] usb 1-1: New USB device found, idVendor=0fe6, idProduct=9900, bcdDevice=20.00

            [ 1.044281] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

            [ 1.044285] usb 1-1: Product: USB 10/100 LAN

            [ 1.044287] usb 1-1: Manufacturer: CoreChips

            [ 1.044290] usb 1-1: SerialNumber: 00E0940A0C02

            [ 1.069911] cdc_ether 1-1:2.0 eth1: register 'cdc_ether' at usb-xhci-hcd.0-1, CDC Ethernet Device, 00:e0:94:0a:0c:02

            [ 1.069946] usbcore: registered new interface driver cdc_ether

            [ 3.074015] usbcore: registered new interface driver brcmfmac

              Sarvesh
              I found that a bunch of injector suffer from this issue.. I'll check if I can repro this and debug.
              Do you have a switch to check?

              Thanks,
              Jaka

              What do you mean by you'll repro ?

              What is a switch? What do you mean?

              Could you also share what is happening in the above error?

                Sarvesh
                I will try to reproduce the issue with a similar injector to see if there is some intrinsic issue regarding how injectors work with POE devices.
                Switch -- network switch (that supports POE)

                Sarvesh Could you also share what is happening in the above error?

                Either not enough power is delivered or the TCP communication doesn't go through.

                Thanks,
                Jaka

                Sarvesh
                From what I gathered ... Ubuntu does find your device on 169.254.1.222 and sets its own IP appropriately to the same range. Issue is that this takes a few moments.
                When running a script the OAK device first shuts down and boots into a different state. When using an injector this means the connection to your PC drops and interface link is closed. Device then boots back up to same 1.222 ip, but the PC is not there anymore and takes about 10s to re-instantiate the interface link.
                In that time the connection times out - resulting in "Failed to find device after booting".

                How to fix - Try to manually set the IP for you ETH interface to the 169.254.x.x range on your RPI. This way the interface is back up much faster and the connection is reestablished in time.

                Switches don't suffer from the same issue since they keep the link alive even if the device is disconnected. Hence the difference.

                LMK if that helps.

                Thanks,
                Jaka