Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi 5 x64 Bookworm with Camera Module 3 - No cameras detected #6

Open
jonathan88n opened this issue Mar 5, 2024 · 18 comments

Comments

@jonathan88n
Copy link

When starting up the camsrv, I see error logs in the terminal that says the following:

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:5000
  • Running on http://192.xxx.xx.xx:5000
    Press CTRL+C to quit
    [2024-03-04 21:52:16,600] ERROR in app: Exception on / [GET]
    Traceback (most recent call last):
    File "/workspace/raspi-cam-srv/.venv/lib/python3.11/site-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/workspace/raspi-cam-srv/.venv/lib/python3.11/site-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/workspace/raspi-cam-srv/.venv/lib/python3.11/site-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "/workspace/raspi-cam-srv/.venv/lib/python3.11/site-packages/flask/app.py", line 852, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/workspace/raspi-cam-srv/raspiCamSrv/auth.py", line 273, in wrapped_view
    return view(**kwargs)
    ^^^^^^^^^^^^^^
    File "/workspace/raspi-cam-srv/raspiCamSrv/home.py", line 25, in index
    Camera().startLiveStream()
    ^^^^^^^^
    File "/workspace/raspi-cam-srv/raspiCamSrv/camera_pi.py", line 878, in new
    activeCam = Camera.getActiveCamera()
    ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/workspace/raspi-cam-srv/raspiCamSrv/camera_pi.py", line 1054, in getActiveCamera
    raise SystemError("No cameras were found on the server's device")
    SystemError: No cameras were found on the server's device
    [2024-03-04 21:55:12,597] ERROR in camera_pi: Thread 140735407976832: Camera._thread - Exception.

rpi5-1
rpi5-2
I've attached two pictures of the cable hook up into cam0 slot.

@signag
Copy link
Owner

signag commented Mar 5, 2024

Your cabeling looks OK.

The error is raised when Picamera2 does not return any camera information.
You can test it directly:

~ $ python
>>> from picamera2 import Picamera2
>>> print(Picamera2.global_camera_info())
>>> quit()

After some libcamera INFOs, you should see
[{'Model': 'imx708_wide_noir', 'Location': 2, 'Rotation': 0, 'Id': '/base/soc/i2c0mux/i2c@1/imx708@1a'}]

If you see an empty list, instead
[],
Picamera2 did not find a camera.

In this case, you may have activated legacy camera support.
Open the Raspberry Pi Configuration tool:

~ $ sudo raspi-config
Select "3 Interface Options"
Then "I1 Legacy Camera Enable/disable legacy camera support"

If you see "Would you like to enable legacy camera support?"
select <No>

When back in the main menu, choose <Finish>

The tool will request to reboot, which must be confirmed with <Yes>

After reboot, you can reconnect via SSH and repeat the direct test with Python, described above.

@jonathan88n
Copy link
Author

jonathan88n commented Mar 5, 2024

print(Picamera2.global_camera_info()) did return an empty list ( [] ).

I did sudo raspi-config and went to Interface Options but had no Legacy or Camera options:
image

uname -a

Linux rpi5 6.1.0-rpi8-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux

@signag
Copy link
Owner

signag commented Mar 5, 2024

Can you please check /boot/firmware/config.txt

This must have an active entry camera_auto_detect=1

@jonathan88n
Copy link
Author

jonathan88n commented Mar 5, 2024

sudo cat /boot/firmware/config.txt | grep camera_auto

camera_auto_detect=1

I am using a Raspberry Pi Camera Cable (Standard - Mini | 200mm) by the way.

@signag
Copy link
Owner

signag commented Mar 6, 2024

Certainly, you may have already looked elswhere for solutions.
Maybe, this one has some new aspects:
https://www.raspberrypi-5.com/questions/cant-open-camera-by-index-raspberry-pi/
... especially the permission check.

The primary check would, of course, be to check the cables.

Looking again at your picture for the camera side, it seems to me that the cable is not pushed far enough into the connector.
Normally, there is not so much to be seen from the gold contacts.

If that all does not help and if you have a spare SD card, I would recommend preparing a fresh install with the latest imager version.

@ZombieToad
Copy link

rpi5-1

The cable connected to your Raspberry Pi 5 is reversed

@jonathan88n
Copy link
Author

@signag, I have indeed looked elsewhere but I'll give those troubleshooting steps a try.
@ZombieToad, are you saying the connector (gold side) should be facing the HDMI instead of facing where the SD card is inserted? I read elsewhere that that cable should be facing opposite direction of the HDMI port.

@ZombieToad
Copy link

@signag, I have indeed looked elsewhere but I'll give those troubleshooting steps a try. @ZombieToad, are you saying the connector (gold side) should be facing the HDMI instead of facing where the SD card is inserted? I read elsewhere that that cable should be facing opposite direction of the HDMI port.

the HDMI and SD card slot are on the same side from the camera connector? the gold contacts should be facing the ethernet port (away from the hdmi ports)
image2

@jonathan88n
Copy link
Author

@ZombieToad, so I tried flipping the cable around to face the Ethernet port but still no luck:
image
image
image

@signag, I noticed in those troubleshooting steps, the permission check shows I don't even have /dev/video0 at all:
image

image

@signag
Copy link
Owner

signag commented Mar 11, 2024

What about a fresh install with latest imager version 1.8.5 from https://www.raspberrypi.com/software/?

What is your OS version?

Here is mine:
image

@jonathan88n
Copy link
Author

Here is my OS info:
image

I just recently did a fresh image 2 weeks ago.

@signag
Copy link
Owner

signag commented Mar 11, 2024

I still think that your cables might be pushed in further.

here is my setup:

20240311_184158

20240311_183850

Do you have the possibility to try with another camera?
Perhaps this one has a defect.

@jonathan88n
Copy link
Author

So, I do have another Camera Module 3 camera that works successfully with a RPI4 x64 Bulleye and I have tried to use that camera on the RPI5 and the cable doesn't not go any further (it hits a wall, if you will) when inserting it.
Both cameras do not get detected in the RPI5 while both DO get detected in the RPI4.

@signag
Copy link
Owner

signag commented Mar 11, 2024

Then I have no more idea, except that the camera port on your pi5 does not work.

@jonathan88n
Copy link
Author

jonathan88n commented Mar 11, 2024

Does /dev/video0 and /dev/video1 show for you whether or not you have camera plugged in for you?
ls -lha /dev/video*
doesn't return any video0 or video1, only video19+

image

@signag
Copy link
Owner

signag commented Mar 12, 2024

This is with no camera plugged in:
image

This is with one camera plugged in:
image

And this with two cameras:
image

@jonathan88n
Copy link
Author

What cable connector are you using between your RPI and Camera Module 3 (link if you don't mind)? I will try getting a new cable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants