Logitec C270 fails, permission problem



Webcam worked once, but the next day, no joy. After much digging and troubleshooting, I looked at the streamers log file and found the problem. However, I'm not sure of the fix. The Pi user is a member of the video group, so that's not it. Tail of the log file follows.

pi@octopi:/var/log $ tail webcamd.log
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 1280x720 -f 30
MJPG Streamer Version.: 2.0
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1280 x 720
i: Frames Per Second.: 30
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
ERROR opening V4L interface: Permission denied
Init v4L2 failed !! exit fatal
i: init_VideoIn failed


Strangely, it just started working again and the error is no longer appearing in the log. Nothing was done, no updates or anything, it just started working the next day.
Oh well. A Mystery.


Did you reboot in the meantime?


On the day it wasn't working, I rebooted at least three times with no success.


Really odd. I run this webcam myself and have never seen this :thinking:


I put this at the end of my /etc/init.d/octoprint

nohup /home/user1/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -i "/home/user1/mjpg-streamer/mjpg-streamer-experimental/input_uvc.so -y -br auto -cb auto -wb auto -gain auto -q 100 -r XGA" -o "/home/user1/mjpg-streamer/mjpg-streamer-experimental/output_http.so" &

But I have a non standard build...


Has anyone else seen this and resolved it directly? I'm trying to use this camera on my Ubuntu server. Any attempt to start mjpg streamer fails with permission denied whether I'm trying to run it as myself or as root (via sudo). I asked on the Ubuntu forums and got no reply. A permission denied error for the root user suggests something very wrong, but I'm not sure what to do at this point.

I should add... If this camera isn't going to work for my Octoprint setup, I may return it and try to find something else that does work. If anyone has suggestions, I'd appreciate them.



This one turned out to be a misunderstanding of how "snaps" function in Ubuntu. I was using a snap of mjpg-streamer on Ubuntu. Today I found these instructions: https://snapcraft.io/mjpg-streamer that documented how to set up the permissions for the snap to access the camera.


You didn't mention anything about Snaps + Ubuntu (Core) earlier. We all have to assume the absence of that version otherwise.


You are correct. That was my mistake in not realizing that snaps behave differently.