I'm working with an OAK-D-IOT-75 camera and a Raspberry Pi 3B and when I try to run a very simple code I get an error: qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 185, resource id: 0, major code: 140 (Unknown), minor code: 20
Traceback (most recent call last):
File "/home/oleks/Documents/code/code.py", line 25, in <module>
in_rgb = q_rgb.get()
RuntimeError: Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'rgb' (X_LINK_ERROR)'.
I also use usb2, but everything works fine on a Windows machine. All the programs that I launched, as well as the demo version, but it does not want to work on the raspberry.
My code:
import cv2
import depthai
width, height = 640, 480
pipeline = depthai.Pipeline()
cam_rgb = pipeline.createColorCamera()
cam_rgb.setPreviewSize(width, height)
cam_rgb.setInterleaved(False)
cam_rgb_out = pipeline.createXLinkOut()
cam_rgb_out.setStreamName("rgb")
cam_rgb.preview.link(cam_rgb_out.input)
with depthai.Device(pipeline) as device:
q_rgb = device.getOutputQueue("rgb")
while True:
in_rgb = q_rgb.get()
frame = in_rgb.getCvFrame()
cv2.imshow('Camera', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
I will be very grateful for your help!