geerlingguy / geerlingguy/3d-printing

Get Camera Module 3 working on Pi 5 with OctoPrint

Open
#9 12 comments 0 reactions 0 assignees View on GitHub
ender-3-s1 prusa-mk4
Dominant language
No language data
Stars
79
Forks
4
PR merge metrics
No merged PRs in 30d

Description

I'm setting up a new Pi 5 with OctoPrint—well, hopefully—but I've run into a snag. I have a Camera Module 3 attached, but the latest nightly (6-7-2024) image build isn't working out of the box.

I started debugging over in this issue: https://github.com/guysoft/OctoPi/issues/823#issuecomment-2155646805

But rather than use that issue for rubber-duck-debugging, I'll use this issue to not pollute the OctoPi repo further, until I have more to report.

To debug, I just set up a brand new Pi 5 with a brand new Pi OS Bookworm 64-bit Lite install.

I ran apt update/upgrade, and installed the libcamera-apps suite: `sudo apt install libcamera-apps -y`. I rebooted, and verified I could see the camera:

```
pi@pistream:~ $ libcamera-still --list-cameras
Available cameras
-----------------
0 : imx708 [4608x2592 10-bit RGGB] (/base/axi/pcie@120000/rp1/i2c@88000/imx708@1a)
Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]
```

Then I tried using `go2rtc` to stream to my browser:

```
wget https://github.com/AlexxIT/go2rtc/releases/download/v1.9.3/go2rtc_linux_arm64
chmod +x go2rtc_linux_arm64

---

# Put the following inside go2rtc.yaml
streams:
picam_h264: exec:rpicam-vid -t 0 --codec h264 -o -
picam_mjpeg: exec:rpicam-vid -t 0 --codec mjpeg -o -

---

# Then run go2rtc:
./go2rtc_linux_arm64
```

In the browser, I opened http://10.0.2.204:1984 and opened one of the two streams. I end up with a window like:

Screenshot 2024-06-07 at 6 31 28 PM

or for mjpeg:

Screenshot 2024-06-07 at 6 31 42 PM

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the setup on a Pi 5 with a Camera Module 3 using the latest nightly image, Pi OS Bookworm 64-bit Lite, and the listed libcamera-apps and go2rtc commands. Compare the browser results for the H.264 and MJPEG streams; the work is done when the camera streams work out of the box with OctoPrint.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, raspberry-pi
Domain
audio-video-rtc, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.