Arducam 12MP PTZ camera red/pink hue, reversed keys, focus app differences on Pi 5

Hi, hoping someone can point me in the right direction. I’ve got an Arducam 12MP 477P PTZ camera (SKU B0167B12) on a Raspberry Pi 5, connected with the white 22-pin to 22-pin cable. During setup I set camera-autodetect=0 and added dtoverlay=imx477 to config.txt. I couldn’t get ./enable_i2c_vc.sh to run, so I just enabled I2C in the Pi preferences instead. The pan/tilt servos work and I can focus and zoom, but the image has a red/pink hue that I can’t adjust. Also the arrow keys are reversed in the software. And there seem to be two versions of the focus example app — one opens a larger window but has less zoom/focus range. Is that normal?

Welcome. The fact that pan/tilt and focus/zoom are working means I2C is fine — enabling it in the preferences does the same thing as running enable_i2c_vc.sh, so you don’t need to chase that. The red/pink hue, especially in the corner, is usually a Picamera2 tuning problem on the Pi 5, not a bad sensor. Which example are you running for the live view? If it’s from the PTZ-Camera-Controller repo, it should be FocuserExample.py.

Yes, I’m running FocuserExample.py from the PTZ-Camera-Controller repo. The tint is worst in the corner and it won’t go away no matter what I change in the white balance. The reversed arrows are annoying but the color is the bigger issue.

That fits. These modules are driven with the imx477 overlay, but they can report as imx219, which makes the default tuning data Picamera2 picks up a bad match on the Pi 5 — hence the red corner tint. The fix is to pass an explicit tuning file to Picamera2. I’ve prepared one for this setup and sent it over by private message. Check your messages — the file is pi5_imx477_140d.json.

Thanks, I got the file. Where should I put it and how do I get Picamera2 to actually use it?

Place it at /home/pi so the full path is /home/pi/pi5_imx477_140d.json. Then in the PTZ-Camera-Controller repo, open RpiCamera.py. Find this line:
self.cam = Picamera2()
and change it to:
self.cam = Picamera2(tuning=“/home/pi/pi5_imx477_140d.json”)
Save it, then rerun FocuserExample.py and check the corner tint.

That fixed it — the red/pink corner is gone and colors look normal now. Thanks! The arrow keys are still reversed though. Is that a separate setting? And do you know why there are two focus example apps, where one has a bigger window but a smaller zoom/focus range?

Great, that confirms it was a tuning mismatch rather than the sensor. For the arrow keys, that’s a separate control-mapping issue in the example app — unrelated to the camera tuning — so it’ll need its own look. Same for the two focus apps: they’re different demo versions in the repo and not connected to this fix. To recap the tint workaround: put pi5_imx477_140d.json in /home/pi and pass it via Picamera2(tuning=“/home/pi/pi5_imx477_140d.json”) in RpiCamera.py, even though the module may be reported as imx219. If you start a new thread on the arrow key mapping, I can dig into that one.