Pivariety Motorized Focus Camera Module for Raspberry Pi21MP IMX230(SKU: B0324)QUICK START GUIDE
INTRODUCTION
- About ArducamArducam has been a professional designer and manufacturer of SPI, MIPI, DVP, and USB cameras since 2012. We also offer customized turnkey design and manufacturing solution services for customers who want their products to be unique.
- About Pivariety CameraArducam Pivariety is a Raspberry Pi camera solution to take the advantage of using its hardware ISP functions. Using Arducam Pivariety camera modules, users can get better performance and a wider variety of camera, lens options. For a long time, Raspberry Pi users are limited to use the closed-source official supported camera driver and camera modules (V1/V2/HQ). Now Arducam made it possible to provide well-tuned ISP for Pivariety camera modules with Auto Exposure, Auto White Balance, Auto Gain Control, Lens Shading Correction, etc. This series of cameras use the libcamera framework, they can’t be supported by Raspistill, and the way to access the camera is libcamera SDK(for C++)/libcamera-still/ libcamera-vid/Gstreamer. If you want to know more about other models of Pivariety Camera, pleasevisit: https://www.arducam.com/docs/cameras-for-raspberrypi/pivariety/
SPECS
Image Sensor | 21MP IMX230 |
Max. Resolution | 5344H × 4016V |
Pixel Size | 1.12um x 1.12um |
Optical Format | 1/2.4” |
Lens Spec | Focal length: 4.77mm, F.NO:
1.75±5%, FOV: horizontal 64deg |
IR Sensitivity | Integral IR filter, visible light only |
Focus Type | Motorized focus, programmable focus control |
Frame Rate | 5344× fps,
3840× fps, 2592× fps, 2656× fps, 1920× fps, 1280× fps, 1280× fps, 640× fps |
Sensor Output Format | RAW10 |
ISP Output Format | The output image format of JPG,
YUV420, RAW, DNG; output video format of MJPEG, H.264 |
Interface Type | 2-Lane MIPI |
Board Size | 38x38mm |
SOFTWARE
- Driver Installationwget -O install_pivariety_pkgs.shhttps://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.shchmod +x install_pivariety_pkgs.sh./install_pivariety_pkgs.sh -p kernel_driverpress y to rebootNOTE: The kernel driver installation only supported by the latest version 5.10. For other kernel versions, please go to our Doc page:https://www.arducam.com/docs/cameras-for-raspberry-pi/pivariety/how-to-install-kernel-driver-for-pivarietycamera/#2-how-to-build-raspberry-pi-kernel-driverfor-arducam-pivariety-cameraYou can also visit this doc page to refer to the hardware connection: https://www.arducam.com/docs/cameras-for-raspberry-pi/pivariety/21mp-imx230pivariety-motorized-focus-camera-module/
- Test the Driver and CameraAfter you’ve finished the hardware assembly and driver installation, you can test whether the camera is detected and working.• View the Status of Driver and Cameradmesg | grep arducamIt will display arducam-pivariety if driver installed successfully and firmware version if the camera can be detected.The display should be probe failed if the camera can’t be detected, you might have to check the ribbon connection, then reboot the Raspberry Pi.• View the Video NodeThe Pivariety camera modules are emulated as the standard video device under /dev/video* node, so you can use the ls command for listing the contents in the /dev folder.ls /dev/video* -lSince the camera module is V4L2 compliant, you can use the V4l2 controls to list the supported color space, resolutions, and frame rates.v4l2-ctl –list-formats-extNOTE: Although V4L2 interface is supported, only RAW format images can be obtained, without ISP support.
- Official Libcamera App Installation./install_pivariety_pkgs.sh -p libcamera_dev./install_pivariety_pkgs.sh -p libcamera_apps
- Capture Image and Record Video• Capture imageFor example, preview for 5s and save the image named test.jpg libcamera-still -t 5000 -o test.jpg• Record videoFor example, record a H.264 10s video with the frame size 1920W × 1080H libcamera-vid -t 10000 –width 1920 –height 1080 -o test.h264NOTE: H.264 format only supports 1920×1080 and below resolution.• Plugin gstreamer installationInstall gstreamersudo apt updatesudo apt install -y gstreamer1.0-toolsPreviewgst-launch-1.0 libcamerasrc ! ‘video/xraw,width=1920,height=1080’ ! videoconvert ! autovideosink
- Control the Focusing Manually• Control via v4l2-ctlv4l2-ctl -c focus_absolute=300• Control via scriptgit clone https://github.com/ArduCAM/ArducamPivariety-V4L2-Driver.gitcd Arducam-Pivariety-V4L2-Driver/focuspython3 FocuserExample.pyNow you can use the up and down on the keyboard to control the focus position
- Automatically Control the Focusing• Focus oncelibcamera-still -t 0 –autofocuslibcamera-vid -t 0 –autofocus• Enable autofocus using Flibcamera-still -t 0 –keypresspress f to trigger autofocus
NOTE: Note: Please install the Arducam latest version of libcamera-dev and libcamera-apps, and update the firmware of Pivariety(contacting Arducam: [email protected]) if the camera can not autofocus.
TROUBLESHOOT
- Cannot Allocate Memory[3:45:35.833744413] [6019] INFO RPI raspberrypi.cpp:611 Sensor: /base/soc/i2c0mux/i2c/–Selected mode: 5344×4012-pRAA [3:45:35.948442507] [6019] ERROR V4L2 v4l2_videodevice.cpp:1126 /dev/video14[17:cap]: Unable to request 4 buffers: Cannot allocate memory [3:45:35.948551358] [6019] ERROR RPI raspberrypi.cpp:808 Failed to allocate buffers ERROR: *** failed to start camera *** Edit /boot/cmdline.txt and add cma=400M at the end More details: https://lists.libcamera.org/pipermail/libcamera-devel/2020-December/015838.html
- The Image Displays Color DotsAdd code –denoise cdn_off at the end of command ./libcamera-still -t 5000 -o test.jpg –denoise cdn_off More details: https://github.com/raspberrypi/libcameraapps/issues/19
- Failed to Install the DriverPlease check the kernel version, we only provide the driver for the latest official kernel version image when this Pivariety camera released. You can follow Arducam Doc page https://www.arducam.com/docs/cameras-for-raspberry-pi/pivariety/ to get the drivers for other kernel versions. If you have any other problems, please feel free to contact us via [email protected].
References
[xyz-ips snippet=”download-snippet”]