Hello! I'm currently trying to connect into one of my OAK-SRs which are connected over PoE into my net and I can't reach them while using depthai api over Python code.
This is my code:
import depthai as dai
import cv2
import signal
import time
import threading
from typing import List
DEVICE_ID = "14442C106189C8D600"
# Buscamos los devices:
def main():
print('Searching for all available devices...\n')
infos: List[dai.DeviceInfo] = dai.Device.getAllAvailableDevices()
device = None
if len(infos) == 0:
print("Couldn't find any available devices.")
exit(-1)
# Busamos el device cuyo id sea el indicado
for device_info in infos:
if device_info.deviceId == DEVICE_ID:
device = dai.Device(device_info)
print(f"Found device '{device_info.name}', DeviceID: '{device_info.deviceId}'")
break
# Realizamos la conexión:
with dai.Pipeline(device) as pipeline: # type: ignore
camRgb = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_A)
output = camRgb.requestOutput((1920, 1440))
encoded = pipeline.create(dai.node.VideoEncoder).build(output,
frameRate = 30)
pipeline.start()
print("Started to save video to video.encoded")
print("Press Ctrl+C to stop")
timeStart = time.monotonic()
while pipeline.isRunning():
frame = outputQueue.get()
assert isinstance(frame, dai.ImgFrame)
cv2.imshow("video", frame.getCvFrame())
key = cv2.waitKey(1)
if key == ord('q'):
break
pipeline.stop()
pipeline.wait()
if __name__ == "__main__":
main()
It discover the maps over the network and I create a device using the id of the DeviceInfo object. Main problem is I don't get the right configuration (or something like that as the error states) this is the error code:
Traceback (most recent call last):
File "/home/xurde/miniconda3/envs/Xurde_142_dev/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/xurde/miniconda3/envs/Xurde_142_dev/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/xurde/Escritorio/Repositorios/TEST_142_arcelor/src/arcelor_py/main_lux_cam.py", line 14, in <module>
pipeline.start()
RuntimeError: Camera(0) - No available sensor config available for requested output configurations: Request 0: size: 640x480, fps: 30, type: unset, resizeMode: CROP