Installing a camera - Phil1988/FreeDi GitHub Wiki
This guide will help you install and configure a camera using KIAUH for installation and CrownsNest for camera streaming.
First, start the preinstalled KIAUH.
-
Open the ssh terminal and connect to your printer.
-
Run the following command to open KIAUH:
cd ~ && ./kiauh/kiauh.sh
-
(Optional) In KIAUH you can update if you are asked to by entering "y" and then redo step 2.:
-
I do not recommend using KIAUH v6 yet, as it is in alpha state, so enter "2" (No):
-
Enter "1" for installing and enter the user password:
-
Enter "14" to install crowsnest:
This will automatically download and install Crowsnest, which is responsible for managing the camera stream.
Make sure your camera is connected. The camera can be a USB webcam or any compatible device.
-
Check if your camera is detected by running:
ls /dev/v4l/by-id/
-
You should see an entry like
usb-Sunplus_IT_Co_FHD_Camera-video-index0
(or a similar name depending on your camera model).
Now that crownsnest is installed, you'll need to configure it to use your camera.
-
Go to Mainsail and open the
crowsnest.conf
in your MACHINE section. -
Edit the configuration file by adding the camera settings.
Replace device with the correct path of your camera (e.g., /dev/v4l/by-id/usb-Sunplus_IT_Co_FHD_Camera-video-index0).
Adjust the resolution and max_fps values to match your camera's capabilities.
A little try&error will help finding the best resolution and aspect ratio for your taste.Here's an example configuration:
[crowsnest] log_path: /home/mks/printer_data/logs/crowsnest.log log_level: verbose # Valid Options are quiet/verbose/debug delete_log: true # Deletes log on every restart, if set to true no_proxy: false # Set to true if no proxy is required [cam 1] mode: ustreamer # ustreamer provides mjpg and snapshots. (Works with all devices) # camera-streamer is for RPi + Raspi OS based cameras only. enable_rtsp: false # Enable rtsp server (only if camera-streamer is used) rtsp_port: 8554 # Port for RTSP streaming port: 8080 # HTTP/MJPG stream/snapshot port # Example for a Sunplus webcam: device: /dev/v4l/by-id/usb-Sunplus_IT_Co_FHD_Camera-video-index0 resolution: 800x600 max_fps: 5
-
Click save and restart on the top.
If you setup everything correct and cant see the camera picture, open the Mainsail settings
scroll down to WEBCAMS and click on ADD WEBCAM