- Edited
Should i connect oak d to the ethernet port or usb port of raspberrypi?
when i connect through ethernet, raspberrypi stops responding
Should i connect oak d to the ethernet port or usb port of raspberrypi?
when i connect through ethernet, raspberrypi stops responding
Is it fine if i connect it through ethernet to usb converter. What are the configuration procedure i should look at?
@jakaskerl Yes an eth dongle. How do i confirm if the raspberrypi is actually able to communicate with the camera and just not detecting the usb connection?
@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
@jakaskerl in which script should i specify the IP?
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
@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)
#!/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?
@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
How do I check if it's receiving power? Is their a script to read the current and voltage recieved?
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