LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-29-2005, 06:43 AM   #1
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 813

Rep: Reputation: 40
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
 
Old 10-29-2005, 05:11 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Post your /etc/fstab info and point out the line for the USB device.

Brian1
 
Old 10-29-2005, 05:39 PM   #3
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 813

Original Poster
Rep: Reputation: 40
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
 
Old 10-30-2005, 06:32 AM   #4
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 813

Original Poster
Rep: Reputation: 40
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
 
Old 10-30-2005, 09:09 AM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
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
 
Old 10-30-2005, 09:56 AM   #6
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 813

Original Poster
Rep: Reputation: 40
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!
 
Old 10-30-2005, 11:26 AM   #7
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

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

Brian
 
  


Reply



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
USB drive not working properly, read only device? (USB key storage device) Arodef Linux - Hardware 14 01-01-2010 07:32 AM
Digikam connecting as root/not connecting as regular user jayhel Slackware 5 09-29-2005 05:57 PM
Weird message when connecting USB mass storage device destin Slackware 5 04-04-2004 08:34 AM
system hangs when connecting a usb device ras123 Red Hat 2 01-19-2004 03:44 AM
User mount USB device Infinite_Pizza Linux - Hardware 2 08-05-2003 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:51 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