[TUT] [HARD] Use AVR Dragon with Linux without being root

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since purchasing my AVR Dragon I have had to use root permission (sudo) when programming with avrdude under Ubuntu 7.10 Gutsy Gibbon. It is not advisable to frequently execute command as the root user so I wanted to grant access to this device for non-root users. This should work for other linux distributions with possible minor changes.

Credit: This is straight from the following tutorial:
http://www.homebuilthardware.com/index.php/avr/linux-avrdragon-tutorial-1/

How To:

1. Create a new udev rule file for the avrdragon using your favorite text editor (you need root permission to do this):

sudo nano /etc/udev/rules.d/50-avrdragon.rules

2. Copy and paste this line into the newly created file. This will allow access based on the idVendor and idProduct supplied by the AVR Dragon when it is connected to the usb port.
IMPORTANT The following code should all be on the same line in the rules file:

SUBSYSTEM=="usb_device", SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2107", GROUP="users", MODE="0666"

UPDATE: With the new version of Ubuntu, 8.04 Hardy Heron you will need to use the following in your rules file. All other instructions remain the same:

SUBSYSTEM=="usb", SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2107", GROUP="users", MODE="0666"
SUBSYSTEM=="usb_device", MODE="0666"

UPDATE: With the new version of Ubuntu, 9.04 Jaunty Jackalope you will need to create a different file (forget the others):
1. Create a new udev rule file for the avrdragon using your favorite text editor (you need root permission to do this):

sudo nano /etc/udev/rules.d/46-avrisp.rules

2. Copy and paste this line into the newly created file. This will allow access based on the idVendor and idProduct supplied by the AVR Dragon when it is connected to the usb port.

# udev rules file for ATMEL AVR isp
#
ACTION!="add", GOTO="avrisp_rules_end"
SUBSYSTEM=="usb_device", GOTO="avrisp_rules_real"
SUBSYSTEM=="usb", GOTO="avrisp_rules_real"
BUS!="usb", GOTO="avrisp_rules_end"

LABEL="avrisp_rules_real"

# AVR Dragon
SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2104", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2107", MODE="0660", GROUP="plugdev"

LABEL="avrisp_rules_end"

3. Save this file. If you are using "nano" as your text editor you should press CTRL-X and then answer "yes" to the confirmation question.

4. Restart the udev so the new rule will take effect:

sudo /etc/init.d/udev restart

5. You should now be able to use avrdude to program through the AVR Dragon without using root permission (sudo).

Edit: Added fix for Ubuntu 8.04 "Hardy Heron"
Edit 7/7/09: Added fix for Ubuntu 9.04 "Jaunty Jackalope" - I don't know why these rules keep breaking with Ubuntu updates.

Last Edited: Fri. Aug 7, 2009 - 08:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps this should go in the tutorial forum so it can be found more easily?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, you're probably right. I changed the subject to match to accepted tutorial tags.

Moderators, can you move this for me?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Barney, you might want to send the moderator a PM to ensure they see your request.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the post, Your timing couldn't be better as I just started messing with my Dragon under Linux and I had the same issue with OpenSuse 10.2.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your wish is my command - now in the tutorial forum

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is fantastic information! I was able to use this to get my AVRISP MKII to work with AVRdude without using sudo on Ubuntu 8.04.

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

and for Fedora 10 you need:

become root:

su -

create udev rule for avr dragon:

nano  /etc/udev/rules.d/20-avrdragon.rules

and put there:

SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE:="666"

(this should be one line)

then reload udev rules

udevcontrol reload_rules 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

udev rulez!

Also works for those $4 USBasp's from Ebay.

SUBSYSTEM=="usb", SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="05dc", GROUP="paul", MODE="0666"

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com