• DepthAI
  • No depth ai devices found - wsl2 - ping works

Ping 169.254.19.105 works in wsl 2 but no DepthAI device found when I run demo app OAK D Pro W POE.

Getting started with OAK PoE devices — DepthAI Hardware Documentation 1.0.0 documentation (luxonis.com)

Ive tried setting manual ip but when I run it, it says 'Cannot find any device with given deviceInfo'

When I tried to run example file using:

python3 ColorCamera/rgb_preview.py

Output:

No Available devices found

My connection to the

The above image shows the orange wire connector to the docker which in turn is connected to my computer through a usb.

I was wondering how I can check if both are connected in the same LAN network?

Hi @SarveshRathi
Check your network card for the IP with ifconfig (mac/linux) or ipconfig (win). Make sure they are in the same subnet range.

Alternatively, you can pass the IP of the device in the script.

with dai.Device(pipeline, deviceInfo=dai.DeviceInfo("169.254.19.105"), maxUsbSpeed=dai.UsbSpeed.SUPER) as device:
Should work I think since it skips local broadcast call.

Thanks,
Jaka

    My local machine is windows and associated subnet mask is 255.255.0.0.

    Im using linux using wsl and associated subnet mask is eth0: 255.255.240.0 Note: Any way to identify if it is associated to eth0 or lo?

    If this is not correct, how to change the subnet mask and what value i should set it to?

    To your alternate solution, which script should I pass the ip to? If youre referring 'script to manually assigning ip', Ive already done that, but when I run it, it says 'Cannot find any device with given deviceInfo'

    Networking under WSL is solid but has a few quirks, I'd recommend confirming you can connect via Windows proper first of all, and only then troubleshoot from within WSL. As Jaka mentioned, run ipconfig in a Windows command line/Powershell/Terminal, the command works in all of them, which will tell you the IP address Windows is assigning to the wired ethernet adapter.

    If you then run ifconfig I'll bet you get a different set of IP addresses. By default WSL runs in NAT mode and you don't actually get full access to the network. This most commonly hits when you're trying to access services hosted within WSL from different computers, but I suspect something similar is going on here too.

    Other things to confirm, but I suspect you're running WSL2, what version of WSL are you using? wsl --version in Windows Terminal will give that. WSL1 worked differently and gave more open network access by default, WSL2 however has NAT mode as standard.

    Make sure you read through it and understand the caveats, but I suspect that enabling Mirrored Network Mode may help. It'll give your WSL instances access to the same network adapters that Windows has. It's not exactly user friendly to configure, but should just be a couple of commands. More info here:
    https://learn.microsoft.com/en-us/windows/wsl/networking

      kneave

      The IP on windows is 169.254.19.105 and subnet mask is 255.255.0.0

      When I call ipconfig, it also shares ethernet adapter vEthernet(WSL(Hyper-V Firewall)) : 172.26.208.1, subnet mask 255.255.240.0

      ip route show | grep -i default | awk '{ print $3}' - 172.26.208.1

      I am running WSL2.

      kneave Thanks for quick follow ups on my queries. Appreciate your time.

      I have made .wslconfig file like suggested and added mirrored setting.

      Note: .wslconfig.txt is what i made in the directory suggested. Is that fine?

      When I call sudo wget -qO- https://docs.luxonis.com/install_depthai.sh | bash and I open demo viewer , it still didnt find any depth ai devices.

      Note:

      1. Im still able to ping the sensor with the same ip in windows and linux(wsl2).
      2. I also reopened wsl and then run sudo wget -qO- https://docs.luxonis.com/install_depthai.sh | bash. But it still doesnt work

      Any suggestions?

      I just checked my laptop and it's .wslconfig without a file extension so it's worth being exact.

      If you see the same IP addresses and still can't connect though then I'll have to leave that to the experts at Luxonis. I've never used a POE device, I just jumped in as I have experience with WSL networking.

        Did you create wslconfig or .wslconfig as the . at the front makes a big difference. Please share the contents of the file and the new ip/if config outputs too, if you can confirm you've rebooted too please as WSL will need to restart I think.

          kneave

          Ive used .wslconfig

          the contents are:

          [wsl2]

          networkingMode=mirrored

          I did close the terminal and reopened wsl. That reboots wsl right?

          If you close the terminal it carries on running in the background, if you open a Windows terminal you should be able to shut it down using wsl --shutdown though, a reboot would definitely do it at worst. As I understand it, WSL is running on some kind of VM type thing in Hyper-V but I don't know the specifics.

            Hi @SarveshRathi
            How about the other side (the HyperV FW)? https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/hyper-v-firewall

            Make sure to also check the route tables if the traffic gets routed correctly. When not specifying the device IP when calling dai.Device() the library will send a broadcast which will not be received if there are issues with the subnet. When providing IP, this will be skipped and should work outside subnets iirc.

            Thanks,
            Jaka

              jakaskerl

              I think that worked. Now I am getting a new error message.

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

                @SarveshRathi

                SarveshRathi Failed to find device after booting

                This usually signifies a power issue, could you check you are getting enough power? I found I have this issue when using injector instead of POE switch.

                You might learn more by inspecting the network traffic to see if it gets routed correctly.

                Thanks,
                Jaka

                  Thanks jakaskerl

                  Ok. So the issue is resolved.

                  I had to add the ip in same subnet.

                  sudo ip addr add 192.168.50.X/24 dev eth0

                  where x can be any number

                  How do I inspect the network traffic? Since right now I can connect the camera through the injector, but as soon as I move it crashes.

                    Hi @SarveshRathi
                    Great!

                    SarveshRathi How do I inspect the network traffic?

                    I usually use wireshark to check the traffic.

                    SarveshRathi Since right now I can connect the camera through the injector, but as soon as I move it crashes.

                    What do you mean by as soon as I move it? Have you tried using a switch instead?

                    Thanks,
                    Jaka