eePe and Ubuntu 12.04 - Permission problems

How to use eePe
User avatar
erazz
9x Developer
Posts: 682
Joined: Tue Dec 27, 2011 6:25 pm
Country: -
Location: NJ-USA
Contact:

eePe and Ubuntu 12.04 - Permission problems

Post 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.
Z

BEWARE - WE ARE IN THE AIR!!!
What goes up... Should be controlled by a 9X!

User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: eePe and Ubuntu 12.04 - Permission problems

Post by Romolo »

Yes your programmer works, you will have to set the port as /dev/ttyUSB0 or something similar
(it depends on your peripherals)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post by jhsa »

That is in eepe I suppose?? on the fiels where you choose the programmer? Or am I competly wrong? :)
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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.
Last edited by Romolo on Sat May 05, 2012 12:10 am, edited 1 time in total.

User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Peter
Posts: 232
Joined: Thu Dec 29, 2011 8:45 pm
Country: -
Location: Zuid-Holland

Re: eePe and Ubuntu 12.04 - Permission problems

Post by Peter »

Great, works like a charm!

Btw, I like 12.04. Works well.


Verstuurd van mijn GT-I9100 met Tapatalk
User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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.
RKW
Posts: 1
Joined: Tue Feb 18, 2014 3:45 pm
Country: -

Re: eePe and Ubuntu 12.04 - Permission problems

Post by RKW »

Thank you for your help with the permission problem. It was quick and it worked.

RKW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: eePe and Ubuntu 12.04 - Permission problems

Post by Flaps 30 »

ttyS0 is a serial port. Is that what the STK500 device uses?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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).
User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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 
Last edited by rperkins on Sat Dec 13, 2014 7:33 pm, edited 1 time in total.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
=========================================================================
========
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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? :mrgreen:

Thanks
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post by jhsa »

I did a bit different..

Code: Select all

sudo adduser joao dialout
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? :o :shock:

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
Attachments
Screenshot - eepe error.jpg
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: eePe and Ubuntu 12.04 - Permission problems

Post by MikeB »

PM me the hex file, I'll see what it looks like.
What version of AvrDude have you got on linux?

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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....
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: eePe and Ubuntu 12.04 - Permission problems

Post 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

Post Reply

Return to “eePe”