LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-27-2005, 05:52 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
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)
 
Old 09-27-2005, 06:23 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
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
 
Old 09-27-2005, 06:24 AM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
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
 
Old 09-27-2005, 06:33 AM   #4
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
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
 
Old 09-27-2005, 07:40 AM   #5
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
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
 
Old 09-27-2005, 07:57 AM   #6
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
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!
 
Old 09-27-2005, 08:45 AM   #7
kite
Member
 
Registered: Aug 2003
Location: Shenzhen, China
Distribution: Slackware
Posts: 306

Rep: Reputation: 47
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.
 
Old 09-27-2005, 09:11 AM   #8
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
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
 
Old 09-25-2006, 08:12 AM   #9
Rurouni_Alucard
LQ Newbie
 
Registered: Sep 2005
Location: Spectral Realm
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Question 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...
 
Old 09-25-2006, 09:21 AM   #10
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
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.
 
Old 09-28-2006, 03:27 PM   #11
Rurouni_Alucard
LQ Newbie
 
Registered: Sep 2005
Location: Spectral Realm
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
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,
 
  


Reply

Tags
camera, udev



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Camera jnicou Mandriva 1 05-21-2005 03:38 PM
camera and udev JimBass Linux - Newbie 0 12-09-2004 09:17 AM
Digital Camera Insomnia Linux - General 2 08-29-2004 12:52 PM
Digital Camera Mike Blick Linux - Hardware 1 05-28-2002 01:08 PM
configuring kodak 280z digital camera sambam Linux - General 1 10-16-2001 10:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration