Skip to content

StarlightEye Quick Start Guide

Will Whang edited this page Aug 5, 2024 · 19 revisions

StarlightEye Quick Start Guide

This quick start guide will help you set up and start using your OneInchEye camera board for Raspberry Pi. Please follow the steps outlined below to set up and start using your camera board.
The following guide is assuming your are running Raspberry Pi OS based on bookworm.

Here is a quick summary of all the connectors on the StarlightEye:

1. Verify Hardware Compatibility

Make sure you are using either RPI5 board 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

2.a Attach the StarlightEye camera board to the Raspberry Pi board using the 22-pin FPC connector to CAM1 connector. The FPC contact should face up rather then down. Check FPC Guide here
2.b Ensure that the camera board is securely connected and that the pins are properly aligned.
2.d Connect a 5V power to the StarlightEye.
2.e The result should look like the following:

3. Set Up the Operating System

3.a Download and flash the latest 64bit Raspberry Pi OS for your board. 3.b Insert the microSD card (with the flashed OS) into your Raspberry Pi board.

4. Power Up the Raspberry Pi

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

5. Compile and Install the Camera Driver

We need to recompile Libcamera and Libcamera-apps/rpicam-apps so that they recognize the IMX585 sensor. The following steps are similar to the Libcamera Compile Guide, but the repository is changed to a forked version that supports IMX585 (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 Install forked 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 Install forked 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 

5.d Install v4l2-subdevice Drivers

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

sudo apt install -y linux-headers dkms git

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

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

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

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

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

sudo ./setup.sh

6. 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=imx585. So, it will look like this:

camera_auto_detect=0
dtoverlay=imx585

Side note is that if you want to use Cam/Disp port 0 (Only for RPI5), you can do dtoverlay=imx585,cam0
Or you have a monochrome IMX585 then you can use dtoverlay=imx585,mono, the options can be stacked together like dtoverlay=imx585,cam0,mono

After making these changes, save the file and exit the editor.

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

9. IR filter script install

Check the following page for IR filter control script: https://github.com/will127534/StarlightEye/blob/main/software/README.md

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:
[    0.536902] platform 1f00128000.csi: Fixed dependency cycle(s) with /axi/pcie@120000/rp1/i2c@80000/imx585@1A
[    2.807110] rp1-cfe 1f00128000.csi: found subdevice /axi/pcie@120000/rp1/i2c@80000/imx585@1A
[    2.916981] imx585: loading out-of-tree module taints kernel.
[    2.939049] imx585 4-001a: IMX585 mono option: 0
[    3.961770] imx585 4-001a: Device found, ID: 32
[    3.961807] imx585 4-001a: Pixel Rate : 520560000
[    3.961813] imx585 4-001a: exposure_max:2230, exposure_min:4, current_exposure:4
[    3.961817] imx585 4-001a:   VMAX:2250, HMAX:550
[    3.961821] imx585 4-001a: Setting default HBLANK : 0, VBLANK : 70 with PixelRate: 520560000
[    3.961834] rp1-cfe 1f00128000.csi: Using sensor imx585 4-001a for capture
[    5.223994] imx585 4-001a: xfer_func: 0
[    5.943630] imx585 4-001a: xfer_func: 0

And re-installing 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

  2. Device not found If the system can not detect IMX585, make sure you connect the 5V to a stable source when the system is booting up, if the 5V will be on after the system boot-up then there is no way for the system to detect IMX585.