Expansion plate CSI port not working with python

Does the expansion plate CSI port do a direct pass-through to the Raspberry Pi? or is there some extra step you have to do?

I’m trying to follow this raspberry pi+Coral accelerator computer vision tutorial

I flashed the SD card with their aiy-maker-kit-2022-05-18.img.xz (Raspberry Pi OS Buster) image and then followed the “using pitop with Buster” instructions (https://knowledgebase.pi-top.com/knowledge/pi-top-and-raspberry-pi-os-buster) then rebooted the pi-top then went back to following the AIY tutorial.

This is the output when I run their test script (python3 run_tests.py) with the pi camera plugged into the expansion plate CSI port

— Checking display
—Found a display.
— Checking required files
—Found the required files.
— Testing camera
—Press Q to quit

[ WARN:0@10.920] global /tmp/pip-wheel-8dvnqe62/opencv-python_7949e8065e824f1480edaa2d75fce534/opencv/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO

(V4L2:/dev/video0): select() timeout.

[ WARN:0@21.900] global /tmp/pip-wheel-8dvnqe62/opencv-python_7949e8065e824f1480edaa2d75fce534/opencv/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO

(V4L2:/dev/video0): select() timeout.

[ WARN:0@32.878] global /tmp/pip-wheel-8dvnqe62/opencv-python_7949e8065e824f1480edaa2d75fce534/opencv/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO

(V4L2:/dev/video0): select() timeout.

[ WARN:0@43.858] global /tmp/pip-wheel-8dvnqe62/opencv-python_7949e8065e824f1480edaa2d75fce534/opencv/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO

(V4L2:/dev/video0): select() timeout.

[ WARN:0@54.838] global /tmp/pip-wheel-8dvnqe62/opencv-python_7949e8065e824f1480edaa2d75fce534/opencv/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO

(V4L2:/dev/video0): select() timeout.

[ WARN:0@65.799] global /tmp/pip-wheel-8dvnqe62/opencv-python_7949e8065e824f1480edaa2d75fce534/opencv/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO

(V4L2:/dev/video0): select() timeout.

Cannot initialize camera!

Make sure the camera is connected.

So I thought maybe I didn’t fully plug in the CSI connector when I assembled the pi-top so I took it all apart and removed the raspberry pi then as a sanity check to checked that the CSI port on the raspberry pi worked. I booted up the raspberry pi with the same SD card and camera plugged directly into the CSI port and then ran the AI test script everything passed and the camera worked. So I reassembled the pi-top making double sure the tiny CSI cable was fully seated in the socket, attached pitop to the expansion plate and plugged the camera into the expansion plate’s CSI port. booted up the system and ran the AI test script and once again same error as above.

I’m relatively new to Linux and Python so maybe it’s something obvious I’m missing or some configuration file I have to change.

@RezIN @duwudi

I brought the Pi-Top (DIY) because I thought it would be perfect for computer vision projects because of its battery it can run headless and wireless.

How can I enable and test the expansion plate’s csi port?

Hi,

Sorry to hear your project is not working. I have what might be some bad news: I do not think the raspberry pi supports those cameras any more. This is not an issue with the Pi-Top [4] necessarily.

I would buy a cheap USB webcam and see if it works with opencv. I am happy to guide you through that.

As I said my camera works perfectly when plugged directly into the CSI port on the raspberry pi BUT does NOT work when plugged into the CSI port on the expansion plate.

One of the first things to check it the power. Is the Pi camera’s red led on when it is in the CSI port on the expansion plate, and when direct into the Pi.

What OS are you running? My camera stopped working when Bullseye was implemented. If you are running an older one such as Buster, that might explain why the camera works on one but not the other.

So update on this, I replaced the tiny csi cable and everything works as expected now. The expansion plate does a direct pass through so I can leave the camera setup and plugged into the plate and just remove the pi-top when it needs charging