23

The system sees something is plugged in when I plug and unplug it:

bluehat@Matapan:/dev$ tail -f /var/log/syslog
Mar 23 15:36:35 Matapan kernel: [156082.112874] usb 7-1: new full speed USB device using uhci_hcd and address 6
Mar 23 15:47:19 Matapan kernel: [156726.248081] usb 7-1: USB disconnect, address 6
Mar 23 15:47:29 Matapan kernel: [156736.200148] usb 6-1: new full speed USB device using uhci_hcd and address 3

AVRISP MKII should rely on cdc-acm:

bluehat@Matapan:/dev$ modinfo cdc-acm -V
module-init-tools version 3.12

So it should be able to see it just fine, and yet I am unable to write to it.

avrdude -p m1280 -c avrispmkII -P usb -U test.hex

Returns

avrdude: usb_open(): cannot read serial number "error sending control message: Operation not permitted"
avrdude: usb_open(): cannot read product name "error sending control message: Operation not permitted"
avrdude: usbdev_open(): error setting configuration 1: could not set config 1: Operation not permitted
avrdude: usbdev_open(): did not find any USB device "usb"
Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Katy Levinson
  • 767
  • 1
  • 6
  • 15

5 Answers5

30

It turns out that Ubuntu will acknowledge that the object is there but not play nicely with it until you fix up some of your udev rules. Thanks to http://steve.kargs.net/bacnet/avr-isp-mkii-on-ubuntu-hardy/ which provided files that only needed a little updating.

Create new file /etc/udev/avrisp.rules

SUBSYSTEM!="usb", ACTION!="add", GOTO="avrisp_end"

# Atmel Corp. JTAG ICE mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2103", MODE="660", GROUP="dialout"
# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2104", MODE="660", GROUP="dialout"
# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE="660", GROUP="dialout"

LABEL="avrisp_end"

Now create a virtual link to the file and give it a rule priority

cd /etc/udev/rules.d
sudo ln ../avrisp.rules 60-avrisp.rules

Check you're in the dialout group

groups

Restart udev

sudo service udev restart

Hooray!

secretformula
  • 6,256
  • 2
  • 30
  • 53
Katy Levinson
  • 767
  • 1
  • 6
  • 15
  • 1
    Thanks! This saved me a few hours of messing about today. – Joshua Noble Mar 25 '11 at 21:44
  • Thanks. I had the issue on linux mint, maybe it can help. In linux mint replace SYSFS with ATTRS – Nelstaar Oct 27 '12 at 20:37
  • This worked for me on Ubuntu 13.04 / Ardiono 1.0.3 together with the SYSFS and ATTR replacement as suggested by @antler – Saar Drimer Aug 26 '13 at 19:08
  • In later version change SYSFS to ATTR, then it works. Horaz posts shows how you can get the SYSFS or ATTR parts you need from the bus device information. This is helpful to get it working on any version of ubuntu. – Myforwik Sep 05 '13 at 05:08
  • 2
    For Lubuntu 13.10 (probably Ubuntu 13.10 as well), replace SYSFS with ATTRS (not ATTR). GROUP can be any groups you are in. In my case, i set GROUP="plugdev" because there is no "dialout" group. – Hieu Nov 16 '13 at 00:34
  • Check U're in the related group: while 'groups' only displays the existing groups, checking for your user is: $ groups yourusername (ubuntu 12.04) – Jadeye Jan 15 '14 at 22:05
  • Thanks. This was very helpful. – Cerin Jun 26 '17 at 15:11
  • Newer variants of the ICE mkII have product ID 2141. I simply copied the last line of the suggested file with ATTR... and changed the product ID to 2141 to add support for it. – nsayer Jul 05 '17 at 14:28
11

For Ubuntu 12.04, there's a minor change that must be carried out to the configuration that Katy posted:

All occurrences of SYSFS should be replaced with ATTR

Additionally, if you're still having problems, make sure you have installed all the required dependent libraries. I found that I had to install the uisp package as well.

If restarting udev doesn't make a difference, unplugging the programmer and plugging it in back in does.

antler
  • 151
  • 1
  • 4
7

Updated rule that works for 13.10:

SUBSYSTEM!="usb", ACTION!="add", GOTO="avrisp_end"

# Atmel Corp. JTAG ICE mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2103", MODE="660", GROUP="dialout"
# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2104", MODE="660", GROUP="dialout"
# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE="660", GROUP="dialout"

LABEL="avrisp_end"

Based on previous posts about changes.

Uberdaff
  • 91
  • 1
  • 2
  • This is also what I came up with after examining my "udevadm info /dev/bus/usb/X/Y" output. I'm on a Fedora 19/FC19 system, kernel 3.11.10. Also udev restart has changed to "udevadm control --reload-rules ; udevadm trigger". But re-plugging in the device also works. – EkriirkE Jan 04 '14 at 07:27
  • This is the answer of recent systems! – secretformula Sep 09 '15 at 23:23
2

Seems they changed it again in 12.10
The Subsystem is now "usb"

I found a command which shows what you need. For that you just need to know the Bus and Device number from the plugged device (use lsusb)

Bus 003 Device 010: ID 03eb: lsusb

So my Bus number from the isp is 003 and Device is 010 (edit the end /003/010 to your needs)

udevadm info --attribute-walk --name=bus/usb/003/010


shows among many other things

SUBSYSTEM=="usb"

ATTR{idVendor}=="03eb"

ATTR{idProduct}=="2104"

Replace/change the created rule above and everything should work

If there are other Problems the Command will show them to you, it checks the rules (found a typo that way :)) If there is no error it won't show anything (Didn't realise for some time)

Community
  • 1
  • 1
Horaz
  • 21
  • 1
0

I used the following udev rules file to get it working on Fedora 19:

SUBSYSTEM!="usb", ACTION!="add", GOTO="avrisp_end"

# Atmel Corp. JTAG ICE mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2103", MODE="660", GROUP="dialout"
# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2104", MODE="660", GROUP="dialout"
# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE="660", GROUP="dialout"

LABEL="avrisp_end"

As you can see, some minor things are different from what is suggested above. Also I had to restart the computer. Using "udevadm control --reload" was not enough.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123