Open Timmmm opened 1 year ago
Please see the discussion on the forums for supporting this camera:
https://community.octoprint.org/t/pi-camera-v3-not-working/49022
The Pi Cam 3 requires the use of libcamera, which mjpg streamer is not compatible with. There are users that have managed to get it working with an alternative streaming software on the forums.
I've written a script based on Dark360's comments on the octoprint forum. It will install everything and reconfigure boot and systemd to use camera-streamer.
# Combining work from octoprint forums:
# https://community.octoprint.org/t/pi-camera-v3-not-working/49022/16
# https://community.octoprint.org/t/add-support-for-raspberry-pi-camera-v3/49052/5
#
# Tested on a clean install of Jan 20, 2023 Nightly build:
# 2023-01-20_2022-09-22-octopi-bullseye-arm64-lite-1.0.0
Nicework @ltlowe! Unfortunately it didn't work for me. Running the camera-streamer
command gives:
output/rtsp/rtsp.cc: ?: Running RTSP server on '8554'
[0:05:07.613951455] [794] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
device/libcamera/device.cc: CAMERA: No available cameras
device/libcamera/device.cc: CAMERA: Camera `/base/soc/i2c0mux/i2c@1/imx708@1a` was not found.
device/device.c: CAMERA: Can't open device: /base/soc/i2c0mux/i2c@1/imx708@1a
I'll probably have to try it with the official distro. :-/
Some minor comments on the script:
set -e
in there.apt-get install
and apt install
separately for some reason?git clone -jN
! That's going to save me some time at work!make -j3
to speed up compilation. Although in fairness it seems like their build system is a bit broken because make install
builds some stuff (maybe rebuilds?) which is not how it is supposed to work.It's too bad it didn't work for you. A few people on octoprint forums seem to be having success, but I admit I haven't tested it thoroughly. I simply pulled together two sets of manual instructions that seemed to work and decided to share to help others. I haven't even set up my github repo properly yet.
There was a problem where the service had a race condition with the driver and would sometimes be skipped. If you're seeing the error at start up, check to see if your service file is using ConditionPathExists
. I've since changed it to use ExecStartPre=/usr/bin/test -e /sys/bus/i2c/drivers/imx708/10-001a/video4linux
instead so systemd will retry.
|Probably want a set -e in there.
Good idea.
|You've got an apt-get install and apt install separately for some reason?
Pulling from multiple sources and not clean yet :-)
TIL about git clone -jN! That's going to save me some time at work!
I got that from one of the original threads, gonna have to use it at my work too :-)
You can do make -j3 to speed up compilation. Although in fairness it seems like their build system is a bit broken because make install builds some stuff (maybe rebuilds?) which is not how it is supposed to work.
I'd try make -j -l $(nproc)
for both and let it use all the cpu, although if install is doing build work, I wouldn't be surprised if the dag isn't proper either.
I'm unfortunately not looking at this for a while as I've had a major failure with my hotend that I need to deal with, but the discussion is continuing at https://community.octoprint.org/t/pi-camera-v3-not-working/49022
The script has been updated and moved to https://raw.githubusercontent.com/ltlowe/misc/main/picam3/cam3install.sh
@ltlowe, man, you are awesome! Struggled with Pi cam v3 streaming and Pi4, applied your script and it works like a charm
I am no longer supporting the picam3 script for installing libcamera and camera-streamer. @foosel is working on an official integration for OctoPi You can get her prerelease(s) and provide feedback at https://github.com/OctoPrint/OctoPi-UpToDate/issues/2
@ltlowe, man, you are awesome! Struggled with Pi cam v3 streaming and Pi4, applied your script and it works like a charm
Thank you @ivaniotchenko I'm glad I could help with an interim solution, but now that official support is underway, please try it from the OctoPi-UpToDate link I posted above.
How's compatibility with the new camera stack going? I saw some changes in this branch of the [OctoPi-UpToDate] (https://github.com/OctoPrint/OctoPi-UpToDate/tree/camera-streamer), but I don't know how upstreamable those changes are to this repository. In fact, I thought that the OctoPi-UpToDate repo was made to only provide updated parts, even beta/RC, of the latest OctoPi image (regarding kernel, bootloader and OctoPrint), not modifying or implementing features.
I had Octopi 0.18.0 running fine with a Pi Camera 2 on a Pi 4B. Camera works (though it is hella laggy due to MJPEG).
I upgraded to a Camera 3 and unfortunately it doesn't work. The
The webcam server is currently not running
page is a very nice touch so here are the logs:Looks like there is a big in
webcamd
(not surprising given that it is Bash...).I think it's failing because it does this:
And can't handle the fact that there is no
PRODUCT
.Actually after further investigation I think maybe it needs a kernel upgrade to get V4L drivers for the new camera? I had similar issues with software support for Raspberry Pi devices for MotionEyeOS. I think maybe it's just a bad idea to have an entire distro dedicate to one application. Might try just running Octoprint on the official image.