Page 1 of 2
eePe and Ubuntu 12.04 - Permission problems
Posted: Thu May 03, 2012 11:00 pm
by erazz
Hi Guys,
Apparently udev has been changed a bit and the rules file that we use to allow non-root usage of AVRDUDE needs to change.
The use of the keyword SYSFS has been depreciated and replaced by ATTR. Upshot of this is that the rule we put in place doesn't work and we need to run AVRDUDE as root.
Happily the fix is easy:
press alt+F2 or open a terminal and write:
Code: Select all
gksu gedit /etc/udev/rules.d/10-usbasp.rules
This will open the rules file.
Now we should edit it so instead of:
Code: Select all
SUBSYSTEM=="usb", SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="05dc", GROUP="adm", MODE="0666"
We should have:
Code: Select all
SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="05dc", GROUP="adm", MODE="0666"
(I replaced the two occurences of SYSFS with ATTR).
Now close the editor and either restart udev.
You can do this by logging out and back in or alternatively, press alt+F2 (or in a terminal) and write "gksu restart udev" (without the quotes)
That's it. AVRDUDE should be as good as new.
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri May 04, 2012 1:01 pm
by jhsa
Hi Erazz, I've just installed Ubuntu Studio on my computer.. for working with music recording it is WAY better than windows..
I still can't make the complete move from windows because I still need to make a few things work.
Anyway, I would like to install eepe on Ubuntu. is there a good tutorial somewhere? I'm just a beginner to Linux. Also the programmer I use is the " mySmartUSB light" I think it is a STK500. Do you know if this runs on Ubuntu?
Sorry If my questions sound a bit stupid, but I'm very new to this stuff.
Thanks,
João
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri May 04, 2012 6:14 pm
by Romolo
Yes your programmer works, you will have to set the port as /dev/ttyUSB0 or something similar
(it depends on your peripherals)
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri May 04, 2012 7:12 pm
by jhsa
That is in eepe I suppose?? on the fiels where you choose the programmer? Or am I competly wrong?
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri May 04, 2012 7:35 pm
by Romolo
Yes there: in the port field of eepe in the avrdude configuration dialog.
To understand what to write in that field, from a terminal give the following command: "sudo dmesg" (without ") right after you have connected the programmer.
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri May 04, 2012 8:25 pm
by jhsa
I will do that thanks.. I don't think I will upgrade to 12.04 just yet though.. still too new and might have a few bugs.. Stayin with 11.10 for a little while..
I'm bookmarking this page for future reference..
Thanks again
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri May 04, 2012 10:23 pm
by Peter
Great, works like a charm!
Btw, I like 12.04. Works well.
Verstuurd van mijn GT-I9100 met Tapatalk
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sun Aug 26, 2012 11:07 pm
by Flaps 30
Thanks for this.. I have just done a fresh install of Ubuntu 12.04 and this problem reared its head.
This was the output using the terminal:-
trish@trish-desktop:~$ avrdude -c usbasp -p m64
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
avrdude done. Thank you.
The above was the same as what I got using EePe.
So the next move was to get permission (using sudo and my password) to use avrdude.
trish@trish-desktop:~$ sudo avrdude -c usbasp -p m64
[sudo] password for trish:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9602
avrdude: safemode: Fuses OK
avrdude done. Thank you.
As you can see all was well.
I followed the instructions above. I found that the rules file was empty, which I found a bit strange. All I did was to add the line you mentioned and that was it.
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Mon Mar 10, 2014 11:58 pm
by RKW
Thank you for your help with the permission problem. It was quick and it worked.
RKW
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Thu Dec 11, 2014 10:26 am
by jhsa
Hi Guys, I'm having the following error in eepe when I try to read my radio's memory. I'm on the latest ubuntu studio. It looks like avrdude doesn't have permission to use the com port.
Code: Select all
=================================================================================
Started AVRDUDE
/usr/bin/avrdude -c stk500v2 -p m128 -U eeprom:r:/tmp/temp.hex:i
=================================================================================
avrdude: ser_open(): can't open device "/dev/ttyS0": Permission denied
avrdude done. Thank you.
=================================================================================
AVRDUDE done - exit code 1
=================================================================================
Any ideas? Thank you
João
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri Dec 12, 2014 12:07 am
by Flaps 30
ttyS0 is a serial port. Is that what the STK500 device uses?
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri Dec 12, 2014 12:25 am
by jhsa
As far as I know the stk500 is a normal programmer like the usbasp.. I did manage to make the usbasp work, but my favorite prog is the other.. It might need a udev rule for it?
The programmer is a "mySmartUSB Light"
ABBC3_OFFTOPIC
Glad to see you on the forum. It's been a while. By the way, I just ordered some parts to try to replicate your work with the hall effect sensors.. As I have 2 9x gimbals that I replaced with Taranis ones.. Maybe soon I will be replacing the taranis gimbals with them, who knows?
Thanks for your help..
João
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Fri Dec 12, 2014 2:13 pm
by Kilrah
If your programmer uses a virtual com port it's likely not ttyS0. You need to find what port it uses and specify it manually (can't help about how to find out the port, I know it's not straightforward on linux but not much more).
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 12:58 am
by Flaps 30
Hope that the hall effect works for you. I saw that the magnets had come down in cost since I bought them.
I agree with Kilrah. ttyS0 is an RS232 Serial port and not a USB port that your STK500 is using.. I know it is unlikely that it is wrong. Have you ensured that the configuration setup in Eepe is set for USB as a port for the programmer?
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 2:41 am
by jhsa
I think I tried also with USB and it doesn't work.. will try again to make sure and will report back. Thanks
João
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 4:47 am
by Kilrah
I remember things like "/dev/tty.SLAB_USBtoUART" being used for some of those USB-serial interfaces. Depends on device and driver, which is why it's a pain to find out.
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:10 pm
by rperkins
type 'dmesg' after plugging device in and see how your device is detected.
/dev/ttyUSB0
/dev/ttyACM0
etc, etc,etc
and are you using a real stk500v2 or an 'arduino' or other device emulating the stk. IIR there were some quirks at one time for the arduino
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:21 pm
by jhsa
Thanks for your help..
It's on ttyUSB0
João
Code: Select all
45.370533] usb 2-1.6: Product: myAVR - mySmartUSB light
[ 45.370534] usb 2-1.6: Manufacturer: Silicon Labs
[ 45.370535] usb 2-1.6: SerialNumber: mySmartUSBlight-0001
[ 45.383558] usbcore: registered new interface driver usbserial
[ 45.383567] usbcore: registered new interface driver usbserial_generic
[ 45.383572] usbserial: USB Serial support registered for generic
[ 45.402601] usbcore: registered new interface driver cp210x
[ 45.402610] usbserial: USB Serial support registered for cp210x
[ 45.402634] cp210x 2-1.6:1.0: cp210x converter detected
[ 45.475220] usb 2-1.6: reset full-speed USB device number 7 using ehci-pci
[ 45.561577] usb 2-1.6: cp210x converter now attached to ttyUSB0
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:32 pm
by rperkins
great.
then for proper permissions I believe the user should be a member of the 'dialout' group'
example of ls command used to determine permissions of the virtual com port
Code: Select all
rperkins@htpc:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Nov 30 00:38 /dev/ttyUSB0
example output of the 'groups' command showing the groups the current user belongs to
Code: Select all
rperkins@htpc:~$ groups
rperkins adm dialout cdrom sudo dip plugdev lpadmin sambashare libvirtd
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:32 pm
by jhsa
Changed the port in eepe / extra arguments / -P /dev/ttyUSB0
and still get this error:
Started AVRDUDE
/usr/bin/avrdude -c stk500v2 -p m128 -P /dev/ttyUSB0 -U eeprom:r:/tmp/temp.hex:i
=================================================================================
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied
avrdude done. Thank you.
=================================================================================
AVRDUDE done - exit code 1
=========================================================================
========
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:35 pm
by jhsa
rperkins wrote:great.
then for proper permissions I believe the user should be a member of the 'dialout' group'
example of ls command used to determine positions of the virtual com port
Code: Select all
rperkins@htpc:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Nov 30 00:38 /dev/ttyUSB0
example output of the 'groups' command showing the groups the current user belongs to
Code: Select all
rperkins@htpc:~$ groups
rperkins adm dialout cdrom sudo dip plugdev lpadmin sambashare libvirtd
Randy, I do apologize but I know next to nothing about this linux terminaal rain dance
Do you know where should I click to fix it?
Thanks
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:36 pm
by jhsa
Code: Select all
joao@joao-Ubuntu:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Dez 13 16:29 /dev/ttyUSB0
Code: Select all
joao@joao-Ubuntu:~$ groups
joao adm cdrom sudo audio dip plugdev lpadmin sambashare
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:40 pm
by rperkins
Looks like you did well generating the output of my examples. great.
I searched this up for a GUI solution. I'll also follow with the command line solution for completeness
by default ubuntu does not have a GUI based mechanism to modify the groups that a user belongs to
here is the workaround which is adding a small application to modify the group membership
http://askubuntu.com/questions/66718/ho ... and-groups
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 3:46 pm
by rperkins
the CLI solution for adding an existing user to an existing group.
Be sure to replace the username listed here 'rperkins' with the username that you are using.
Be sure to replace the group name listed here 'dialout' with the group you want to be a member of
( in this case the group stays the same because we want to be part of the 'dialout' group )
The reason it is called dialout is historically serial ports were used with modems and this allowed the sysadmin to tailor what users were allowed to 'dialout' using the modem.
Code: Select all
rperkins@htpc:~$ sudo addgroup rperkins dialout
Adding user `rperkins' to group `dialout' ...
Adding user rperkins to group dialout
Done.
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 4:28 pm
by jhsa
I did a bit different..
after logging out and in again, the progammer is recognized if I put -P /dev/ttyUSB0 in eepe's extra arguments..
The problem is that now I'm getting a readingt error.. If I try to read the eeprom it gives the error in the picture.
If i review the output from avrdude in eepe I get the following which seems to be ok?
Code: Select all
=================================================================================
Started AVRDUDE
/usr/bin/avrdude -c stk500v2 -p m128 -P /dev/ttyUSB0 -U eeprom:r:/tmp/temp.hex:i
=================================================================================
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9702
avrdude: reading eeprom memory:
Reading | ################################################## | 100% 2.82s
avrdude: writing output file "/tmp/temp.hex"
avrdude done. Thank you.
=================================================================================
AVRDUDE done - SUCCESSFUL
=================================================================================
Thanks
João
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 4:30 pm
by MikeB
PM me the hex file, I'll see what it looks like.
What version of AvrDude have you got on linux?
Mike.
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 4:35 pm
by jhsa
Doesn't eepe for linux come with an older version of avrdude? I pointed the field in the "Burn menu" to the avrdude inside eepe installation folder..
João
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 6:29 pm
by MikeB
The hex file looks to only have everyother byte in it, then the first 2K is repeated.
Looks like an AvrDude problem. I'm not sure I can run it myself in the virtual box I use to run linux but I'll give it a try later tonight.
Just checking that you did set eepe for the '128 in both preferences and the burn configure?
Mike.
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 6:45 pm
by rperkins
Yes there is an issue with avrdude on the latest versions of linux.
What is happening now is not relevant to the title of this thread which is about Ubuntu 12.04 permissions.
anyway.
I never tested a eeprom file for the error but this is probably related.
viewtopic.php?f=94&t=5036
try to program a regular flash file and see if the error fits.
Note this has been resolved in the dev copy of avrdude but I dont believe a new release has happened yet
to find your ubuntu revision
Code: Select all
rperkins@htpc:~$ cat /etc/issue
Ubuntu 14.04.1 LTS \n \l
to find your avrdude revision
Code: Select all
rperkins@htpc:~$ avrdude -v
avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
....snip....
Re: eePe and Ubuntu 12.04 - Permission problems
Posted: Sat Dec 13, 2014 6:48 pm
by rperkins
jhsa wrote:Doesn't eepe for linux come with an older version of avrdude? I pointed the field in the "Burn menu" to the avrdude inside eepe installation folder..
João
I always thought the linux version of eepe did not include avrdude. that wouldnt be a good idea anyway. 32vs64 bit issues. shared library vs static builds. being sure that the static version used the static versions config file . etc,etc,etc