Camera Module
Overview
The LeMaker Banana Pi and Banana Pro boards feature a CSI (Camera Serial Interface) connector that supports MIPI CSI-2 camera modules. This guide covers the setup, configuration, and usage of camera modules with LeMaker single-board computers. The primary supported sensor is the OmniVision OV5640, a 5-megapixel auto-focus camera module capable of capturing still images and video at various resolutions up to 2592×1944 pixels.
Supported Camera Modules
The recommended camera module for LeMaker boards is the OV5640-based 5MP CSI camera. This module supports JPEG and YUV output formats and offers auto-focus, auto-exposure, and auto-white-balance functionality. The module connects via a 24-pin ribbon cable to the CSI-0 connector on the Banana Pi or Banana Pro board. Third-party CSI camera modules may work if they use a compatible sensor and ribbon cable pinout, though compatibility is not guaranteed.
Hardware Connection
Power off the board completely before connecting the camera module. Locate the CSI connector on the board, which is the flat ribbon cable socket positioned near the HDMI port. Gently lift the locking tab on the CSI connector. Insert the ribbon cable with the contacts facing downward toward the PCB. Push the locking tab back into place to secure the cable. Ensure the cable is seated firmly and straight. A loose or misaligned connection is the most common cause of detection failures.
Software Setup
The Allwinner A20 SoC uses the sunxi-specific camera driver. First, ensure your kernel has the sun4i_csi or gc2035/ov5640 module enabled. On most LeMaker Linux images, the driver is pre-installed. Load the camera module with modprobe ov5640 and verify it appears as /dev/video0 using the command ls /dev/video*. Install the Video4Linux2 utilities with sudo apt-get install v4l-utils. Verify the camera is recognised by running v4l2-ctl --list-devices, which should display the CSI camera device entry.
Capturing Images and Video
To capture a single JPEG image, use fswebcam -r 1920x1080 --jpeg 95 capture.jpg. For video capture, the v4l2-ctl tool provides direct frame grabbing: v4l2-ctl --device=/dev/video0 --stream-mmap --stream-count=100 --stream-to=output.raw. You can also use FFmpeg for more flexible recording: ffmpeg -f v4l2 -video_size 1280x720 -i /dev/video0 -c:v libx264 output.mp4. For live streaming, GStreamer provides efficient pipelines: gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink.
Streaming with FFmpeg and GStreamer
For network streaming, FFmpeg can push an RTMP stream: ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -preset ultrafast -f flv rtmp://server/live/stream. GStreamer supports RTP streaming for low-latency applications. Configure the streaming resolution and bitrate based on your network bandwidth. A 720p stream at 2 Mbps is a good starting point for local network streaming on the Banana Pi.
Troubleshooting
If the camera is not detected, verify the ribbon cable connection and check dmesg | grep -i camera for error messages. Ensure the correct device tree overlay or fex configuration enables the CSI interface. Blank or corrupted frames typically indicate incorrect resolution or format settings; try reducing the resolution to 640×480 for initial testing. If auto-focus is not working, check that the module's flex cable for the focus motor is properly connected. For permission errors accessing /dev/video0, add your user to the video group with sudo usermod -aG video $USER.
Related Pages
For board-specific camera configuration, see the LeMaker Banana Pro documentation. Display and fex configuration details are available at Banana Pi Fex Configuration.
Author: LeMaker Documentation Team
Last updated: 2026-02-10