Webcam does not work automatically

Hi, I connected an USB cheap Web Cam to FreeBsd 12.2. It works without issues when I run sudo webcamd -d ugen0.2, now I would like it to start automatically without having to execute that command every time I need to use it.

Here's my /etc/rc.conf:

Code:
hostname="ws1.local.domain"
ifconfig_re0="inet 192.168.100.111 netmask 0xffffff00"
defaultrouter="192.168.100.1"
sshd_enable="YES"
kld_list="linux vmm nmdm nvidia nvidia-modeset fuse"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
dbus_enable="YES"
linux_load="YES"
vmm_load="YES"
nmdm_load="YES"
iohyve_enable="YES"
slim_enable="YES"
vboxnet_enable="YES"
vm_enable="YES"
vm_dir="zfs:datos/vms"
vm_list=""
vm_delay="5"
cloned_interfaces="bridge0 tap0 tap1 lo1"
ifconfig_bridge0="addm re0 addm tap0 addm tap1 addm lo1"
gateway_enable="YES"
pf_enable="yes"
pf_rules="/etc/pf.conf"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
jupyter_enable="YES"
iocage_enable="YES"
jail_enable="YES"
jail_list="jupyterlab honeypot"
pflog0_enable="YES"
webcamd_enable="YES"
webcamd_device_0_name="GENERAL GENERAL WEBCAM"
webcamd_flags="-H"

in /boot/loader.conf I have:

Code:
...
cuse_load="YES"

When I run webcamd without parameters I get:

Code:
Available device(s):
Show webcamd usage:
webcamd -h
webcamd 19617 - - webcamd: No USB device match found

If I call it with sudo webcamd:

Code:
Available device(s):
Available device(s):
webcamd [-d ugen0.1] -N 0x1022-XHCI-root-HUB -S unknown -M 0
webcamd [-d ugen1.1] -N 0x1022-XHCI-root-HUB -S unknown -M 1
webcamd [-d ugen0.2] -N GENERAL-GENERAL-WEBCAM -S JH0319-20200710-v012 -M 0
webcamd [-d ugen0.3] -N ITE-Tech--Inc--ITE-Device-8595 -S unknown -M 0
webcamd [-d ugen0.4] -N Genius-Wireless-Device -S unknown -M 0
webcamd [-d ugen0.5] -N 2-4G-wireless-USB-Device-2-4G-wireless-USB-Device -S unknown -M 0
Show webcamd usage:
webcamd -h

My user leonardo is part of the webcamd group:

Code:
[leonardo@ws1 ~] $ groups
leonardo video webcamd vboxusers sudo

So, the webcam works without issues when I start webcamd with sudo webcamd -d ugen0.2, even I can use Zoom or Google Meet from my Firefox, but as I mentioned at the beginning of this post, I would like to avoid that command every time I need to use it.
 
Ownership off the /dev/usb/0.2.0 (where /dev/ugen0.2 points to) device are typically root:operator and the permissions are set so only root can read/write to it. You'll need to change those permissions and add yourself to the operator group. But as this is a dynamic device you will have to set those permissions each time you plug in the device. You can set those permissions automatically with devfs.conf(5) but if you have some other device plugged in as well the device number might change to /dev/ugen0.3 or /dev/ugen0.4, etc.
 
Uhmm, in my case the owner is root:wheel, see:

Code:
[leonardo@ws1 ~] $ sudo ls -lah /dev/ugen*
lrwxr-xr-x  1 root  wheel     9B  3 feb.  20:48 /dev/ugen0.1 -> usb/0.1.0
lrwxr-xr-x  1 root  wheel     9B  3 feb.  20:48 /dev/ugen0.2 -> usb/0.2.0
lrwxr-xr-x  1 root  wheel     9B  3 feb.  20:48 /dev/ugen0.3 -> usb/0.3.0
lrwxr-xr-x  1 root  wheel     9B  3 feb.  20:48 /dev/ugen0.4 -> usb/0.4.0
lrwxr-xr-x  1 root  wheel     9B  3 feb.  20:48 /dev/ugen0.5 -> usb/0.5.0
lrwxr-xr-x  1 root  wheel     9B  3 feb.  20:48 /dev/ugen1.1 -> usb/1.1.0

But I found the /dev/cuse device is owned by root:operator.

If I run sudo pw groupmod operator -m leonardo my user is not added to the operator group, as you can see:

Code:
leonardo video webcamd vboxusers sudo
 
Back
Top