Re: udev rules for webcam

2014-11-07 Thread Fred Smith
On Fri, Nov 07, 2014 at 03:20:20PM -0500, Kevin Cummings wrote:
> On 11/06/2014 06:53 PM, Tom Horsley wrote:
> > On Thu, 6 Nov 2014 18:47:23 -0500
> > Fred Smith wrote:
> > 
> >> not finding anything on that, I hit on writing a udev rule for the
> >> USB device to make sure it appeared as a predictable /dev/video.
> 
> Did you try looking in /dev/v4l?  My laptop builtin webcam leaves
> entries in there.  The v4l directory has 2 sub-directories: by-id and
> by-path which contain entries for my webcam.

Hi Kev!

Yes, late yesterday I learned enough about udev to find the files
there, so I've modified my script to use those files to figure out
which /dev entry is the webcam I'm interested in. I suppose I could
use those files directly, too, and save a bit of computation.

an excerpt from the script that operates the camera:

  # figure out which /dev/video entry is the camera we want.
  foo=`ls -l --dereference-command-line-symlink-to-dir 
/dev/v4l/by-id/usb-046d_0825*`
  devnode=`echo $foo | sed -e "s;^.*> \.\./\.\./;;"`
  # then snap it
  ${progdir}/fswebcam --png 9 -d /dev/${devnode} -r 800x600 -F 2 --save 
${day}/img-%Y%m%d-%H%M%S.png


-- 
 Fred Smith -- fre...@fcshome.stoneham.ma.us -
The Lord detests the way of the wicked 
  but he loves those who pursue righteousness.
- Proverbs 15:9 (niv) -
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: udev rules for webcam

2014-11-07 Thread Kevin Cummings
On 11/06/2014 06:53 PM, Tom Horsley wrote:
> On Thu, 6 Nov 2014 18:47:23 -0500
> Fred Smith wrote:
> 
>> not finding anything on that, I hit on writing a udev rule for the
>> USB device to make sure it appeared as a predictable /dev/video.

Did you try looking in /dev/v4l?  My laptop builtin webcam leaves
entries in there.  The v4l directory has 2 sub-directories: by-id and
by-path which contain entries for my webcam.

> I did something similar to recognize my 3D printer when I plug it
> in, and it was quite challenging to make all my code work
> because systemd runs things in magic "cgroups" that get killed
> quickly and have limited permissions. I eventually got all the
> complex stuff I wanted to do working. The full story is here:
> 
> http://home.comcast.net/~tomhorsley/hardware/solidoodle/solidoodle-udev.html
> 

-- 
Kevin J. Cummings
kjch...@verizon.net
cummi...@kjchome.homeip.net
cummi...@kjc386.framingham.ma.us
Registered Linux User #1232 (http://www.linuxcounter.net/)
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: udev rules for webcam

2014-11-06 Thread Tom Horsley
On Thu, 6 Nov 2014 18:47:23 -0500
Fred Smith wrote:

> not finding anything on that, I hit on writing a udev rule for the
> USB device to make sure it appeared as a predictable /dev/video.

I did something similar to recognize my 3D printer when I plug it
in, and it was quite challenging to make all my code work
because systemd runs things in magic "cgroups" that get killed
quickly and have limited permissions. I eventually got all the
complex stuff I wanted to do working. The full story is here:

http://home.comcast.net/~tomhorsley/hardware/solidoodle/solidoodle-udev.html
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org