toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

USBasp + arduino IDE on Pi. help! (solved)

Mon May 13, 2013 10:17 pm

Okay, I was hoping this would be straightforward but it looks as though I'm going to need some help. I've got the arduino IDE up and running, My USBasp programmer plugged into the pi's USB, and the USBasp option selected in the IDE - the sketch compiles but won't upload. I get this error:

Code: Select all

avrdude: Warning: cannot query manufacturer for device: error sending control message: Operation not permitted
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc
running 'dmesg' on the terminal shows it's plugged in:

Code: Select all

[103866.544647] usb 1-1.3.2: new low-speed USB device number 8 using dwc_otg
[103866.650171] usb 1-1.3.2: New USB device found, idVendor=16c0, idProduct=05dc
[103866.650202] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[103866.650233] usb 1-1.3.2: Product: USBasp
[103866.650249] usb 1-1.3.2: Manufacturer: www.fischl.de
...and there's something showing up with the same ID when I run 'lsusb':

Code: Select all

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 007: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 062a:0102 Creative Labs Wireless Keyboard/Mouse Combo [MK1152WC]
Bus 001 Device 005: ID 0a05:7211  
Bus 001 Device 008: ID 16c0:05dc VOTI shared ID for use with libusb
Bus 001 Device 006: ID 0a05:7211  
Now, I've had a bit of a google around and it seems it might be something to do with sudo and permissions, and one site suggested making a udev rule by creating a one-line file containing only this:

Code: Select all

SYSFS{idVendor}=="16c0", 
 SYSFS{idProduct}=="05dc", MODE="0666", GROUP="plugdev"
and then putting it into the /etc/udev/rules.d directory. This is supposed to remove restrictions when using that particular device. However, I tried it and it doesn't seem to have worked. I am now out of ideas.

Can anyone help?
note: I may or may not know what I'm talking about...

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: SOLVED: USBasp + arduino IDE on Pi. help!

Thu May 16, 2013 10:13 am

Never mind, I found another site with another suggestions for similar rules to add to udev, restarted a couple times, plugged it and unplugged it and now it's working :) I don't know exactly what fixed it, but it's working now anyway and it was easily googlable.
note: I may or may not know what I'm talking about...

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: SOLVED: USBasp + arduino IDE on Pi. help!

Thu May 16, 2013 10:20 am

Go on - post the link :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: SOLVED: USBasp + arduino IDE on Pi. help!

Fri May 17, 2013 11:10 pm

can't be arsed to find that same exact link again, but I'll tell you what I did.

1.

Code: Select all

cd /etc/udev/rules.d
2.

Code: Select all

sudo nano 50-embedded_devices.rules
3. copy and paste this into it:

Code: Select all

# USBtinyISP Programmer rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c9f", GROUP="users", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0479", GROUP="users", MODE="0666"
# USBasp Programmer rules http://www.fischl.de/usbasp/
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="users", MODE="0666"

# Mdfly.com Generic (SiLabs CP2102) 3.3v/5v USB VComm adapter
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", GROUP="users", MODE="0666"

#Atmel AVR Dragon (dragon_isp) rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", GROUP="users", MODE="0666"

#Atmel AVR JTAGICEMKII rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2103", GROUP="users", MODE="0666"

#Atmel Corp. AVR ISP mkII
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2104", GROUP="users", MODE="0666"
4. save and quit.

5 restart all your stuff. reboot the pi, switch the pi off and on, unplug the programmer and plug it back in again, and restart udev for luck:

Code: Select all

sudo /etc/init.d/udev restart
And that's it! I can now use the arduino IDE on pi and my 2 dollar USBasp from ebay to program my homemade hackduino/ barebones atmel AVRchips. I've got a red LED flashing away on top of my fireplace now :)

edit: as you can see, it should hopefully work for other types of programmer too...
note: I may or may not know what I'm talking about...

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: SOLVED: USBasp + arduino IDE on Pi. help!

Sat May 18, 2013 11:45 pm

Ta :)
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
riffraff
Posts: 307
Joined: Tue Sep 27, 2011 3:17 am
Location: Newnan, Georgia, US

Re: USBasp + arduino IDE on Pi. help! (solved)

Sun May 11, 2014 2:25 am

@ toxibunny
I'm having similar issues, but none of that good stuff is working. BTW, what serial port was your USBASP reporting on? /dev/ttyACM0 or /dev/ttyS0 ?

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: USBasp + arduino IDE on Pi. help! (solved)

Mon May 12, 2014 12:14 pm

ah, I'm sorry, riffraff - I haven't the foggiest. It was a long time ago and a previous pi and sd card so I can't even go and check...
note: I may or may not know what I'm talking about...

User avatar
riffraff
Posts: 307
Joined: Tue Sep 27, 2011 3:17 am
Location: Newnan, Georgia, US

Re: USBasp + arduino IDE on Pi. help! (solved)

Thu May 22, 2014 2:24 am

Thanks anyhow. Like you, the situation magically resolved itself. After once using the "Upload using progtammer" option, it now uses it exclusively (strange, I edited that In the preferences file). Ummm, that and a small wiring error in my 10to6 pin adaptor... I think that one is more about vanity and new bifocals though.

Return to “Other projects”