FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    May 2008
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Permission to use webcam?

    I have a ZC0301 webcam connected to a USB port. As root, I can use it without any kind of problems, but no user on my machine is able to "detect" the camera.

    Is this a permission problem?
    How can I solve it?

  2. #2
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Solution, but may be dangerous/poor hack. Works with Resume too.

    If you look around, you'll find answer that doesn't work for Fedora10, with eventually a dangerous one about udev rules that could hang your system!

    http://forums.fedoraforum.org/showthread.php?t=211176
    http://forums.fedoraforum.org/showthread.php?t=177859
    http://forums.fedoraforum.org/showthread.php?t=94775
    http://forums.fedoraforum.org/showpo...19&postcount=4

    Since F10 hasn't got 50-udev.rules anymore, and that the solution here:
    http://www.linuxquestions.org/questi...sions.-701934/
    looks the same but Fedora rc.d structure of file isn't standard & you can't just apply the solution to all usbfs sytem,

    I decided to treat the webcam as a complete alien, since that's how Fedora is taking it anyway;
    Solution pumped from here:
    http://forums.nxtasy.org/index.php?s...23&#entry16723

    && simplified here:
    http://wiki.zenerves.net/index.php/Nxt::usb

    It's the recipe to hook the NXT Intelligent Brick from the LEGO MindStorm robotics system to your computer via USB and a special set of rules.
    [FYI: http://mindstorms.lego.com ]

    If I was able to connect to something as utterly unknown to my system, as user, sure I can find there a recipe to hook this freaking webcam, no?

    Follow me, at your own risks: I consider this a poor hack, but it works, including after Suspend/Resume, which was my issue since a simple chmod a+rw /dev/Video0 in the /etc/rc.d/rc.local file was enough to get proper permissions upon start-up but not to keep them after suspend/resume:

    !ALL done as root!


    1. Plug cam (if not integrated, duh!), open terminal, as root:

    lsusb
    returns a list of plugged devices, my laptop returns:

    Bus 002 Device 002: ID 174f:6a33 Syntek Web Cam - Asus F3SA, F9J, F9S
    What's important here today is 174f, 6a33 and Syntek; we'll need them later: write it down, or, simply, open another root terminal to continue, keeping these info at hand for later.

    The ID Vendor is the first number, here it is 174f
    The ID Model is the second number, here it is 6a33
    The Name of Product here is the one we'll use as name for the special Group Syntek


    2. Terminal job again, let's create the needed group and link it to the user(s), as root:

    groupadd <YourWebcamNameHere>
    usermod --append --groups <YourWebcamNameHere> <Your User Name>
    It is probably sane to add root and any other user of this computer's webcam to the group by repeating the procedure above.

    Obviously, I did usermod --append --groups Syntek f10 where Syntek is the name of my camera and the special group created on purpose here and f10 is the username we use on this Fedora10 laptop.

    You can check this with, as root ever:
    id <Your User Name> -Gn
    Which should return the names of the group your user name belongs to. Unless this is properly set up, there is no need to keep going further;
    Notice that Fedora/Gnome has a GUI tool to manage that, one may feel more comfortable with: System->Administration->Users And Group. (You can at least use this to check if your user is registered with your new group)


    3. Now as root, again, create with a text editor (gedit or kate or mousepad or VIM), a file called

    45-<YourWebcamNameHere>.rules

    insert the following in the file; don't forget to ADAPT to your webcam ID vendor, ID product and Name, especially since it is your Group Name too, and we need to attach this device to that group once and for all:

    You can do:
    gedit /etc/udev/rules.d/45-<YourWebcamNameHere>.rules
    or, if you know VIM,
    vim /etc/udev/rules.d/45-<YourWebcamNameHere>.rules
    Contents of file to be the new rule:
    SUBSYSTEM=="usb_device", ACTION=="add",
    SYSFS{idVendor}=="<YourID VendorHere>" ,
    SYSFS{idProduct}=="<YourID ModelHere>",
    SYMLINK+="<YourWebcamNameHere>-%k",
    GROUP="<YourWebcamNameHere>",
    MODE="666"
    What I had to do in real life (as root, from the /etc/udev/rules.d folder too):
    vim /etc/udev/rules.d/45-Syntek.rules
    So for your reference mine look like this:
    SUBSYSTEM=="usb_device", ACTION=="add",
    SYSFS{idVendor}=="174f" ,
    SYSFS{idProduct}=="6a33",
    SYMLINK+="Syntek-%k",
    GROUP="Syntek",
    MODE="666"
    Check your new file called 45-<YourWebcamNameHere>.rules. You can do so with:

    less /etc/udev/rules.d/45-<YourWebcamNameHere>.rules /etc/udev/rules.d/
    Which should print the contents of your new file in the terminal.

    What's in this file anyway?

    This file is read upon startup, and it takes action in a precise way (that is why it is not dangerous, because it only speaks to one device):

    SUBSYSTEM=="usb_device", ACTION=="add", -- we are speaking USB, and specifically what to do with it
    SYSFS{idVendor}=="174f" , -- This is the brand,
    SYSFS{idProduct}=="6a33", -- This is the model, these are unique descriptor to hook to the target,
    SYMLINK+="Syntek-%k", -- That is to Link the actual device to the proper /dev/ tree where I'll have permissions to read,
    GROUP="Syntek", -- This is my groupname with special permissions for me to access the webcam,
    MODE="666" -- The 666 is the permissions as Read/Write for everybody;

    The whole lot is to me just self-explanatory gibberish that I copied and pasted, successfully over 3 different computers to gain access to my Lego Mindstorms Brick, so I know the above procedure isn't dangerous & you know I still play with Legos .


    You can check perms of your device after full reboot with:

    ls -l /dev/vide*
    and you should have tons of /dev/webcam-something if you do

    ls /dev/<Your Webcam Name Here Minus The Last Letter>*

    Regarding this hack, I say it's safe, but that's only me saying so, a simple user with very few posts, so if you don't understand this, DON'T DO IT! Never trust no-one that tries to trick you into firing up scripts or command-lines inputs in a terminal blindly.

    Review the above, ask others, make up your mind. A said earlier, it's a poor hack that is targeted at enabling one single particular, obviously alien, device to the Linux usb subsytem. If the system wasn't broke in the first place, we wouldn't need to fix it so poorly with such lack of skills.

    I say it's safe, it works. You shouldn't believe what anybody says

    Cheers

    Jean-Philippe
    Last edited by Peacepunk; 11th April 2009 at 07:23 PM. Reason: refinements
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

  3. #3
    Join Date
    May 2008
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not even using Fedora anymore (damned Mandriva!), but when I come back with the eleventh version, this will be very useful. Thanks a lot for your answer!

  4. #4
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    The fact that your post stayed unanswered for so long says a bad lot about this place I'm afraid.

    [As it happens, I am on Slackware 12.2 now - Don't upgrade unless really, badly needed - My Logitech QuickCam Communicate STX was perfect with GSPCA on 2.6.23 (self-compile), then they integrated GSPCA to the official kernel and it doesn't work anymore! I want to bite somebody!]




    Peace. Love, and ZEN computing to you all.
    Jean-Philippe.
    Last edited by Peacepunk; 13th February 2009 at 09:57 AM.
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

  5. #5
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I followed you process... But the red line that I am stuck at...

    Quote Originally Posted by Peacepunk
    If you look around, you'll find answer that doesn't work for Fedora10, with eventually a dangerous one about udev rules that could hang your system!

    http://forums.fedoraforum.org/showthread.php?t=211176
    http://forums.fedoraforum.org/showthread.php?t=177859
    http://forums.fedoraforum.org/showthread.php?t=94775
    http://forums.fedoraforum.org/showpo...19&postcount=4

    Since F10 hasn't got 50-udev.rules anymore, and that the solution here:
    http://www.linuxquestions.org/questi...sions.-701934/
    looks the same but Fedora rc.d structure of file isn't standard & you can't just apply the solution to all usbfs sytem,

    I decided to treat the webcam as a complete alien, since that's how Fedora is taking it anyway;
    Solution pumped from here:
    http://forums.nxtasy.org/index.php?s...23&#entry16723

    && simplified here:
    http://wiki.zenerves.net/index.php/Nxt::usb

    It's the recipe to hook the NXT Intelligent Brick from the LEGO MindStorm robotics system to your computer via USB and a special set of rules.
    [FYI: http://mindstorms.lego.com ]

    If I was able to connect to something as utterly unknown to my system, as user, sure I can find there a recipe to hook this freaking webcam, no?

    Follow me, at your own risks: I consider this a poor hack, but it works, including after Suspend/Resume, which was my issue since a simple chmod a+rw /dev/Video0 in the /etc/rc.d/rc.local file was enough to get proper permissions upon start-up but not to keep them after suspend/resume:

    !ALL done as root!

    1. Plug cam (if not integrated, duh!), open terminal, as root:



    returns a list of plugged devices, my laptop returns:


    What's important here today is 174f, 6a33 and Syntek; we'll need them later: write it down, or, simply, open another root terminal to continue, keeping these info at hand for later.

    The ID Vendor is the first number, here it is 174f
    The ID Model is the second number, here it is 6a33
    The Name of Product here is the one we'll use as name for the special Group Syntek

    2. Use System>Administration>Users & Groups to add a group by the name of your webcam (It was Syntek then for me); add yourself and any needed user + root to this new group; close the User & Group application once finished. Double-check that your basic, ordinary user is a member of the <YourWebcamNameHere> new group you just created.

    3. Move to /etc/udev/rules.d/ and create there a file called 45-<YourWebcamNameHere>.rules. You can do so with: (it was, obviously, 45-Syntek.rules on my laptop)



    insert the following in the file; don't forget to ADAPT to your webcam ID vendor, ID product and Name, especially since it is your Group Name too, and we need to attach this device to that group once and for all:


    So for your reference mine look like this:


    The 666 is the permissions as Read/Write for everybody; the rest is just self-explanatory gibberish that I copied and pasted, successfully over 3 different computers to gain access to my Lego Mindstorms Brick, so I know the above procedure isn't dangerous & you know I still play with Legos .

    You can check perms with:



    and you should have tons of /dev/webcam-something if you do




    Regarding this hack, I say it's safe, but that's only me saying so, a simple user with very few posts, so if you don't understand this, DON'T DO IT! Never trust no-one that tries to trick you into firing up scripts or command-lines inputs in a terminal blindly.

    Review the above, ask others, make up your mind. A said earlier, it's a poor hack that is targeted at enabling one single particular, obviously alien, device to the Linux usb subsytem. If the system wasn't broke in the first place, we wouldn't need to fix it so poorly with such lack of skills.

    I say it's safe, it works. You shouldn't believe what anybody says

    Cheers

    Jean-Philippe
    The red line, I click... System > Administration > Users & Groups.
    Click "Add Group" the enter <YourWebcamNameHere> and leave unmark (specify group ID manually)

    You mentioned double check, ordinary user is a member of the <YourWebcamNameHere> new group you just created. Is my user section show up after created new group? I showed only one ??

    The purple one... I believe i didnt follow the instruction. When you said to create a file to 45-webcamname.rules, but it showed a folder instead?? Will you please tell me how to make file not folder??

    Last thing...
    When I go /dev/webcam, it come up
    Code:
    bash: /dev/webcam: No such file or directory
    when I am on root or without root, I typed webcam, but I got same error...

    I am on FC 10...

  6. #6
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [EDIT: Extensively rewrote the main post, please try again... before posting again!]

    Updated to CLI mode of managing/adding Group and User.

    Updated the "create file in /etc/udev/rules.d" part for more clarity too


    Added content description of the udev script;

    ================================================== ============================

    The purple one... I believe i didnt follow the instruction. When you said to create a file to 45-webcamname.rules, but it showed a folder instead?? Will you please tell me how to make file not folder??
    One way is, terminal as root:
    gedit /etc/udev/rules.d/45-<YourWebcamNameHere>.rules
    Will give you a traditional text editor where it will be easy for you to copy and paste my sample file and to adapt to your needs.

    if needed,
    Please post the result of lsusb AS ROOT,

    Please post the output of id <your username here> AS USER.
    Please post the output of id <your username here> -Gn AS ROOT.

    I will be able to help more.

    The latest problems are because the preliminary steps where not completed.

    Cheers.

    [EDIT: Extensively rewrote the main post, please try again... before posting again!]
    Last edited by Peacepunk; 13th February 2009 at 09:55 AM.
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

  7. #7
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will get back with result in the evening... One thing I wanted to ensure that my webcam and laptop are communication well...

    when I enter lsusb, it responds... however, when I enter /dev/video0, it said not found?? I wonder what difference between those two??

    After I edit to give a permiission, will /dev/video0 show up??

    Thanks!

  8. #8
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can help you be sure you can access the device, but if it is located in a non-standard location you may have to ask/check elsewhere, preferably with a new thread, after we sorted the permissions out.

    You can't just "go" for /dev/video0 or "do" or /dev/video0; your proper checking method is

    ls -l /dev/vide*


    Which literally means LiSt -Long, detailed /dev/videANYTHING - But there is no sense in doing that as long as you haven't succeeded in the above and fully rebooted your system!

    Cheers.
    Last edited by Peacepunk; 13th February 2009 at 07:00 PM.
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

  9. #9
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I followed you steps smoothly after full reboot (shutdown) and wait 5 minutes to pray it will work... After boot up, and tested ls - /dev/vide*... The outcome is failed...

    $ ls -l /dev/vide*
    ls: cannot access /dev/vide*: No such file or directory

    Worse case, my internet and email are not working... I can see my wireless is running... but can't do firefox or emails

    So, I had to remove 45-Microsoft-rules... Then reboot, and my internet and emails are restored.. whew..

    My webcam is Microsoft VX-3000...

  10. #10
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ?? Doesn't make sense ??

    It is NOT ls - /dev/vide*... Once and for all it is ls -l /dev/vide*

    Please post:

    result of lsusb AS ROOT,
    output of id <your username here> AS USER.
    output of id <your username here> -Gn AS ROOT.
    output of ls -l /ect/udev/rules.d/45-Microsoft.rules
    output of less /etc/udev/rules.d/Microsoft.rules AS ROOT.

    Your 45-Microsoft.rules should look as follow:

    (ADAPT TO SUIT YOUR SYSTEM!)


    SUBSYSTEM=="usb_device", ACTION=="add",
    SYSFS{idVendor}=="<YourID VendorHere>" ,
    SYSFS{idProduct}=="<YourID ModelHere>",
    SYMLINK+="Microsoft-%k",
    GROUP="Microsoft",
    MODE="666"
    [But you of course could have chosen another name this ne looks silly]
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

  11. #11
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, let me check again at home, as right now, my laptop unable to connect internet and email... Right now, I am at work and will be home about before earlier evening...

    As Product Name... Ha... I will change from M$ to be more creative since i followed your instruction and didn't think of it ha... One more thing, I wanted to be ensure that I input correct information... The step #2:


    2. Terminal job again, let's create the needed group and link it to the user(s), as root:

    groupadd <YourWebcamNameHere>
    usermod --append --groups <YourWebcamNameHere> <Your User Name>

    It is probably sane to add root and any other user of this computer's webcam to the group by repeating the procedure above.

    Obviously, I did usermod --append --groups Syntek f10 where Syntek is the name of my camera and the special group created on purpose here and f10 is the username we use on this Fedora10 laptop.

    You can check this with, as root ever:
    id <Your User Name> -Gn
    So, username is what I can make up for identify me as user on this laptop? because i am only one that using my laptop without any addition users or guests... I will be right back with post information...

    Thanks
    Last edited by Penguins007; 14th February 2009 at 03:43 PM. Reason: addition information

  12. #12
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Penguins007
    So, username is what I can make up for identify me as user on this laptop?
    yes, that is right. sometimes username is not what login screen shows; we need here the linux username you gave when you installed the system; do AS USER in a terminal, if you are not sure:

    users


    It will show the name of anybody logged to your system; if there is only you then it is easy to get your username.

    It also usually shows in a terminal, showing [username@machine ~] at the cursor position - on my laptop, the user is currently f10 (just because we use Fedora10, that's all!) and the machine is called F9E (because it is an Asus F9E, duh!). The names I use are not important, only you need to provide the good information for others to help.
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

  13. #13
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    output of id username as user:

    Code:
    uid=500(dmzeplin) gid=500(dmzeplin) groups=500(dmzeplin),501(LaserVideo)
    output of id username I id username -Gn

    Code:
    dmzeplin LaserVideo
    So, I continue input information in editor and saved. The outcome:

    Code:
    less /etc/udev/rules/.d/45-LaserVideo.rules /etc/udev/rules.d/
    UBSYSTEM=="usb_device", ACTION=="add",
    SYSFS{idVendor}=="045e",
    SYSFS{idProduct}=="00f5",
    SYMLINK+="LaserVideo-%k",
    GROUP="LaserVideo",
    MODE="666"
    Last edited by Penguins007; 15th February 2009 at 02:00 AM. Reason: changed due to different results

  14. #14
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After reboot.....

    ~] $ ls -l /dev/vide*

    Output: ls: cannot access /dev/vide*: No such file or directory

    ~ ] # ls -l /dev/vide*

    Output: ls: cannot access /dev/vide*: No such file or directory
    Last edited by Penguins007; 15th February 2009 at 02:04 AM. Reason: changed results

  15. #15
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    do:

    ls -l /dev/LaserVide*
    do:

    lsmod|grep video
    lsmod|grep gspca
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

Page 1 of 2 12 LastLast

Similar Threads

  1. My webcam is here, not here, here again, not here ...
    By georgesgiralt in forum Using Fedora
    Replies: 0
    Last Post: 28th October 2008, 08:04 PM
  2. webcam
    By balkrishna in forum Hardware
    Replies: 1
    Last Post: 16th July 2007, 06:29 AM
  3. Need help with Webcam
    By mpajoh in forum Hardware
    Replies: 0
    Last Post: 8th August 2006, 05:36 PM
  4. USB WebCam
    By Druid in forum Hardware
    Replies: 1
    Last Post: 4th April 2005, 03:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •