Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-27-2005, 05:52 AM
|
#1
|
|
Member
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 633
Rep:
|
Configuring udev for digital camera
I am having some trouble configuring udev to recognize my digital camera. Having read the "Writing udev rules" document at http://www.reactivated.net/udevrules.php I am still at loss as how to set up the camera in Slackware. The document refers to finding SYSFS information based on existing /dev/* files, but my camera has produced nothing.
Could someone please give me some pointers on how to translate the following lsusb output into a good config for /etc/udev/rules.d/10-local.rules ?
lsusb gives the following output:
# lsusb -v -s 002:003
Bus 002 Device 003: ID 04a9:3075 Canon, Inc. IXUS 400 Camera
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 32
idVendor 0x04a9 Canon, Inc.
idProduct 0x3075 IXUS 400 Camera
bcdDevice 0.01
iManufacturer 1 Canon Inc.
iProduct 2 Canon Digital Camera
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 6 Imaging
bInterfaceSubClass 1 Still Image Capture
bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
|
|
|
|
09-27-2005, 06:23 AM
|
#2
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Hi.
That's the same camera I've got.
Access to these cameras is dealt with by gphoto2 (and the gtkam and gthumb front ends). There shouldn't be any need to play with udev to get these working.
Dave
|
|
|
|
09-27-2005, 06:24 AM
|
#3
|
|
Member
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 633
Original Poster
Rep:
|
Thanks!
So by downloading digiKam, all this should be taken care of?
I'd still like to be able to access the card though, but maybe I'm just asking too much 
|
|
|
|
09-27-2005, 06:33 AM
|
#4
|
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Yeah, digiKam should do nicely.
Unfortunately, though, the camera doesn't act as a USB Mass Storage device, so you can't access the card directly. Card readers are real cheap though...
Dave
|
|
|
|
09-27-2005, 07:40 AM
|
#5
|
|
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 1,163
Rep:
|
I printed a copy of that same udev guide. I found it very helpful. I don't have the same camera but I was able to write a rule so I can mount mine. Based on your lsusb output try this:
Another way to access the sysfs information is to read the file in /proc/bus/usb/devices
1) if you don't already have one, create the file /etc/udev/rules.d/10-local.rules
2) (optional) add a comment line to identify the device - #Canon digital camera
3) add the line to identify the device to udev:
BUS="usb", SYSFS{product}="Canon Digital Camera", NAME="sd%n", SYMLINK="camera"
When udev detects it it should be assigned a device name that starts with sd follwed the next availabls number and a symlink automatically created called camera. You could then use the mount command to access the camera's memory or an inserted card.
mount -t vfat /dev/camera /mount/point
|
|
|
|
09-27-2005, 07:57 AM
|
#6
|
|
Member
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 633
Original Poster
Rep:
|
Turns out my camera cannot be auto-mounted as it doesn't support it.
However, I now downnloaded and compiled digiKam, but it doesn't work. It correctly detects my camera as a Canon IXUX 400, but when I try to connect to it, it claims it cannot connect.
Then, when running as root, I have no problem connecting, so it's clearly permissions based.
My question is this, and it's simple:
Which device file does it apparently use, and if udev cannot recognize the camera, how do I set this permission to be user-friendly so that I can use digiKam ?
Thanks!
|
|
|
|
09-27-2005, 08:45 AM
|
#7
|
|
Member
Registered: Aug 2003
Location: Shenzhen, China
Distribution: Slackware
Posts: 273
Rep:
|
My /etc/hotplug/usb/usbcam read:
Code:
#!/bin/bash
# $Id: usbcam.group,v 1.3 2003/09/16 16:42:44 hun Exp $
#
# /etc/hotplug/usb/usbcam
#
# Sets up newly plugged in USB camera so that only members of the
# group
GROUP=video
# can access it from user space. (Replace camera with the name of the
# group you want to have access to the cameras.)
#
# Note that for this script to work, you'll need all of the following:
# a) a line in the file /etc/hotplug/usermap that corresponds to the
# camera you are using. You can get the correct lines for all cameras
# supported by libgphoto2 by running "print-usb-usermap".
# b) a group "camera" where all users allowed access to the
# camera are listed
# c) a Linux kernel supporting hotplug and usbdevfs
# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
#
# In the usermap file, the first field "usb module" should be named
# "usbcam" like this script.
#
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
chmod o-rwx "${DEVICE}"
chgrp "${GROUP}" "${DEVICE}"
chmod g+rw "${DEVICE}"
fi
Then edit your /etc/group file, find the line with video and add your username to that group as following, where USERNAME should be replaced with your real name, and then remember to relogin to let it take effect:
video::18:USERNAME
Last edited by kite; 09-27-2005 at 11:22 AM.
|
|
|
|
09-27-2005, 09:11 AM
|
#8
|
|
Member
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 633
Original Poster
Rep:
|
Thanks much kite et all!
Turns out it was down to insufficient understanding of the hotplug system from my part. Once I got the cam script set up properly it all worked according to plan and I now have the camera accessable by members of the "camera" group (soon to be managed by LDAP on the server, but that's a different story and possibly a different thread).
-Y1
|
|
|
|
09-25-2006, 08:12 AM
|
#9
|
|
LQ Newbie
Registered: Sep 2005
Location: Spectral Realm
Distribution: Slackware
Posts: 4
Rep:
|
A little question about info...
Hi all,
I would like to know, where did you learn how to deal with usb devices in Slackware?, I mean, I have read the Whole slackware manual without look
Is there another source of information where I can learn how to deal with this kind of situation using a Slackware distro ?
Thanks...
|
|
|
|
09-25-2006, 09:21 AM
|
#10
|
|
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 1,163
Rep:
|
Hi, Rurouni_Alucard, and welcome to the forums. First off, it would've been better to start a new thread with this instead of tacking onto one that's a year old. But to answer your question, the best thing to do is tackle each device one at a time. Plug it in, open a terminal window if you're in a gui, and type dmesg. The last several lines will be the kernel's detection of the device. It shows which usb port it's on, product identification and device node assignment. If you don't understand what you're looking at ask here and include the relevant portion of the output.
If you want to learn how to tell the kernel what to do for a specific device, as was the case in this thread with udev, check out the link at the top of this thread. I know it's a bit difficult to grasp if you're new to it. It was Greek to me until I read it five times. Don't forget to follow along with it on your computer so you see it while you're reading it.
For more sources of info look at tldp.org for topic-specific documentation.
Once more thing, if you're new to Linux and Slackware you're in one hell of a ride!  If you're serious about sticking with Slackware then just don't give up. If you run into any problems or things you don't understand spend some time on Google and ask in these forums. You'll find your answers.
|
|
|
|
09-28-2006, 03:27 PM
|
#11
|
|
LQ Newbie
Registered: Sep 2005
Location: Spectral Realm
Distribution: Slackware
Posts: 4
Rep:
|
Thank you very much... I have used 'dmesg' before, I thought it read devices only while the machine was booting (starting).
I am not really 'new' to Slackware, I have a little time on it and I like the control it gives me over what happend on my box 
I just dont have to much experience with USB devices 8-) ...
Thanks again,
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:35 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|