Skip to content

OneInchEye Quick Start Guide

Will Whang edited this page Oct 6, 2024 · 31 revisions

OneInchEye Quick Start Guide

This quick start guide will help you set up and start using your OneInchEye camera board for Raspberry Pi Compute Module 4 or Raspberry Pi5. Please follow the steps outlined below to set up and start using your camera board.
The following guide has updated for bookworm.

1. Verify Compatibility

Make sure you are using Raspberry Pi5 or your Raspberry Pi Compute Module 4 board has a 22-pin FPC connector with the same pinout as the Raspberry Pi Compute Module 4 IO Board's CAM1 port.

2. Assemble the Hardware

Attach the OneInchEye camera board to the CAM1 connector.
FPC Guide.
And insure that the camera board is securely connected and that the pins are properly aligned.

3. Set Up the Operating System

Download and flash the latest 64bit Raspberry Pi OS for your board. Then insert the microSD card (with the flashed OS) into your Raspberry Pi board.

4. Power Up the Raspberry Pi

Connect your Raspberry Pi board to a power source and boot up the operating system.

5. Compile Libcamera and Libcamera-apps

We also need to recompile Libcamera and Libcamera-apps so that they recognize the IMX283 sensor. The following steps are similar to the Libcamera Compile Guide, but the repository is changed to a forked version that supports IMX283 (https://github.com/will127534/libcamera).

5.a Install the required dependencies:

sudo apt install -y libboost-dev libgnutls28-dev openssl libtiff5-dev pybind11-dev qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5 meson cmake python3-yaml python3-ply

5.b Setup Libcamera:

cd ~  
git clone https://github.com/will127534/libcamera.git  
cd libcamera  
meson setup build --buildtype=release -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dv4l2=true -Dgstreamer=disabled -Dtest=false -Dlc-compliance=disabled -Dcam=disabled -Dqcam=disabled -Ddocumentation=disabled -Dpycamera=enabled  
ninja -C build  
sudo ninja -C build install  

5.c Setup libcamera-apps:

sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev libepoxy-dev libjpeg-dev libtiff5-dev libpng-dev meson ninja-build libavcodec-dev libavdevice-dev libavformat-dev libswresample-dev
cd ~  
git clone https://github.com/will127534/rpicam-apps.git
cd rpicam-apps

For Raspberry Pi OS:
meson setup build -Denable_libav=enabled -Denable_drm=enabled -Denable_egl=enabled -Denable_qt=enabled -Denable_opencv=disabled -Denable_tflite=disabled
For Raspberry Pi OS Lite:
meson setup build -Denable_libav=disabled -Denable_drm=enabled -Denable_egl=disabled -Denable_qt=disabled -Denable_opencv=disabled -Denable_tflite=disabled

Continuing with

meson compile -C build  
sudo meson install -C build  
sudo ldconfig 

6. Compile and Install the Camera Driver

6.a Setting Up the Tools for DKMS driver install

First, install the necessary tools (linux-headers, dkms, and git):

sudo apt install linux-headers dkms git

6.b Fetching the Source Code, Compiling and Installing the Kernel Driver

Clone the repository to your local pi and navigate to the cloned directory:

git clone https://github.com/will127534/imx283-v4l2-driver.git
cd imx283-v4l2-driver/

Notes: If you are using kernel V6.1, use the branch kernel_6.1:

git clone https://github.com/will127534/imx283-v4l2-driver.git --branch kernel_6.1
cd imx283-v4l2-driver/

To compile and install the kernel driver, execute the provided installation script:

sudo ./setup.sh

6.c Updating the Boot Configuration

Edit the boot configuration file using the following command:

sudo nano /boot/firmware/config.txt

In the opened editor, locate the line containing camera_auto_detect and change its value to 0. Then, add the line dtoverlay=imx283. So, it will look like this:

camera_auto_detect=0
dtoverlay=imx283

After making these changes, save the file and exit the editor. Side note is that if you want to use Cam/Disp port 0 (Only for RPI5), you can do dtoverlay=imx283,cam0

7. Reboot the Raspberry Pi

Run the following command to reboot the Raspberry Pi:

sudo reboot

8. Test the Camera

Once the Raspberry Pi has rebooted, open a terminal window and run the following command to test the camera:
rpicam-still -r -o test.jpg -f -t 0

If you want to run it through SSH terminal and see the preview on a HDMI monitor like me, you can use:
export DISPLAY=:0; rpicam-still -r -o test.jpg -f -t 0

Footnote + Troubleshooting steps:

  1. "rpicam-apps only supports the raspberry pi platform" If you got the "rpicam-apps only supports the raspberry pi platform" error, that can actually mean the driver is not loaded correctly, check if you see the imx283 in dmesg by dmesg | grep imx283, you should see some message like:
[    3.328314] rp1-cfe 1f00110000.csi: found subdevice /axi/pcie@120000/rp1/i2c@88000/imx283@1a
[    4.265573] imx283 6-001a: Device found
[    4.265620] imx283 6-001a: Pixel Rate : 451968432
[    4.265627] imx283 6-001a: Setting default HBLANK : 81, VBLANK : 336 with PixelRate: 451968432
[    4.265644] rp1-cfe 1f00110000.csi: Using sensor imx283 6-001a for capture

And re-install the driver + double check the dtoverlay=imx283 should help

  1. Kernel header not found If you are using a non-release version of Raspberry Pi Kernel, it might not be in the kernel-header package and you will need to download it using rpi-source Github