Pi Camera V3/IMX Chipset Based Cameras Not Working

@b-morgan If you have previously run the script and want to update, there are two options.

  1. rm -rf /home/pi/camera-streamer and then follow the standard instructions.
    or
  2. replace /home/pi/camera-streamer/service/camera-streamer-pi708-12MP.service with https://raw.githubusercontent.com/ltlowe/misc/main/picam3/camera-streamer-pi708-12MP.service and reboot.
2 Likes

Hi Itlowe, I just try the first command and it unfortunatly not update the camera-streamer-pi708-12MP.service file correclty.

Hi then try the second option and it work perfeclty. Here the command line for those who don't know how to do it (like me 2 days ago :slight_smile: ) :
sudo nano /home/pi/camera-streamer/service/camera-streamer-pi708-12MP.service
erase all content in the file that open and past (right click to paste in putty) all content written in this link:
https://raw.githubusercontent.com/ltlowe/misc/main/picam3/camera-streamer-pi708-12MP.service
Save the file by exiting with ctrl+x, answer y, confirm with enter
sudo reboot

Newbie here I got all the way until I need to run this
wget https://raw.githubusercontent.com/ltlowe/misc/main/picam3/cam3install.sh
chmod +x cam3install.sh
./cam3install.sh

How do I do this can I get a step by step?
Right now my stream just says Webcam loading with out ever connecting.

Start an SSH session with your OctoPi system (username: Pi and your password).

There are three lines above starting with "wget", "chmod", and "./". You can type each line into your SSH session and hit return or copy them with ctrl-C on a Windows machine and right-click in the SSH session window and hit return.

The first line fetches the script, the second line makes the script executable, and the third line executes the script. This third line will generate lots of output and will take a while to finish.

At the end of the script it should ask you to reboot.

Sorry about that, you are correct. I had a typo, thanks for catching it.
I've updated the previous post and added a note to post 72

2 Likes

Thank you! I removed my existing camera-streamer folder and installed using the new script. Quality is improved and autofocus is working!

Do you have any info or references for the AfMode and AfRange options?

I have my camera mounted to the Z axis and sometimes the print head moving back and forth causes the camera to be stuck overshooting its autofocus back and forth for a long time. Wondering if either of those two options could help solve this

According to the pi camera software manual, the options are
Auto Focus Modes:

  • default (usually auto, but most people are not getting auto by default)
  • manual
  • auto (at start up only plus capture time for some software)
  • continuous

Auto Focus Ranges:

  • normal
  • macro (close up only)
  • full (close up and normal ranges)

The local url http://octopi.local:8080/option shows available camera-streamer options and value ranges. It only lists 0-2 as valid for AfMode, so I chose 2 being the largest supported value. It worked and enabled continuous focus even though that doesn't seem to align with the manual.

For AfRange there are 3 options and the values are 0-2, so I chose 2 for full range, guessing that they were listed in order, and it worked as well.

There are several other options in the manual that could map to keys shown on the camera-streamer option page, but I have not experimented with any of the other ones. If you want to, you should be able to add them to the .service file the same as AfMode and AfRange. Restarting the service or rebooting is needed to activate changes.

2 Likes

Much appreciated, I'll do some experimenting and post my results if I make any progress

1 Like

Thanks a lot!!
It works just as you descibed :- )

EDIT
So I figured out the problem the case that I had printed out didn't have a large enough hole at the front so something was pushing on the elements and not allowing correct AF.

Leaving the Original post in case it can help someone else:

EDIT
Is anyone having issues with the focus area not being the center of the frame?

My pi cam 3 seems to be focusing on the RHS of the image
ie
RHS: Dropbox - Screenshot 2023-02-13 at 09.04.31.png - Simplify your life
Center: Dropbox - Screenshot 2023-02-13 at 09.04.42.png - Simplify your life

On in the manual there is

	--autofocus-window			Specify the autofocus window

I've tried adding it to the service with different values including up to -camera-options=AfWindow=0,0,1,1 \ which according to the documentation seems like it should cause the entire frame to be used for focus (and it is super slow to focus when I do that) It still seems to have the same only RHS of the image come into focus.

I've tried setting the lens position manually from the /option path as well and that seems to have the same issue I can never get the center of the frame in focus.

I know in the V2 camera using 1920x1080 it's only using part of the sensor (I had my v2 resolution set to 1640x1232 to get a full FOV window in the image. I'm wondering if that is causing the strange AF area.

Is anyone else seeing this? Maybe I got a bum camera module?

@msroest Glad you solved it.

It's also nice to know that the autofocus window control seems to work, and now we know not to use the whole frame :slight_smile:

2 Likes

Yah on the bad side I seem to have hosed my cam v3 in the process of prying it in and out of cases. It now has a streak of messed up pixels. So think I’ll be reverting back to my v2

How long is the make install supposed to run? It's sitting at 56% forever (1-2 hours)
FYI: Pi Zero 2W

Compiles after increasing Swap

The stream is not working on a Pi Zero 2W though.

Same for me. libcamera-still --list-cameras shows the camera list, but no Preview. If I use the same SD card in a Pi 4B it works, but not on the Pi Zero 2W

I confirm that this procedure can help run the Cam Module 3 with a resolution of 2304x1296.

However, HDR doesn't work. I typed the command (v4l2-ctl --set-ctrl wide_dynamic_range=1 -d /dev/v4l-subdev0) to enable the HDR and it gave the following output (see the pictures)

WARNING: Unable to set HDR mode

Available cameras:
0 : imx708 [4608x2592] (/base/soc/i2c0mux/i2c@1/imx708@1a)
Modes: 'SBGGR10_CSI2P' : 2304x1296 [30.00 fps - (0, 0)/0x0 crop]

I really wonder if HDR can be enabled with Pi Cam Module 3 on OP RC3!!!

This is absolutely a function of your RPi. I have a 4B and it took ~20min? I wasn't even really paying attention. It finished fast enough for me to not even think about it.

first I'm very new to most if not all of this.
I followed the instructions and do see camera in octoprint. Thank you.
However if I try to install OctoDash it breaks. Not only that but if I edit the config.txt to rotate my 7" screen (lcd_rotate=2) the camera breaks. It seems any edit to config breaks the camera. I've been working on this for 2 days. I've searched and searched but no "fix" seems to work with OctoDash. I don't know if this is due to using the RC or if it's just another sign I'm a total idiot.

This is likely a bullseye (newer base OS) issue I suspect.

@nDeavor , thank you for you post about the Zero W2. I have added a not to post 72 that this method is confirmed on 3A+, 3B, and 4, but has not successfully been used on a Zero 2W.

I personally have a 3B and an original Zero W so rely on reports from users for other versions.

1 Like

I don't really know what I'm doing, but I was able to get a Pi Camera V3 working on my Zero 2 W.

I followed @ltlowe instructions and flashed the latest octopi image to my sd card
then followed @Caouch instructions to increase the swap file size.
then back to the remaining instructions from @ltlowe

at this point the camera was still not working, so I went to raspi-config and enabled "legacy camera support" even though it warns that this function is deprecated... as soon as I reboot and load the octoprint UI i have a crisp image with working autofocus. Still waiting to get this back on my MK3S to see what the performance is like. But very promising so far.

Thanks for everyone's help, I'll post an update after my first print.