paukstelis / octoprint_deploy

Bash script for rapid deployment of multiple octoprint instance on a single machine
MIT License
390 stars 39 forks source link

Raspberry Pi v2 Camera #92

Open OneScuzzie2k opened 1 year ago

OneScuzzie2k commented 1 year ago

Any instruction to get the Raspberry Pi v2 Camera working, i have added camera="raspi" into the octopi.txt but still not working.

paukstelis commented 1 year ago

Once you use octoprint_deploy, a whole different camera setup is used. octopi.txt no longer has any influence. You need to run the script using the picam argument. https://github.com/paukstelis/octoprint_deploy/wiki/Command-line-arguments#picam Keep in mind, as the instructions say, this may not work with the most recent version of OctoPi. I have not been able to verify how Pi cameras are described in the latest version.

OneScuzzie2k commented 1 year ago

Thanks will give it a go.

OneScuzzie2k commented 1 year ago

Didnt work for me :(

paukstelis commented 1 year ago

try this: sudo sed -i s/camera0/video0/ /etc/udev/rules.d/99-octoprint.rules then sudo udevadm control --reload-rules; sudo udevadm trigger

OneScuzzie2k commented 1 year ago

try this: sudo sed -i s/camera0/video0/ /etc/udev/rules.d/99-octoprint.rules then sudo udevadm control --reload-rules; sudo udevadm trigger

I am afraid no Joy with this either

paukstelis commented 1 year ago

what do you have with cat /etc/udev/rules.d/99-octoprint.rules? and ls -la /dev/cam*

OneScuzzie2k commented 1 year ago

cat /etc/udev/rules.d/99-octoprint.rules KERNELS=="1-1.4:1.0",SUBSYSTEM=="tty",SYMLINK+="octo_Creality" KERNELS=="1-1.3:1.0",SUBSYSTEM=="tty",SYMLINK+="octo_Spark3D"

ls -la /dev/cam ls: cannot access '/dev/cam': No such file or directory

paukstelis commented 1 year ago

No cameras have been setup yet. There is no way that it can work without going through those steps.

OneScuzzie2k commented 1 year ago

pi@octopi:~ $ cat /etc/udev/rules.d/99-octoprint.rules KERNELS=="1-1.4:1.0",SUBSYSTEM=="tty",SYMLINK+="octo_Creality" KERNELS=="1-1.3:1.0",SUBSYSTEM=="tty",SYMLINK+="octo_Spark3D" SUBSYSTEM=="video4linux", ATTRS{name}=="camera0", SYMLINK+="cam_Spark3D" pi@octopi:~ $ ls -la /dev/cam* lrwxrwxrwx 1 root root 6 Jun 12 18:41 /dev/cam_Spark3D -> video0

Still not working I am afriad

paukstelis commented 1 year ago

sudo systemctl status cam_Spark3D

OneScuzzie2k commented 1 year ago

sudo systemctl status cam_Spark3D -bash: pi@octopi:~: command not found -bash: ATTRS{name}==camera0,: command not found -bash: pi@octopi:~: command not found -bash: lrwxrwxrwx: command not found -bash: pi@octopi:~: command not found ● cam_Spark3D.service - the OctoPi(buntu) webcam daemon with the user specified> Loaded: loaded (/etc/systemd/system/cam_Spark3D.service; enabled; vendor p> Active: failed (Result: exit-code) since Mon 2023-06-12 18:41:47 BST; 7min> Main PID: 2509 (code=exited, status=1/FAILURE) CPU: 11ms

Jun 12 18:41:47 octopi mjpg_streamer[2509]: i: TV-Norm...........: DEFAULT Jun 12 18:41:47 octopi mjpg_streamer[2509]: i: init_VideoIn failed Jun 12 18:41:47 octopi mjpg_streamer[2509]: MJPG-streamer [2509]: Using V4L2 de> Jun 12 18:41:47 octopi mjpg_streamer[2509]: MJPG-streamer [2509]: Desired Resol> Jun 12 18:41:47 octopi mjpg_streamer[2509]: MJPG-streamer [2509]: Frames Per Se> Jun 12 18:41:47 octopi systemd[1]: cam_Spark3D.service: Main process exited, co> Jun 12 18:41:47 octopi mjpg_streamer[2509]: MJPG-streamer [2509]: Format.......> Jun 12 18:41:47 octopi systemd[1]: cam_Spark3D.service: Failed with result 'exi> Jun 12 18:41:47 octopi mjpg_streamer[2509]: MJPG-streamer [2509]: TV-Norm......> Jun 12 18:41:47 octopi mjpg_streamer[2509]: MJPG-streamer [2509]: init_VideoIn >

paukstelis commented 1 year ago

It is obviously not starting, but not clear why. Try this and paste output: sudo systemctl restart cam_Spark3D; sudo systemctl status cam_Spark3D -l --no-pager

OneScuzzie2k commented 1 year ago

Ahh ha thats done it thanks :) any reason why it wouldnt auto start?

paukstelis commented 1 year ago

Probably only because mjpg-streamer is terrible.

OneScuzzie2k commented 1 year ago

OK thanks can I change that?

OneScuzzie2k commented 1 year ago

Did a fresh install used ustreamer, now I cannot get a image at all I should just leave things.

pi@octopi:~ $ cat /etc/udev/rules.d/99-octoprint.rules KERNELS=="1-1.4:1.0",SUBSYSTEM=="tty",SYMLINK+="octo_Creality" SUBSYSTEM=="video4linux", ATTRS{name}=="video0", SYMLINK+="cam_Creality"

I have created the camera in sudo octoprint_deploy/octoprint_deploy.sh picam

But when I run the below I get cannot access the device. ls -la /dev/cam ls: cannot access '/dev/cam': No such file or directory

OneScuzzie2k commented 1 year ago

I have sorted it had to manually create a symbolic link sudo ln -s /dev/video0 /dev/cam_Creality