Is there a way to program chip using arduino IDE without having to be root? - Page 1
Forum section: electronics / general

author: Red Squirrel
author_rank: Super Contributor
timestamp: July 11, 2016, 05:40:38 am
content: I am using the arduino IDE to program a chip using an USBTinyISP but it refuses to work unless you're root. This causes all sorts of permission issues because the folder all my files are in have different permissions than the sketch and because of Linux's limited permission system it's not as simple as just adding two users to both have permissions to the folder. You'd think root would just have access to everything, but NFS does weird stuff. All my data is stored on NFS, not locally.So long story short, is there a way to set it up so I can program using the actual user that I login with? I always end up having to execute the IDE as root so that it lets me program.OS is Linux Mint 17.1.As a side note, what commands does the arduino IDE invoke to program, is there a way to find out? I imagine it depends on the chip and such. It would be easier if I can just make a script to run that. Optionally I could just have that script run as root but still edit the file as my regular user.

author: sleemanj
author_rank: Super Contributor
timestamp: July 11, 2016, 05:47:50 am
content: The first google resulthttps://learn.adafruit.com/usbtinyisp/avrdude#for-linux

author: Red Squirrel
author_rank: Super Contributor
timestamp: July 11, 2016, 06:02:15 am
content: Which of those lines is suppose to work for mint 17.1? I tried all 3 but still get the error. Does it matter what I name the file, or what the extension is? Does it require a reboot or anything like that? (hopefully not I have too much stuff open)Edit: Also I think I recall reading somewhere that my user has to be in the "dialout" group. I had previously did that so I am in that group. I'm trying the last line in that tutorial as I figure Mint 17.1 probably counts as "recent ubuntu". I also found a command "udevadm control --reload-rules" that has to be run after making changes. So I tried that as well.Edit2: So I bit the bullet and rebooted. Still not working. Anything else I can try?

author: Red Squirrel
author_rank: Super Contributor
timestamp: July 11, 2016, 06:26:16 am
content: Got it!Turns out I have to name the file with the .rules extension.

author: sleemanj
author_rank: Super Contributor
timestamp: July 11, 2016, 06:39:40 am
content: Quote from: Red Squirrel on July 11, 2016, 05:40:38 amFile > Preferences > Show verbose output during: compilation, uploadCommands executed are placed in the console output area.

author: Red Squirrel
author_rank: Super Contributor
timestamp: July 11, 2016, 06:44:17 am
content: Thanks! That's great to know. I eventually want to just script this so it's easier. i eventually want to learn to code the chips without relying on arduino, but baby steps.Just so much easier to find info online by searching "[what I want to do] arduino".

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 11, 2016, 09:13:36 am
content: Quote from: Red Squirrel on July 11, 2016, 05:40:38 amif its the same as windows, and it should be. Arduino ide will invoke avrdude.exe with arguments like board/chip type (selected from menu),port number,temp file path to hex output and such.. which in turn the avrdude will program the board through the comm channel,usb or what..to see how exactly the argument looks like, you can build dummy middleman avrdude and temporarily replace the original avrdude,otherwise look out for help file that i'm not sure where. fwiw..

author: sleemanj
author_rank: Super Contributor
timestamp: July 11, 2016, 09:22:33 am
content: Quote from: Mechatrommer on July 11, 2016, 09:13:36 amOr, as I wrote above, turn on verbose output, then you see what commands get run, with all their arguments. No middleman required.

author: technix
author_rank: Super Contributor
timestamp: July 15, 2016, 06:48:35 pm
content: Code:sudo addgroup --system usbecho SUBSYSTEMS==\"usb\", GROUP=\"usb\", MODE=\"664\" | sudo tee -a /etc/udev/rules.d/00-usb.rulesfor each in usb tty dialout; do sudo usermod -aG $each $(whoami); donesudo rebootCreate a new system group called "usb", add yourself into it (as well as groups "tty" and "dialout" so you can access serial ports too,) add a udev rule to make all USB devices owned by the "usb" group, and finally reboot to make it all work.

author: Red Squirrel
author_rank: Super Contributor
timestamp: July 16, 2016, 02:29:13 am
content: Ohhh I like that one better, so it will work for everything USB and not just that specific one? I'll have to try that out.

author: Mr J
author_rank: Regular Contributor
timestamp: July 16, 2016, 02:42:49 am
content: I just ran into this myself with Ubuntu 14 not sure about mint, there are a couple of ways depending on versionhttp://mightyohm.com/blog/tutorials/avr-toolchain-installation/linux/for (version 10 and lower)http://feedback.codebender.cc/knowledgebase/articles/387072-how-to-use-usbtinyisp-programmer-in-linux(Version 12 and 14 and 16)Mr J, N1IR

author: Mr J
author_rank: Regular Contributor
timestamp: July 16, 2016, 02:54:37 am
content: yea ever since Arduino 1.0 you need to change permission to access the USB