Skip to content

Solution On OctoPrint

1. SD Card image:


Download the SD Card Image

2. System information:


pi@octopi:~ $ uname -a
Linux octopi 5.10.92-v7l+ #1514 SMP Mon Jan 17 17:38:03 GMT 2022 armv7l GNU/Linux

pi@octopi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

3. Install dependencies


3.1. Install the Driver and libcamera

Quick Start Guide for driver installation

Install libcamera:

Step 1. Download the bash scripts

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh

Step 2. Install libcamera

./install_pivariety_pkgs.sh -p libcamera_dev

Step 3. Install libcamera-apps

./install_pivariety_pkgs.sh -p libcamera_apps

3.2. Test

Check video device:

2da62146 5f82 44bb 933d 8f42a7b2d7eb 1

libcamera-still -t 5000 -o test.jpg -n

4. Download libcamera plugin source code


Clone mjpg-streamer source code and execute the following commands, compile and install the libcamera plugin.

git clone https://github.com/ArduCAM/mjpg-streamer.git mjpg-streamer-libcamera
cd mjpg-streamer-libcamera/mjpg-streamer-experimental
make
sudo install -m 755 _build/mjpg_streamer /opt/mjpg-streamer
sudo find _build -name "*.so" -type f -exec install -m 644 {} /opt/mjpg-streamer \;
sudo cp -a -r ./www /opt/mjpg-streamer
sudo chmod 755 /opt/mjpg-streamer/www
sudo chmod -R 644 /opt/mjpg-streamer/www

5. Modify the octopi.txt file


Edit /boot/octopi.txt, and make the following changes

5.1. Configure which camera to use

image 15

like this:

451c42d0 f7db 4205 97ad efcfed81f369

5.2. Set parameters for libcamera plugin.

camera_libcamera_options=""

Parameter details can be viewed using the following command.

./mjpg_streamer -i "input_libcamera.so -h"

pythonmjpg52

5.3. Configuration of camera HTTP output

camera_http_webroot="./www"
camera_http_options=""

You can also use the command to view the camera_http_options parameter.

./mjpg_streamer -o "output_http.so -h"

ad59b012 8a4b 4e35 9aab f6b660c74a36

6. Replace webcamd file


webcamd is in the /root/bin directory.

ac85d88e 5b2d 4fe9 b6a0 8105c3922585

You can change the name of the original file to achieve the purpose of backup. Then copy our modified webcamd to the /root/bin directory.

In the example, we downloaded the new file to the /home/pi directory.

cd ~
sudo mv /root/bin/webcamd /root/bin/webcamd.bak
sudo wget -O webcamd https://github.com/ArduCAM/mjpg-streamer/releases/download/v1.0.0/webcamd
sudo mv webcamd /root/bin/
sudo chmod 755 /root/bin/webcamd

7. Root your Pi


sudo reboot

8. View in browser


8.1. Display

Enter the device’s IP address(ipv4 address) in the browser address bar.

Click on the label pointed by the red arrow in the image below to view the image captured by the camera.

2e5f6a6e 1990 495f a75c 10722ba283dd

8.2. Control

Install control plugin

Click the button pointed by the arrow in the image below.

9161532d c4a2 40f5 9b9b bc894f835f05

Follow the instructions to complete the plugin download.

466507eb 1269 446a 9220 b0d0f1cedd8f

Copy the link to the location outlined in the diagram.

https://github.com/The-EG/OctoPrint-CameraSettings/archive/main.zip

86b6519c 205b 4c55 9f59 3e89db405373

Finally, follow the prompts on the page to restart the service.

sudo reboot

You can use this plugin to achieve manual focus.

d45ce74d dc4b 4335 871a cf659881241b