I am using an Oak-D-PoE, works fine from Jetson TX2. For example, I can use the example python app: ./bootloader_version.py and it returns the IP and version as expected:
Found device with name: xxx.xxx.xxx.xxx
Version: 0.0.15
However, on from WSL2 I have Ubuntu (same version, ufw status inactive) installed, I can ping the camera, but can't find the camera from the same code:
./bootloader_version.py
No devices found
Any thoughts on how to get this to work? I have also tried using the static ip option, this also can't find the device (i have replaced xxx.xxx.xxx.xx with my devices PoE ip address.:
import cv2
import depthai as dai

pipeline = dai.Pipeline()

camRgb = pipeline.createColorCamera()

xoutRgb = pipeline.createXLinkOut()
xoutRgb.setStreamName("rgb")
camRgb.preview.link(xoutRgb.input)

device_info = dai.DeviceInfo()
device_info.state = dai.XLinkDeviceState.X_LINK_BOOTLOADER
device_info.desc.protocol = dai.XLinkProtocol.X_LINK_TCP_IP
device_info.desc.name = "xxx.xxx.xxx.xxx" #put in my devices poe address

with dai.Device(pipeline, device_info) as device:
qRgb = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
while True:
cv2.imshow("rgb", qRgb.get().getCvFrame())
if cv2.waitKey(1) == ord('q'):
break
It returns:
Traceback (most recent call last):
File "test.py", line 17, in <module>
with dai.Device(pipeline, device_info) as device:
RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND

  • erik replied to this.

    Hello TonyEnglish ,
    I am not very familiar with WSL, but I have heard from a number of people that they didn't got it to work and that running depthai on WSL (on the low level) is far from running it on the host natively. It was especially problematic with USB passthrough for USB OAK cameras, not sure about OAK POEs though.
    If this isn't strictly necessary, I would just suggest running natively instead of WSL.
    ThHanks, Erik

    19 days later

    Eric, when the static is used for the PoE camera (so detection is not necessary, see above for code), what ports and protocols are used from the computer to the PoE camera and what ports and protocols are needed from the camera to the computer. I have routing working (can ping the camera), but can't connect. Do you have a UML drawing or explanation of what is needed to connect.

    • erik replied to this.

      Hello TonyEnglish ,
      UDP Device discovery is handled on port 11491, and TCP XLink connection is handled on port 11490. We don't have UML as it would be quite a simple diagram.
      Thanks, Erik

        So, to be specific, using the code above, UDP 11491 would not be used (as we ID the IP of the PoE camera rather than do discovery). The only firewall/routing that would be required would source from the Linux machine running the code to the camera and the camera only responds to messages. Meaning this would work through stateful NAT. Like a computer hitting a web server on TCP 443.

        a year later

        erik

        When you say TCP XLink Communication is handled on port 11490:

        does the host pc open this port, or the camera, or both?

        • erik replied to this.

          hdnzngr The host - external device (camera) can't open ports.

            erik

            This looks like the external device (camera) listens on 11490, otherwise the host (PC) wouldnt be able to connect.

            If the device listens, then it opened the port for that.

            • erik replied to this.

              hdnzngr I don't think that's the case. depthai uses port 11490 to communicate with the camera. The camera doesn't connect to the PC, but vice-versa - camera is waiting for the depthai (host computer) to connect to it.

              How is this different from what I wrote?