You are not logged in.

#1 2004-05-22 14:06:55

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

hotplug configuration to use palm almost done, but need hint

I still want to tweak my hotplug / usb devices, and do little progress, as I have only little time to spent. Configurating hotplug to handle a new device may be of interest, and as I need a hint, too, I post it.

This is what I did so far:
- installed hotplug, of course.
- read hotplug docs, sony clie hotsync linux readmes and how to's
and found out that all are using static devs.
So I combed out the net for more examples, and found some hints at gtkam and sane help files.

This is the way I try to do it.

--
1. Plug the usb devices in, and find out their vendor and product ids
--

# cat /proc/bus/usb/devices
... 
T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs= 1
P: Vendor=0d46 ProdID=2012 Rev= 2.01
S: Manufacturer=KOBIL
S: Product=USB Adapter K
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=150mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=kobil
E: Ad=01(O) Atr=03(Int.) MxPS= 8 Ivl=16ms
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=10ms
I: If#= 0 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=kobil
E: Ad=01(O) Atr=03(Int.) MxPS= 8 Ivl=8ms
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=3ms
I: If#= 0 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=kobil
E: Ad=01(O) Atr=03(Int.) MxPS= 8 Ivl=4ms
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=1ms
 
T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 5 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=045e ProdID=003b Rev= 1.01
S: Manufacturer=Microsoft
S: Product=SideWinder Game Voice
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 80mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=hid
E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=10ms
 
T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=03 Dev#= 7 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=054c ProdID=00da Rev= 1.00
S: Manufacturer=Palm, Inc.
S: Product=Palm Handheld
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=00 Prot=00 Driver=usbserial
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=07(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms

--
2. Find out which module is going to support the hardware, and teach hotplug to use it
--
I created /etc/hotplug/usb/visor.usermap, to tell hotplug it should use the visor module.
The syntax is stolen from sane setup and gphoto2. I don't really know the first number's meaning (0x0003). The following both tuples are the vendor and product ids:

# Sony Clié
visor 0x0003 0x054c 0x00da 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

As I read in the gphoto2 readme, the same string has to be added to /etc/hotplug/usb.usermap:

# Sony Clié
visor 0x0003 0x054c 0x00da 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

Now I created /etc/hotplug/usb/visor, the script is run when ever hotplug found a device inside usb.usermap ore visor.usermap, making use of the visor module:

#!/bin/bash
# Sets up newly plugged in USB visor device so that only members of the 
# group

GROUP=palm

# 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 
#    visor device you are using.
# b) a group "palm" where all users allowed access to the
#    visor device 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 
# "visor" like this script.
# 

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
    # chmod o-rwx "${DEVICE}"
    # chgrp "${GROUP}" "${DEVICE}"
    # chmod g+rw "${DEVICE}"
    rm -r /dev/pilot
    ln -s "${DEVICE}" /dev/pilot    
    chmod o-rwx /dev/pilot
    chgrp "${GROUP}" /dev/pilot
    chmod g+rw /dev/pilot        
fi

As far as I know, this should be a proper configuration. But unfortunately, it isn't.
While the palm device tries to hotsync, I observe /proc/bus/usb to see if it works ore not:

ls -lR /proc/bus/usb
/proc/bus/usb:
insgesamt 0
dr-xr-xr-x  2 root root 0 2004-05-22 14:19 001
dr-xr-xr-x  2 root root 0 2004-05-22 14:19 002
-r--r--r--  1 root root 0 2004-05-22 14:31 devices
 
/proc/bus/usb/001:
insgesamt 0
-rw-r--r--  1 root root 43 2004-05-22 14:19 001
-rw-r--r--  1 root root 43 2004-05-22 14:19 002
-rw-r--r--  1 root root 96 2004-05-22 14:19 003
-rw-r--r--  1 root root 52 2004-05-22 14:19 004
-rw-rw----  1 root palm 64 2004-05-22 14:31 005
 
/proc/bus/usb/002:
insgesamt 0
-rw-r--r--  1 root root 43 2004-05-22 14:19 001

While the hotsync process tries to connect my pc, I find /dev/pilot is created, too. But this link is not working at all, it is somehow broken (so tells me nautilus). Something is wrong, but I have no idea what it is.
Has anyone an idea where I did something wrong?


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#2 2004-05-22 20:51:35

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: hotplug configuration to use palm almost done, but need hint

I think that the device isn't there yet. That the kernel tells you what device it would be doesn't mean the device is there. But if making a symlink (and the real device) is all you really want, then udev is what you should be using.

Offline

#3 2004-05-23 19:27:34

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: hotplug configuration to use palm almost done, but need hint

This is not clearing my mind.
Where is the information which device would be used if it was available? I can't see the tree in the forest.
  :?


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#4 2004-05-24 19:57:57

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: hotplug configuration to use palm almost done, but need hint

Could it be a simple

#
# /etc/modprobe.conf (for v2.6 kernels)
#

alias /dev/pilot    visor
alias /dev/kobil    kobil_sct

could do the job?


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#5 2004-05-24 22:05:32

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: hotplug configuration to use palm almost done, but need hint

Don't think so...

A small and simple guide to udev: http://aptchi.homelinux.org/2.6-udev/

Maybe it helps clearing things up.

Offline

#6 2004-05-24 23:20:41

galen
Member
From: Canada
Registered: 2003-07-02
Posts: 135
Website

Re: hotplug configuration to use palm almost done, but need hint

does not help those of us with 2.6.x not booting yet
http://www.archlinux.org/phpbt/?do=details&id=904

sad


Off to using Peanut and Slackware, no hard feelings but I need my CD to burn, PDA and scanner to connect and arch won't do it.

[img]http://www.flightsimhq.org/images/war-is-bushit_s.jpg[/img]

Offline

#7 2004-05-25 08:55:08

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: hotplug configuration to use palm almost done, but need hint

... is this to hard to be solved ore am I just to stupid ...

I found and printed a lot of more readmes, hints, howtos, not really fitting my needs, but maybe helpfull - quite a bunch of paper.

Hope it will refresh my mind.


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

Board footer

Powered by FluxBB