Arducam B0251 not working with Raspi Zero on Buster

1.Which seller did you purchase the product(s) from?

2.The Model number of the product(s) you have purchased?

3.Which Platform are you using the product(s) on?

4.Which instruction are you following?

5.Has your product ever worked properly?

6.What problems are you experiencing?
1.Which seller did you purchase the product(s) from?

robotshop.com/de/de

2.The Model number of the product(s) you have purchased?
https://www.arducam.com/product/arducam-high-quality-camera-for-jetson-nano-and-xavier-nx-12mp-m12-mount/

3.Which Platform are you using the product(s) on?
Raspberry Pi Zero W

4.Which instruction are you following?
https://github.com/ArduCAM/MIPI_Camera for RPI

5.Has your product ever worked properly?
Never worked

6.What problems are you experiencing?
Hi all,

I’m struggling with this camera on the raspberry pi Zero W (rev. 1.1), Raspberry Pi OS buster: https://www.robotshop.com/de/de/arducam-mini-hq-123mp-imx477-kamera-mit-m12-objektiv-jetson-nano-xavier.html

Is it even compatible with the RasPi Zero?

I followed the instructions here: https://github.com/ArduCAM/MIPI_Camera/tree/master/RPI

when I execute vcgencmd get_camera, I get

supported=1 detected=1

when I execute ./arducamstill -t 0, I get:

Open camera…
sh: 1: i2cdetect: not found
Found sensor imx477 at address 1A
mode: 0, width: 4056, height: 3040, pixelformat: BA81, desc: (null)
mode: 1, width: 8112, height: 3040, pixelformat: BA81, desc: This mode is used for stereo hat.
Get ctrl V4L2_CID_FOCUS_ABSOLUTE fail.
index: 0, CID: 0x009A090A, desc: V4L2_CID_FOCUS_ABSOLUTE, min: 0, max: 1023, default: 190, current: 0
Can’t open the file
mmal: Failed to fix lens shading, use the default mode!
usrvcsm: [vcsm_malloc_cache]: [1065] [mmal_vc_port buffer]: ioctl mem-alloc FAILED [-1] (hdl: 0)
usrvcsm: [vcsm_vc_hdl_from_hdl]: [1065]: invalid device or handle!
usrvcsm: [vcsm_lock]: [1065]: invalid device or invalid handle!
mmal: manually_port_pool_create: could not allocate 18531840 bytes of shared memory (handle 0)
mmal: Failed to create isp output pool.
usrvcsm: [vcsm_malloc_cache]: [1065] [mmal_vc_port buffer]: ioctl mem-alloc FAILED [-1] (hdl: 0)
usrvcsm: [vcsm_vc_hdl_from_hdl]: [1065]: invalid device or handle!
usrvcsm: [vcsm_lock]: [1065]: invalid device or invalid handle!
mmal: manually_port_pool_create: could not allocate 12354560 bytes of shared memory (handle 0)
mmal: mmal_port_pool_destroy: port 0x1f947e0, pool 0x1fa1e60 destroyed while port enabled
mmal: Failed to create connection.
mmal: Failed to create pool
mmal: Failed to enable camera
Failed to set focus, the camera may not support this control.
usrvcsm: [vcsm_malloc_cache]: [1065] [mmal_vc_port buffer]: ioctl mem-alloc FAILED [-1] (hdl: 0)
usrvcsm: [vcsm_vc_hdl_from_hdl]: [1065]: invalid device or handle!
usrvcsm: [vcsm_lock]: [1065]: invalid device or invalid handle!
mmal: manually_port_pool_create: could not allocate 12354560 bytes of shared memory (handle 0)
mmal: Failed to create connection.
mmal: Failed to create pool
mmal: Failed to enable camera
Failed to set focus, the camera may not support this control.
usrvcsm: [vcsm_malloc_cache]: [1065] [mmal_vc_port buffer]: ioctl mem-alloc FAILED [-1] (hdl: 0)
usrvcsm: [vcsm_vc_hdl_from_hdl]: [1065]: invalid device or handle!
usrvcsm: [vcsm_lock]: [1065]: invalid device or invalid handle!
mmal: manually_port_pool_create: could not allocate 12354560 bytes of shared memory (handle 0)
mmal: Failed to create connection.
mmal: Failed to create pool
mmal: Failed to enable camera
Failed to set exposure, the camera may not support this control.
Start preview…
usrvcsm: [vcsm_malloc_cache]: [1065] [mmal_vc_port buffer]: ioctl mem-alloc FAILED [-1] (hdl: 0)
usrvcsm: [vcsm_vc_hdl_from_hdl]: [1065]: invalid device or handle!
usrvcsm: [vcsm_lock]: [1065]: invalid device or invalid handle!
mmal: manually_port_pool_create: could not allocate 12354560 bytes of shared memory (handle 0)
mmal: Failed to create connection.
mmal: Failed to create pool
mmal: Failed to enable camera
start preview status = 1

8.How would you like us to help you?

Am I doing something wrong? Do I have to take some additional steps?
7.What attempts at troubleshooting have you already made?

8.How would you like us to help you?

also, kernel version: 5.10.0+

It is due to the memory is not enough. Please open the /boot/config.txt file and change the gpu_mem size to bigger.

Ok, looks like I messed up my boot/config.txt

I changed it to this:

dtparam=audio=on
start_x=1 #do I need this? I’m running the Pi in headless mode…
dtparam=i2c_vc=on
#dtoverlay=arducam
gpu_mem=250

Now, when I use ./capture I get a picture, but it is blurry, dark and green.

The output from ./capture is:

Open camera…
sh: 1: i2cdetect: not found
Found sensor imx477 at address 1A
mode: 0, width: 4056, height: 3040, pixelformat: BA81, desc: (null)
mode: 1, width: 8112, height: 3040, pixelformat: BA81, desc: This mode is used for stereo hat.
Get ctrl V4L2_CID_FOCUS_ABSOLUTE fail.
index: 0, CID: 0x009A090A, desc: V4L2_CID_FOCUS_ABSOLUTE, min: 0, max: 1023, default: 190, current: 0
Please choose sensor mode: 0
Setting the mode…
choose the mode 0
Can’t open the file
mmal: Failed to fix lens shading, use the default mode!
Current mode is 0
Notice:You can use the list_format sample program to see the resolution and control supported by the camera.
Failed to set focus, the camera may not support this control.
Capture image mode0.jpg…
Enable Software Auto Exposure…
Enable Software Auto White Balance…
Waiting for automatic adjustment to complete…
mmal: Enable JPEG encoder.

Close camera…

 

It looks like something is still wrong with the exposure/focus and AWB and I have the feeling i’m in over my head :smiley: I would be super grateful if you could help me get ok pictures out of the cam…

Ok, so that worked exactly once… Now I’m back at the error message from the first post.

The gpu memory seems fine though, vgenmcd get_mem reloc gets me 228M

Hi,

I advise you use our arducamstill demo. Now we mainly maintain arudcamstill demo.

Please try to use ./arducamstill to preview and get image data test.

Let me know if you need more help.