PerH
June 24, 2020, 1:33pm
1
I use a PS EYE camera, and am struggling with that mjpg_streamer freezes up.
I've kinda given up on finding the cause, all google suggestions has been tested other than "buy a better camera"..
If i ssh in and do a "sudo killall mjpg_streamer", it comes back up and stays up for hours.
I tried to make a script called "reset_cam.sh", in order to call it from "After snapshot script" in Octolapse:
#!/bin/bash
sudo killall mjpg_streamer
..which offcourse doesn't work.. How do I make this work?
jandar
June 24, 2020, 8:57pm
2
Have you made it executable?
chmod +x reset_cam.sh
PerH
June 24, 2020, 9:11pm
3
yep, but i think the sudo password is the issue?
from octolapse log:
"sudo: no tty present and no askpass program specified"
^ this
and I'm not sure if this would work without a password.
Test the command in ssh in check if you need it.
This describes how you make sudo commands passwordless
Note
If you disabled Raspbian's default behaviour of allowing the pi
user passwordless sudo for every command, you'll need to explicitly allow the pi
user passwordless sudo access to the /sbin/shutdown
program for the above to work. You'll have to add a sudo
rule by creating a file /etc/sudoers.d/octoprint-shutdown
(as root) with the following contents:
pi ALL=NOPASSWD: /sbin/shutdown
but I'm not sure what you have to put in there for the kill command
edit: might be /bin/killall
jandar
June 24, 2020, 9:24pm
5
which tells what the path of a command is.
pi@octopi:~ $ which killall
/usr/bin/killall
1 Like
PerH
June 24, 2020, 10:00pm
6
Ok, then i have some things to try tomorrow. Thanks!
If someone knows a non-sudo way to reset mjpg streamer, that would be valuable too!
You could add your script to the sudoers file via visudo. That's how I get gphoto2 working for DSLRs without a password. You can also embed the password within your script, though that is probably not a good idea.
1 Like
PerH
June 25, 2020, 6:28pm
8
You can also embed the password within your script, though that is probably not a good idea.
How? I think thats a perfectly fine solution in the mean time, octopi is only visible at LAN, and if someone pokes around in here they can do alot more than fiddling with my printer anyway..