Hi experts here,
I am in the process of interfacing an Arduino Pro Mini 8MHz 3,3V with a Raspberry Pi over GPIO RX-TX (/dev/ttyAMA0).
The Pro Mini should also be reprogrammable using the Arduino-IDE.
That currently works well.
But "in fine" the whole hardware will be remote and I will control everything using VNC.
The problem is that to program the Pro Mini, one must push reset at the right time. If everything is remote, I won't be there to do that.
So I searched for DTR Autoreset and found that solution.
It looks quite straightforward, but I have got a bench of showstoppers:
wget https://raw.github.com/deanmao/avrdude-rpi/master/autoreset
wget https://raw.github.com/deanmao/avrdude-rpi/master/avrdude-autoreset
sudo cp autoreset /usr/bin
sudo cp avrdude-autoreset /usr/bin
sudo mv /usr/bin/avrdude /usr/bin/avrdude-original
sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude
sudo chmod 755 /usr/bin/avrdude-autoreset
sudo chmod 755 /usr/bin/autoreset
It begins with "sudo mv /usr/bin/avrdude /usr/bin/avrdude-original"
The 1st problem is that the current Arduino IDE is installed at /home/pi/arduino-1.8.8 and averdude exists only at /home/pi/arduino-1.8.8/hardware/tools/avr/bin.
So I made a first attempt to replacing "/usr/bin" with /home/pi/arduino-1.8.8/hardware/tools/avr/bin in all instuctions
I had to make the path replacement in avrdude-autoreset as well.
Upon attempting to upload my sketch I got:
sh: 1: autoreset: Permission denied
strace: |autoreset: Broken pipe
avrdude-original: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/pi/arduino-1.8.8/hardware/tools/avr/etc/avrdude.conf"
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
User configuration file is "/home/pi/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
strace: |autoreset: Broken pipe
Using Port : /dev/ttyAMA0
Using Programmer : arduino
Overriding Baud Rate : 57600
strace: |autoreset: Broken pipe
[i][error 7 times repeated][/i]
strace: |autoreset: Broken pipe
avrdude-original: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe0
[i][error 8 times repeated][/i]
avrdude-original: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0
avrdude-original done. Thank you.
strace: |autoreset: Broken pipe
I did read that the Arduino IDE should be invoked with sudo in order to get the rights to change the GPIO states
so it invoked it with
~/arduino-1.8.8 $ sudo bash arduino
But then it did not compile any more arguing that libraries were missing.
I had to replace the #include "library" statments with quotes with #include statements with brackets.
Then I could compile, but still got the "permission denied" and "broken pipe" errors:
sh: 1: autoreset: Permission denied
strace: |autoreset: Broken pipe
[i]Error repeated 10 times[/i]
strace: |autoreset: Broken pipe
avrdude-original: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe0
[i]Error repeated 10 times[/i]
avrdude-original: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0
strace: |autoreset: Broken pipe
An error occurred while uploading the sketch
Now i got cueless...
Any advice is highly appreciated.
Regards
Laszlo