guysoft / OctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web
GNU General Public License v3.0
2.49k stars 369 forks source link

Debian 12 Bookworm / Raspberry Pi 5 support #823

Closed guysoft closed 1 week ago

guysoft commented 1 year ago

Hey, I haven't had the time to test the nighties with bookworm - has anyone happen to test it?

Also I have no Raspberry Pi 5 to test since they did not arrive to my county. If anyone could update on that it would help too.

idaband commented 1 year ago

will test the nightly this weekend. I'll let you know if you haven't already figured it out

NewsGuyTor commented 11 months ago

will test the nightly this weekend. I'll let you know if you haven't already figured it out

Any updates? Anyone?

idaband commented 11 months ago

Didn't work.

Been having heck of time with bookworm and pi 5.

Still don't have working arducam with camera-streamer too ( different issue) but would still want to use that on the pi 5.

InsaneNemesis commented 11 months ago

I am running 2023-12-05_2023-10-10-octopi-bookworm-arm64-lite-1.1.0.zip on my Pi 5. Seems to be fairly stable. Only issue i am having is i cant get the camera resolution to change. It seems to be stuck on 640x480.

idaband commented 11 months ago

Are you using the new streaming service too?

kristofferR commented 11 months ago

I am running 2023-12-05_2023-10-10-octopi-bookworm-arm64-lite-1.1.0.zip on my Pi 5. Seems to be fairly stable. Only issue i am having is i cant get the camera resolution to change. It seems to be stuck on 640x480.

Same issue here. Using the default streaming service.

adam5zki commented 11 months ago

I am trying to get a OV5647 wide angle camera to work on a Pi5 with the Octopi Nightly 20.12. Does not even list the camera. 64bit bookworm lite did show the camera, but I could not figure out how to stream it - neither ustreamer nor camera-streamer seemed to work (at least not in a way I could figure out). Since I used octo-deploy there, it felt like the whole thing was funny, so I switched over to the nightly. USB camera works like a charm, except I would prefer the OV5647 with the wider FOV. Not sure what I am doing differently :/

kristofferR commented 11 months ago

I am running 2023-12-05_2023-10-10-octopi-bookworm-arm64-lite-1.1.0.zip on my Pi 5. Seems to be fairly stable. Only issue i am having is i cant get the camera resolution to change. It seems to be stuck on 640x480.

Fixed it. Octopi.txt isn't active at all, it's not linked properly.

Login to the pi on ssh, then

sudo ln -s /boot/firmware/octopi.txt /boot/octopi.txt ; sudo reboot

InsaneNemesis commented 11 months ago

I am running 2023-12-05_2023-10-10-octopi-bookworm-arm64-lite-1.1.0.zip on my Pi 5. Seems to be fairly stable. Only issue i am having is i cant get the camera resolution to change. It seems to be stuck on 640x480.

Fixed it. Octopi.txt isn't active at all, it's not linked properly.

Login to the pi on ssh, then

sudo ln -s /boot/firmware/octopi.txt /boot/octopi.txt ; sudo reboot

This does fix the camera resolution issue for me. Im able to run 1280x720 at 20fps. Testing other resolutions now.

guysoft commented 10 months ago

Ok got to add that, there is a similar issue in FullPageOS with /boot moving to /boot/firmware: https://github.com/guysoft/FullPageOS/issues/497#issuecomment-1889748179

apbarratt commented 10 months ago

Joining the thread. I had to commandeer my Pi4 for another project so bought a Pi5 8GB for OctoPi (figured dual cameras could be nice). I'm about to download the 64bit nightly for 2024-01-15 21:52, will keep you posted how I get on. I'm still awaiting long camera cables for the smaller fitting, so I won't have news on that front immediately I'm afraid.

apbarratt commented 10 months ago

It seems to be working well for me so far and restored from my backup perfectly. I'll try and test cameras tomorrow.

One thing I am noticing is that the install desktop script does not appear to have been updated in seven years. https://github.com/guysoft/OctoPi/blob/devel/src/modules/octopi/filesystem/home/pi/scripts/install-desktop

I'm quite certain I read when Pi OS bookworm was announced that there's been some fairly heavy work done in the desktop environment. I do wonder if this install-desktop will need to be revisited to bring it up to spec with whatever PiOS is providing out of the box these day.

apbarratt commented 10 months ago

New ribbon cables for cameras arrives last night so testing today.

@guysoft Is there anything in particular you're needing tested? I see above the editing of the octopi.txt file for camera settings will be one thing to check. Anything else?

On inspection of that install-desktop script, it looks like it's fairly universal for getting whatever Pi has released so you can likely ignore me on the notion that it might need updating :)

apbarratt commented 10 months ago

hmmm, I'm having no luck getting the camera to show up.

pi@octopi:~ $ libcamera-hello --list-cameras
No cameras available!

I have one of these night vision 160° cameras with the OV thingy at the start of its sensor name. I see @adam5zki is reporting a similar experience :/

Will quickly try the second port, but not looking good so far...

61aBgvFM6hL _AC_SL1001_

apbarratt commented 10 months ago

Confirmed no different on the second camera port. Not that I really expected it to make a difference :/

apbarratt commented 10 months ago

Okay, I used sudo nano /boot/config.txt and changed camera_auto_detect=0 to camera_auto_detect=1 and rebooted. Still no stream however:

pi@octopi:~ $ libcamera-hello --list-cameras
Available cameras
-----------------
0 : ov5647 [2592x1944 10-bit GBRG] (/base/axi/pcie@120000/rp1/i2c@80000/ov5647@36)
    Modes: 'SGBRG10_CSI2P' : 640x480 [58.92 fps - (16, 0)/2560x1920 crop]
                             1296x972 [43.25 fps - (0, 0)/2592x1944 crop]
                             1920x1080 [30.62 fps - (348, 434)/1928x1080 crop]
                             2592x1944 [15.63 fps - (0, 0)/2592x1944 crop]
apbarratt commented 10 months ago

Does the nightly come with the new camera stack? I see in the downloads folder there were extra files involving imaging. Perhaps I am meant to be doing something with those?

Screenshot 2024-01-19 at 13 05 28
apbarratt commented 10 months ago

Hmmm, no, that ffmpeg seems to match what's already in the nightly.

apbarratt commented 10 months ago

Hmmm, running libcamera-jpeg -o test.jpg confirms that the camera is in fact working (after I've added that camera_auto_detect=1, which I note is enabled by default on stock PiOS). It's just not showing up in Octoprint and visiting http://octopi.local/webcam/?action=stream is presenting me with a The webcam server is currently not running page, with instructions on rebooting/switching to USB camera. I'd thought once I got the auto-detect working it'd resolve but it seems not. Most odd.

Here's the output of sudo systemctl status webcamd.service

● webcamd.service - the OctoPi webcam daemon with the user specified config
     Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-01-19 16:03:28 GMT; 5h 1min ago
   Main PID: 750 (webcamd)
      Tasks: 2 (limit: 9262)
        CPU: 4.670s
     CGroup: /system.slice/webcamd.service
             ├─ 750 /bin/bash /root/bin/webcamd
             └─5363 sleep 120

Jan 19 21:02:00 octopi mjpg_streamer[5329]: MJPG-streamer [5329]: TV-Norm...........: DEFAULT
Jan 19 21:02:00 octopi mjpg_streamer[5329]: MJPG-streamer [5329]: init_VideoIn failed
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: starting application
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: MJPG Streamer Version.: 2.0
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: Using V4L2 device.: /dev/video0
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: Desired Resolution: 640 x 480
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: Frames Per Second.: 10
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: Format............: JPEG
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: TV-Norm...........: DEFAULT
Jan 19 21:04:01 octopi mjpg_streamer[5360]: MJPG-streamer [5360]: init_VideoIn failed

Though with this being MJPG stuff, I'm a little confused as to where the new camera stack stuff is hiding or if it's even installed :/

apbarratt commented 10 months ago

Okay, I've finally found some brief mention in another ticket that the nightlies do not include camera-streamer, though where they saw that written I've no idea. So perhaps I'm just wasting my time. Perhaps this was the wrong thread, it'd be nice to be told by someone if I am in the wrong place or if I'm just shouting into the wind :(

3driffs commented 10 months ago

It seems to be working well for me so far and restored from my backup perfectly. I'll try and test cameras tomorrow.

One thing I am noticing is that the install desktop script does not appear to have been updated in seven years. https://github.com/guysoft/OctoPi/blob/devel/src/modules/octopi/filesystem/home/pi/scripts/install-desktop

I'm quite certain I read when Pi OS bookworm was announced that there's been some fairly heavy work done in the desktop environment. I do wonder if this install-desktop will need to be revisited to bring it up to spec with whatever PiOS is providing out of the box these day.

Looks like the answer is yes, tried the desktop install on the last nightly and after a reboot, system hangs with a rapid blinking cursor in upper left of the screen. left it for hours, and no change, so something's definitely broken.

On the bright side, before the desktop install, the nightly 'just worked' with the USB webcam.

3driffs commented 10 months ago

In case others want to install the desktop, here's what worked for me:

Install the latest nightly of octopi sudo tasksel Select the default desktop (top option) sudo apt install raspberrypi-ui-mods raspi-config Change it to launch desktop with password reboot

And then you have a desktop running on pi 5/bookworm. Note that RealVNC isn't supported, and TigerVNC has issues.

tsh-xx commented 9 months ago

I didn't plan to be on the cutting edge, but I bought a Pi5 and it needs to be running octoprint for now.

I tired 2024-01-16_2023-12-11-octopi-bookworm-arm64-lite-1.1.0.zip but this complains about needing os_check==0, and not having the right dtb. I satisfied these two, and I get a blank screen. What am I doing wrong?

guysoft commented 9 months ago

It might be that Rpi changed the device tree because they sourced different components for different Rpi 5 builds. I just saw the nightly is broken, will fix that and you can try it.

3driffs commented 9 months ago

Just an update - Had one hard crash in the middle of a print, rebooted and it's been stable. But while octoprint is still working, the desktop is non-responsive. Definitely bleeding edge here :-)

guysoft commented 9 months ago

@3driffs People are reporting the nightly is working for them (though I didn't test it, this weekend was FullPagOS, will try another weekend to test OctoPi and prepare an RC)

3driffs commented 9 months ago

Octoprint works- it’s the desktop that froze. Have you updated the desktop install script that I missed?

guysoft commented 9 months ago

I didn't update. If anyone has the time to figure out what needs to go there it would help me a lot! I don't really use that script and not sure what to expect. And rather focus on OctoPrint working.

apbarratt commented 9 months ago

A fair comment that 😄

doucettom commented 8 months ago

Are the 64bits nightlies coming with the new camera stack ? TIA

guysoft commented 8 months ago

@foosel AFAIK you are enforcing 32bit kernel on OctoPi-UpToDate. Where is the new camera stack image built? I could move it in to OctoPi's nightlies.

foosel commented 8 months ago

I'm not sure you really want to move that into the nightlies. First of all I first need to swap the apt key (and that looks like it's harder than I thought at first, which is why I didn't manage to do it before my surgery last week from which I'm still recovering), there's still a stability issue with the camera-streamer server itself for which I'm waiting for feedback from upstream, and all in all I'd prefer to not have that forked at this point because that will make updates & support for me even trickier.

In case you want to look at it however: https://github.com/OctoPrint/OctoPi-UpToDate/tree/camera-streamer

guysoft commented 8 months ago

Thanks for the info and hope you have a speedy recovery!

cp2004 commented 8 months ago

There is also the slightly added complication that the RPi 5 does not have the hardware encoder that camera-streamer was designed for - I am not sure what would happen if you tried to build it targeting the HW encoder and then ran that on a Pi 5. Maybe it would just work, I don't know. Adds another nice dimension to upgrading camera streaming setup in general.

lpla commented 7 months ago

ustreamer project seems to be more mature than camera-streamer in this aspect: https://github.com/pikvm/ustreamer/issues/248

blair287 commented 6 months ago

Nighties just seem broken for me installed several different ones all boot connect to wifi but octoprint server never starts

Pi 5 been out for a year how is it so badly supported is the pi4 and 3 still even in production I see they are out of stock lots of places.

guysoft commented 6 months ago

@blair287 Are you using the nightly from rpi imager? Where from? The nighties should work.

guysoft commented 5 months ago

Related, wpa-supplicant option does not work anymore https://github.com/guysoft/CustomPiOS/issues/219

geerlingguy commented 5 months ago

@guysoft - I just installed the nightly on my Pi 5 (64 bit lite), 2024-06-07_2024-03-15-octopi-bookworm-arm64-lite-1.1.0.zip from http://unofficialpi.org/Distros/OctoPi/nightly-arm64/ — it wasn't entirely clear from reading this thread, but it sounds like the Pi camera streaming functionality might not be working in this image quite yet? (At least on Pi 5.)

Right now would running something like go2rtc be the best bet to pass through the Pi camera as a 'standard webcam' locally?

To set that up, I tried following (mostly) this guide:

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

But when I visit http://PI_IP_HERE:1984/ and try one of the streams, I get an error:

Screenshot 2024-06-07 at 5 43 57 PM

So should I take this up with the go2rtc project's issue queue, or are you working on a different method of supporting the Pi camera on the Bookworm/64-bit/Pi 5? I would be happy to help a bit, would be nice to get it working out of the box!

geerlingguy commented 5 months ago

Sorry for the rubber-ducking, but I found out the image has libcamera-apps-lite installed, not the full suite of libcamera-apps. So I installed with:

sudo apt install libcamera-apps -y

And now it gets further... but I wind up seeing 'Unable to set controls: Device or resource busy', so I think something else is broken here. Maybe something in the image is still trying to grab the camera so go2rtc can't use it?

I tried killing webcamd.service with sudo systemctl stop webcamd.service, and then tried go2rtc again, but still get other errors and nothing really seems to help.

It looks like there are a couple alternatives like picamera2-WebUI-Lite or raspi-cam-srv, but I might for the short term just set up a camera stream from a separate Pi since I think I can get it working with a base Pi OS install.

guysoft commented 5 months ago

Ill try build with

libcamera-apps

installed and we can test that nightly

jneilliii commented 4 months ago

@geerlingguy ...first and foremost love your videos. curious, did you also disable the ffmpeg_hls service?

I have these notes from when I tested out restreamer in the past, which lists the services I disable.

feel free to jump into OctoPrint discord and get additional help in the support-webcam channel. most people just install pi os lite and then use the octoprint_deploy scripts to install everything.

guysoft commented 4 months ago

Working on a PR that should fix most of the stuff.

You can take a look here, nightly is building this branch: https://github.com/guysoft/OctoPi/pull/834

KruseLuds commented 4 months ago

Noob trying to get Debian running on RPI5. Once you get to a stable version... If I am installing HA will it see "Debian" or "Octopi" (?)

guysoft commented 4 months ago

@KruseLuds What do you mean installing HA?

KruseLuds commented 4 months ago

HA = Home Assistant

guysoft commented 3 months ago

Started working on a wpa-supplicant/networkmanager solution, moving slow but I have a plan. After that is done I think I am ready to release a RC using the beta branch of CustomPiOS v2

guysoft commented 1 week ago

Its working and good enough for now, build uses CustomPiOS v2 now too.