I probably would have left everything where it was if I had not need to move to get the rc.local file to work. I did work that way, but I wanted to get the service to work so I commented out everything in rc.local and made the changes above and then reloaded the service. Works like I wanted it to now.
Thanks for that suggestion on how to specify the correct video device.
I added the ability to stop and start the webcam server through the Octorprint system menu but when I try the buttons I get this error for either button:
Error
The command "Stop video stream" could not be executed.
{"error":"Command for custom:streamoff failed: 500 Internal Server Error: Command for custom:streamoff failed with return code 1:\n\nSTDOUT:\n\n\nSTDERR:\nsudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper\n"}
When you run whatever command you configured through the terminal, it probably asks you for a password, which is not possible to do through OctoPrint running the command for you. You'll need to add an exemption for the command you want to run to the sudoers configuration, similar to how this guide shows it for the shutdown commands:
i see that the ExecStart thing is supposed to refer to /OctoPrint/venv/bin/octoprint but when I go to the .../venv/bin directory and do ls --all --classify I don't see any octoprint directory, so I did mkdir octoprint but I'm not sure what's supposed to go there lol
If anyone is looking for information about running OctoPrint with libcamera / Rasberry Pi Camera Module 3 as a webcam, I uploaded my setup instructions & scripts to GitHub
Just dropping a note of thanks for the devs and @foosel. I followed the guide and successfully set up OctoPrint on a 2012 Mac Mini running Ubuntu 22.04. Cheers!
The usb camera input file name does not always match /dev/video0 or /dev/video1. But it is possible to find out the device name using the v4l2-ctl utility, which can be installed with the apt install v4l2-ctl command. Once installed, you can query the list of video I/O devices using the v4l2-ctl --list-devices command. It will give you a list like this:
In my case, in this list, I'm interested in a USB2.0 device that can be accessed through the file /dev/video6. I modified the webcamDaemon script a bit, adding to it requesting the webcam input file name:
# gets camera device name from v4l2-ctl output (search for USB devices in list and use first found)
camera_usb_device=$(v4l2-ctl --list-devices | grep "USB" -A 1 | tail -n 1 | sed -e 's/^[ \t]*//')
camera_usb_options="-r 640x480 -f 10 -d $camera_usb_device"
And also replace usb camera device existance check from: if [ -e "/dev/video0" ] to if [ -e "$camera_usb_device" ].
After reconnecting the USB camera, the file name changes and I just need to restart the webcamd service to restart streaming.
Hi. I have followed your guide and I'm not able to get the stream to function. I have moved the 2 files into their respective places after installing OctoPrint and did NOT use HAProxy. When I text my camera in a different OS it works fine and I can get a picture using libcamera-hello so I know it's not the camera. Any advice?
Using Pi4 4GB
Rasp Pi cam V3
Rasp Pi OS 32 bit lite (on PINN)
Thank you
Ruhel™
Thank you for your very detailed and thorough explanation on how to install and run this app but I have no idea what you are saying. Can this app run on a chromebook and is it worth looking at if I have zero experience in programming and networking etc?
Ich kann leider kein gutes English und hoffe das man mir hier auch auf Deutsch helfen kann.
Meine Systemvoraussetzung ist ein Proxmox Server mit Debian 11 Bulseye, unter eine entsprechendem Debian VM.
Ich habe diese Anleitung schritt für schritt genaustens verfolg und eingegeben. Es hat auch soweit alles geklappt Octoprint läuft aber nur zum Teil als erstes der Drucker wird erkannt und kann ihn steuern die Webcam wir erkannt aber ich kann nur ein Snapshot machen und leider keinen Stream und ich kann Plugins weder über Respository noch über Download installieren. Es bricht mit folgendem Log ab.
*Installiere Plugin "Octolapse" von https://github.com/FormerLurker/Octolapse/archive/master.zip...
/home/pi/OctoPrint/venv/bin/python3 -m pip --disable-pip-version-check install file:///tmp/tmpjl37nyvw/Octolapse-master.zip --no-cache-dir
Processing /tmp/tmpjl37nyvw/Octolapse-master.zip
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
likely tags: v0.4.2
picking v0.4.2
got version from expanded keyword {'version': 'v0.4.2', 'full-revisionid': 'c6c86782cdbfc3590fa4b1bf2e63064eb459b16b', 'dirty': False, 'error': None, 'date': '2023-04-02T10:23:21-0500'}
Traceback (most recent call last):
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(*hook_input['kwargs'])
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-o49s97rt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-o49s97rt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-o49s97rt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 484, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-o49s97rt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "", line 57, in
ModuleNotFoundError: No module named 'octoprint'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Fehler!
Could not parse output from pip, see plugin_pluginmanager_console.log for generated output
Nur nochmal zu Sicherheit, du hast schon das "oprint" pip für "pip install whee"l verwendet und nicht das vom OS, oder? Hatte letztens ein ziemlich ähnliches Problem. Konnte octoklipper über das entpackte Package und setup.py installieren, aber nicht über den package manager und auch nicht mit pip. siehe Setuptools error while installing plugin (octoklipper) on manual OP installation
Everything was going well until HAProxy. I'm totally lost now.
Perhaps I am trying to do something that is not possible.
I purchased a BTT Pad7 that includes a CB1 (Pi substitute). and a 7" touch screen. It's shipped with Klipper installed. I am underwhelmed by Klipper and figured I would try to use the hardware to run Octoprint so I could use it with my Marlin printer. It would be convenient to since the touchscreen and fake Pi are in a nice compact package.
Hopefully someone a lot smarter than me will figure it out and make a video.
I have worked through this setup on a BTT Pi v1.2 without much trouble, but a couple of the command line bits puzzle me. I was thinking about doing some edits to help sort out the puzzles, but I thought I'd check to see if I've made the correct assumptions:
Under Optional: Webcam I found this:
I guessed that what was intended was this:
export LD_LIBRARY_PATH=`pwd`
If I'm in the ballpark, let me know, and I'll proceed with the edits. There are also a couple of other path items, and a clarification, but this is the tricky one.
By the way, it's working fantastically well. Great little board for Octoprint.