LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Connecting a USB device as user (https://www.linuxquestions.org/questions/linux-hardware-18/connecting-a-usb-device-as-user-378011/)

DiBosco 10-29-2005 06:43 AM

Connecting a USB device as user
 
Hi folks,

I have had a search through the archives, but can't find anything that quite answers my question. (All other USB permission questions seem to be to do with cameras and hard drives and mounting issues.)

I have a USB device that allows me to debug embedded microprocessors. When I run my software debug environment as root, I can connect to the USB device no problem. When I run it as user, it cannot connect.

If I run (as user)

cat /proc/bus/usb/devices

I get the following. The salient entry here is the bottom one that says Atmel JTAGICE Mk II - indicating Linux can clearly see it as user, but I am guessing that I have to set up a permission somewhere to allow user to access it. Problem is, I don't know what to set! Can anyone point me in the right direction please?

(I'm running Mandrake 10.0. btw.)
---------------------------------------------------

T: Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 8
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.3-7mdksmp ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:00:10.4
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms

T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.3-7mdksmp uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:10.3
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

T: Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.3-7mdksmp uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:10.2
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.3-7mdksmp uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:10.1
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.3-7mdksmp uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:10.0
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=03eb ProdID=2103 Rev= 2.00
S: Manufacturer=ATMEL
S: Product=JTAGICE mkII
S: SerialNumber=00A00000027C
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=usbfs
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms

Brian1 10-29-2005 05:11 PM

Post your /etc/fstab info and point out the line for the USB device.

Brian1

DiBosco 10-29-2005 05:39 PM

Quote:

Originally posted by Brian1
Post your /etc/fstab info and point out the line for the USB device.

Brian1

Here it is:

/dev/hda1 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda6 /home ext3 defaults 1 2
/dev/hde /mnt/cdrom auto umask=0,user,iocharset=iso8859-15,codepage=850,noauto,ro,exec 0 0
none /proc proc defaults 0 0
/dev/hda5 swap swap defaults 0 0

I can't see anything about USB. Sorry if I'm being naive in saying this, but what I'm trying to attach is not a storage device.

Cheers,

Rob

DiBosco 10-30-2005 06:32 AM

It's OK, I've sussed it. Or at least the software tool vendor has. You have to put an entry in /etc/hotplug/usb.usermap and run a little script.

Thanks anyway.

Cheers,

Rob

Brian1 10-30-2005 09:09 AM

Glad to hear a sucess. If you could post what you did to fix it, it can help others later. Also include type and model number of the device. It will help if someone is searching for help on the same or similiar device.
I was thinking of something else in my first reply. My mistake, thought it would be mounted as a scsi block device. This is not the way that piece of hardware works.

Brian1

DiBosco 10-30-2005 09:56 AM

OK, fair point. It's very unlikely anyone else will be struggling with this, but you never know!

It's for Atmel's JTAGICE II connecting to Crossworks. You need to add the following line to /etc/hotplug/usb.usermap

# Atmel JTAGICE mkII
JTAGICE 0x0003 0x03eb 0x2103 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

Now, I assume that will always be the same. You might want to double check PID & VID are 0x03eb 0x2103 by doing:

cat /proc/bus/usb/devices

This brings up a list of what's connected to the USB ports. You can see the Atmel JTAGICE MkII there and its PID & VID (product and vendor IDs).

The line you've added above will invoke the script JTAGICE which should be as follows:

#!/bin/bash
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
chmod a+rw "${DEVICE}"
fi

The JTAGICE file must reside in the /etc/hotplug/usb directory.

Don't forget to make this file executable to root! This tripped me up for a while!

Brian1 10-30-2005 11:26 AM

Impressive work there Rob, just learn something new. I will make a note of that in the event I run into something similiar.

Brian


All times are GMT -5. The time now is 11:56 PM.