Skip to contentSkip to conversation

Problems defining an udev rule for usb-daq board

DISCUSSION [email protected] 3 participants 7 messages Aug 18, 2006 – Aug 21, 2006

lore
Share & tools
lore
#0 lore raw

Hi all,
I've got trouble configuring an usb-daq board with udev. I use a recent self-compiled kernel (2.6.16-2-686) on Debian testing with comedi-0.7.72 and an usb-daq board (usbdux). The daq-board runs perfect, but I can't figure out how it can be automagically configured by udev when hotplugged. After connecting the board, one had to execute the following command (as root):

/usr/local/sbin/comedi_config -i /usr/local/share/usb/usbdux_firmware. hex /dev/comedi0 usbdux

I tried the following udev-rule without success:

KERNEL="usbdux", SUSBSYSTEM="module", SYSFS{refcnt}="0", RUN+=" /usr/local/bin/config_usbdux"

where "config_usbdux" is a shell-script with the comedi_config command above.

The following output might be helpful:

# udevinfo -a -p /sys/module/usbdux/

[...]

looking at device '/module/usbdux':

    KERNEL="usbdux"
    SUBSYSTEM="module"
    SYSFS{refcnt}="0"
# udevinfo -a -p /sys/bus/usb/drivers/usbdux/

looking at device '/bus/usb/drivers/usbdux':
KERNEL="usbdux"
SUBSYSTEM="drivers"

After connecting the daq-board, dmesg shows:

usb 5-1: new high speed USB device using ehci_hcd and address 34 usb 5-1: configuration #1 chosen from 1 choice
comedi_: usbdux_: finding a free structure for the usb-device
comedi_: usbdux: usbduxsub[0] is ready to connect to comedi.
comedi_: usbdux: ifnum=0
comedi_: usbdux0 has been successfully initialised.

After configuring with comedi_config dmesg shows

comedi0: usbdux: uploading 1471 bytes to addr 0, first byte=2.
comedi0: usbdux: usb-device 0 is attached to comedi.
comedi0: attached to usbdux.

Now the board is ready to use,. Any ideas? Thanks in advance, Sven

Endlich Sicherheit bei Computerabstuerzen - Phoenix Recover Pro. http://internetzugang.tiscali.de/internet_services/detail_rec.php

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 8 lines · On Fri, 2006-08-18 at 12:59 +0200, [email protected] wrote:

Hi all,
I've got trouble configuring an usb-daq board with udev. I use a recent self-compiled kernel (2.6.16-2-686) on Debian testing with comedi-0.7.72 and an usb-daq board (usbdux). The daq-board runs perfect, but I can't figure out how it can be automagically configured by udev when hotplugged. After connecting the board, one had to execute the following command (as root):

Quoted 7 lines

/usr/local/sbin/comedi_config -i /usr/local/share/usb/usbdux_firmware. hex /dev/comedi0 usbdux

I tried the following udev-rule without success:

KERNEL="usbdux", SUSBSYSTEM="module", SYSFS{refcnt}="0", RUN+=" /usr/local/bin/config_usbdux"

You plug into the module-load event. Are you sure that the module isn't already loaded when you connect the device? And how will the module-load event, that calls your script, find the the device?

Why don't you plug into the event for the device to upload the firmware?

Kay

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to [email protected]
Quoted 1 line

You plug into the module-load event. Are you sure that the module

isn't

Quoted 1 line

already loaded when you connect the device? And how will the module-

load

Quoted 1 line

event, that calls your script, find the the device?

The module usbdux is automatically loaded when the device is connetcted.

Quoted 1 line

Why don't you plug into the event for the device to upload the

firmware?

How? I don't know much about udev, but it worked with kernel 2.6.8. and the hotplug scripts.

Thanks, Sven

Quoted 4 lines

Kay

Endlich Sicherheit bei Computerabstuerzen - Phoenix Recover Pro. http://internetzugang.tiscali.de/internet_services/detail_rec.php

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to [email protected]
Quoted 8 lines · On Fri, 2006-08-18 at 14:20 +0200, [email protected] wrote:
Quoted 1 line

You plug into the module-load event. Are you sure that the module

isn't

Quoted 1 line

already loaded when you connect the device? And how will the module-

load

Quoted 1 line

event, that calls your script, find the the device?

The module usbdux is automatically loaded when the device is connetcted.

But only the first time you connect a matching device and never again, except you unload it manually.

Quoted 5 lines
Quoted 1 line

Why don't you plug into the event for the device to upload the

firmware?

How? I don't know much about udev, but it worked with kernel 2.6.8. and the hotplug scripts.

Run 'udevmonitor --env', plug-in the device, pick from the list of events the one for the device and use this.

Try the one which contains the correct DEVNAME and use that value as the device node name you upload the firmware to.

Good luck,
Kay

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to [email protected]
Quoted 7 lines · On Fri, Aug 18, 2006 at 12:59:34PM +0200, [email protected] wrote:

Hi all,
I've got trouble configuring an usb-daq board with udev. I use a recent self-compiled kernel (2.6.16-2-686) on Debian testing with comedi-0.7.72 and an usb-daq board (usbdux). The daq-board runs perfect, but I can't figure out how it can be automagically configured by udev when hotplugged. After connecting the board, one had to execute the following command (as root):

Hm, do you have a pointer to where you got the usbdux code from? It's not in the main kernel tree, right?

thanks,

greg k-h

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to [email protected]

The usbdux code is part of comedi, see e.g. http://www.comedi.
org/download/comedilib-0.7.22.tar.gz, more information about the daq board is here: http://www.linux-usb-daq.co.uk/.

Thanks, Sven

Quoted 7 lines

----Ursprüngliche Nachricht----
Von: [email protected]
Datum: 19.08.2006 04:59
An: <[email protected]>
Cc: <[email protected]>
Betreff: Re: Problems defining an udev rule for usb-daq board

Quoted 6 lines
Quoted 5 lines · On Fri, Aug 18, 2006 at 12:59:34PM +0200, [email protected] wrote:

Hi all,
I've got trouble configuring an usb-daq board with udev. I use a recent self-compiled kernel (2.6.16-2-686) on Debian testing with comedi-0.7.72 and an usb-daq board (usbdux). The daq-board runs perfect, but I can't figure out how it can be automagically

configured

Quoted 4 lines
Quoted 2 lines

by udev when hotplugged. After connecting the board, one had to execute the following command (as root):

Hm, do you have a pointer to where you got the usbdux code from?

It's

Quoted 6 lines

not in the main kernel tree, right?

thanks,

greg k-h

Endlich Sicherheit bei Computerabstuerzen - Phoenix Recover Pro. http://internetzugang.tiscali.de/internet_services/detail_rec.php

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to [email protected]
Quoted 3 lines · On Mon, Aug 21, 2006 at 04:55:33PM +0200, [email protected] wrote:

The usbdux code is part of comedi, see e.g. http://www.comedi.
org/download/comedilib-0.7.22.tar.gz, more information about the daq board is here: http://www.linux-usb-daq.co.uk/.

Ah, ok, that fun thing :(

Try asking the authors of that code to fix it up, as it is not under the GPL, I'm not allowed to touch it, sorry.

good luck,

greg k-h

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel