SlackwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)
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.
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...
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.
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 ?
#!/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
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).
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 ?
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.
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-) ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.