/dev/video0 permissions - Raspberry Pi Forums


hello everyone.
called 1 webcam raspberry , have python script calls command fswebcam php exec(); function. can run fswebcam command php not working.

code: select all

<?php echo exec('fswebcam /home/aos/4.jpg'); ?>
how best way enabling /dev/video0 user without having call sudo?

note: added user , apache user video group still need sudo.

code: select all

$  $ grep video /etc/group video:x:44:pi,aos,www-data  $ id aos uid=1001(aos) gid=1002(aos) groups=1002(aos),20(dialout),44(video)  $ id www-data uid=33(www-data) gid=33(www-data) groups=33(www-data),20(dialout),44(video)  
output

code: select all

$ fswebcam img/4.jpg --- opening /dev/video0... trying source module v4l2... error opening device: /dev/video0 open: permission denied trying source module v4l1... error opening device: /dev/video0 open: permission denied unable find source module can read /dev/video0. 

maybe add udev rule such as:

code: select all

subsystem=="video0", group="video", mode="0660"
root, run command create new .rules file:

code: select all

echo 'subsystem=="video0", group="video", mode="0660"' > /etc/udev/rules.d/10-webcam.rules
, reboot


raspberrypi



Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support