arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.17k stars 7.02k forks source link

Making sure the Linux installation registers the programmers to avoid using SUDO when burning a bootloader #1786

Open dcuartielles opened 10 years ago

dcuartielles commented 10 years ago

The current linux installer (not the Arduino one, but the one included in the software repository) includes a tool for registering the user in dialout, so that it is possible to upload without having to make that operation from command line.

I would suggest including that tool in the current linux installer as well as a script to do what is suggested at the following website:

http://academy.cba.mit.edu/content/tutorials/akf/embedded_programming_arduinoIDE.html

That registers usbtinyisp to work for the dialout group, what in turn, registers the user to be able of using it without SUDO. That should be done for all the programmers shipped by default with the IDE

cmaglie commented 10 years ago

@dcuartielles I don't understand which "linux installer" you're referring to, may you be more specific?

dcuartielles commented 10 years ago

You should run a fresh install of Ubuntu 13.xx and install Arduino from the repository. After finishing the installation, a pop-up dialog informs that the system can add you, at will, to the dialup group.

We need that same installer, but adding the option to include all the programmers to the dev-rules.

Worst case, this could be solved using a tool in the IDE and letting the users know they should run it once after installing.

This feature is crucial for Linux users not familiar to CLI, a growing number among the educational institutions.

/d El 05/01/2014 09:09, "Cristian Maglie" notifications@github.com escribió:

@dcuartielles https://github.com/dcuartielles I don't understand which "linux installer" you're referring to, may you be more specific?

— Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/issues/1786#issuecomment-31598861 .

matthijskooijman commented 10 years ago

If you are saying that the Ubuntu installation process should add extra "dev-rules" (did you mean udev here?), then you should probably be talking to the Ubuntu folks, they'll be able to actually modify the Ubuntu package.

If you're saying that the stuff from the Ubuntu package should be included in the official Arduino Linux download, then this is the place to be. If so, can you be even more specific in what you want to be included?

dcuartielles commented 10 years ago

Hej,

I'm obviously talking about the second case (running an equivalent action in the official distribution to emulate the actions taken in the Ubuntu installer). I also would like to see the udev rules added to that installer, something the Ubuntu one is not including.

/d Arduino Co-founder El 05/01/2014 11:26, "Matthijs Kooijman" notifications@github.com escribió:

If you are saying that the Ubuntu installation process should add extra "dev-rules" (did you mean udev here?), then you should probably be talking to the Ubuntu folks, they'll be able to actually modify the Ubuntu package.

If you're saying that the stuff from the Ubuntu package should be included in the official Arduino Linux download, then this is the place to be. If so, can you be even more specific in what you want to be included?

— Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/issues/1786#issuecomment-31600825 .

matthijskooijman commented 10 years ago

Ok, thanks for clarifying.

However, looking at the download page, it seems there is no particular installer for Linux, just tarballs containing all the relevant binaries. So for including this in an install script, we should first build a Linux installer, which might not be the way to go? Additionally, the exact steps to take / udev rules to add might vary by distribution, so ideally a distribution would package Arduino themselves and take care of this.

Perhaps a useful middle-way would be to let Arduino do a permission check and offer advice to the user to help diagnose problems? e.g., when the avrdude call fails and /dev/ttysomething is not readable, report this fact to the user. If the owning group of the file is not "root" and the group-write bit is set, also suggest that adding the user to that group might help?

dcuartielles commented 10 years ago

In an older Processing version, there was an IDE plugin for the Mac version that was actually adding the proper permissions to the users so that they could make use of the serial port.

At this point, I think this would be a very elegant solution, a tool that could be included in the Tools folder so that it would show up in the menu. It should be added only to the linux packages and it could call the CLI sending whatever commands were needed in each OS flavour to add the user to dialup as well as adding the different programmers to the udev ruleset.

The tool can be produced in the same way tools are produced for Processing (check: http://wiki.processing.org/w/Create_Tools ) and a bash script could be called depending on the actual OS. The different scripts could be contributions by users.

Lauszus commented 10 years ago

@dcuartielles maybe these are the files you are looking for: https://github.com/arduino/Arduino/pull/1572/files#diff-10?

dcuartielles commented 10 years ago

that code i adding the user to dialup for sure, but it is still not registering the programmers so that they can be used by the dialup users, that is the other half of the problem.

Also, it is issuing a perl command, I am not sure perl comes by default with all the linux distros, it does in Ubuntu though.

It is a beginning, but solves only 25% of the problem. Lacks:

Thanks for pointing it out, I hadn't seen it :-)

/d

On 14 January 2014 22:56, Kristian Sloth Lauszus notifications@github.comwrote:

@dcuartielles https://github.com/dcuartielles maybe these are the files you are looking for: https://github.com/arduino/Arduino/pull/1572/files#diff-10?

— Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/issues/1786#issuecomment-32311821 .

Avamander commented 4 years ago

It wouldn't hurt to warn users that there are missing udev rules for different programmers. Though, this should really be something bundled with distributions.