Looks like avrdude failed and did not unexport GPIOs. Is that true? If so: any chance to know how it failed? (error message, sketch being uploaded, anything that could help to reproduce the error)
Upload the YunSerialTerminal sketch so you can access to the Linux console through the Arduino Serial Monitor. Then write these commands line by line in the serial monitor and press enter.
Angelo9999:
Upload the YunSerialTerminal sketch so you can access to the Linux console through the Arduino Serial Monitor. Then write these commands line by line in the serial monitor and press enter.
While this will generally work, there's a catch-22 if you want to issue these commands because you can't upload a sketch (which is the topic of this thread.)
You can also use SSH to connect to the Yun over the network (wired or wireless) then log in and enter these command there.
But you should still be able to connect via SSH and issue the commands that way. I don't see that it's strictly necessary to upload the serial terminal sketch in this case, although it is very helpful in cases where there is no network connectivity.
Maybe it's just because I've had some dropped character issues with the serial terminal sketch, and because I detest the Arduino IDE's serial monitor. (Even using PuTTY to talk to the serial terminal sketch I get dropped characters, which makes using something like nano very difficult - I don't have such issues using SSH.) I see the YunSerialTerminal sketch as a last resort sort of utility.
sudo avrdude -p atmega328p -C ~/avrdude_gpio.conf -c orangepi_pc -v
avrdude: Version 6.1, compiled on Jul 23 2016 at 15:41:42
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/kont/avrdude_gpio.conf"
User configuration file is "/home/kont/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : unknown
Using Programmer : orangepi_pc
Can't export GPIO 12, already exported/busy?: Device or resource busy
avrdude done. Thank you.
I tried to unexport the required GPIOs and did it successfully but still get the same response
Sorry I just realized the topic is about Arduino Yun.
I'm working directly with Atmega328p and OrangePi GPIO.
I managed to flash Arduino Uno with arduino programmer in avrdude and got the issue above when I tried linux_gpio programmer.
If my question is not relevant feel free to remove it.
I came here looking for the solution to the same problem, perhaps different cause. I had manually installed the "Linux Arm (experimental)" version, which as of 2016, is the 1.6.12 version of the Arduino IDE on a Raspberry Pi.
I was trying to program the RasPiO Duino RasP.iO | duino (it uses SPI GPIO bit-banging ports)
Sure enough, the version of avrdude (Version 6.3, compiled on Sep 12 2016 at 15:28:39) that is used by the latest stable release of the Linux Arm (experimental) Arduino IDE had problems with the GPIO settings.
The short answer is that I used a symlink to force the Arduino IDE to use a different version of avrdude (specifically Version 6.1, compiled on Jul 7 2015 at 13:18:47).
See ./hardware/tools/avr/bin/avrdude (I used /usr/bin/avrdude instead)