I have an Oak-D Lite which is working with 'Stereo AI' and 'Stereo Depth' scripts from learnopencv.com but with some luxonis scripts (eg gen2-licence-plate-recognition) I am now getting this error, which was not happening before. I get a similar IO error with some other scripts too.

Pipeline created.

Traceback (most recent call last):

File "C:\Users\*******\PycharmProjects\RW\main.py", line 259, in <module>

with dai.Device(create_pipeline()) as device:

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RuntimeError: Device already closed or disconnected: io error

This does not go away with shutdown/reboot or changing USB ports. My cable is USB3.

Could this be caused the depthai-sdk version (1.15.1) I am using? I get repeated errors and install failure trying to install the earlier depthai and depthai-sdk versions specified in requirements.txt for this module.

  • No further IO problems since I began using a powered USB hub or a 5 Amp power supply on the RPI-5. 🤞

further to above, I have now tried to use this device (OAK-D lite) on a Windows system and two different Raspberry Pi devices with fresh OS and depthai installs. All produce this or a similar?? error (ie no device available) on some but not all scripts that use the device. All 3 cameras are working with some scripts. The luxonis example script using Scripts mobilenet-ssd seems to work but most others using networks seems to crash and give this device unavailable / IO error.

I have confirmed my windows11 system usb-c port can deliver 3A so shouldn’t be a browning out issue? The error occurs before any image window is displayed. Once it has occurred it seems to affect other previously working scripts, which can be recovered by ejecting and re-connecting the OAK device.

Very frustrating! Given this occurs on a clean build on an rpi 5, is this actually a hardware fault on the camera? Any suggestions on where to next?

While awaiting help I think I have solved my device communications / IO error, which does appear to be due to insufficient power to the device from the USB port. I had wrongly assumed that 3 Amps (usb-c port rating on my laptop) was enough, but it seems it is not enough to run some of the scripts at least. Oddly though, these scripts were working previously. However I have now tested the device connected through a powered usb hub and the scripts that were crashing now run as expected. 🙂👍

    regorWislon
    I/O error is usually not indicative of brownouts so might not be a power issue, but a USB one. Not sure really, LMK if it happens again.

    Thanks,
    Jaka

    4 days later

    No further IO problems since I began using a powered USB hub or a 5 Amp power supply on the RPI-5. 🤞