Yes, if you can get avrdude on the operating system you want to use to update the firmware and are comfortable running things from the command line.
So what operating system are you using ?
I run my dome via the INDI server on a Linux machine running Ubuntu 20.4.
I also have a Mac OSX machine that I use to connect to the Linux box via VNC.
Linux is fine.
Install AVR Dude (apt install avrdude).
As the arduino need a special "reset" to get in the programing mode I wrote a small python script to do that.
PORT = '/dev/cu.usbmodem1411'
serial_port = sys.argv
serial_port = PORT
# Arduino reset
ser = serial.Serial(serial_port, 1200, timeout=1)
except Exception, e:
if __name__ == "__main__":
save the above in /usr/local/bin as arduino_pro.py and make it executable (chmod a+x arduino_pro.py)
and a function in my .bashrc :
avrdude -C/etc/avrdude.conf -v -patmega32u4 -cavr109 -P$1 -b57600 -D -Uflash:w:$2:i
Then you call it :
prog_leonardo /dev/ttyUSB0 Rotator-3.3.0.hex
assuming your controller is on /dev/ttyUSB0 (change this to the proper port)
Thanks! PS: I did get AVRdude installed and working on my Mac as well.
the above also work on macOS (that's what I use .. as well as Linux ;) ).
Rodolphe, thanks for your help. I would like to use my Mac to install this. In the command "prog_leonardo /dev/ttyUSB0 Rotator-4.0.0.hex" I assume I need to have Rotator-4.0.0.hex saved somewhere special? Right now it's in my download folder. How do I point to that file in the above command?
Also - I used NANO to save that prog_leonardo function to my .bashrc_profile file. Is that correct?
I have the function in my .zshrc (or .bashrc depending on what version of macOS you're on) and it uses my Arduino avrdude and the python script is in my dev stuff
(it would also work with avrdude installed via Brew or Macports).:
/Applications/Tools/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Tools/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P$1 -b57600 -D -Uflash:w:$2:i
you can download the firmware there :
The just get the actual device on which the arduino show up ( /dev/cu.usbmodem144201 for in my case but this port will be different on yours depending on which usb port it's plugged in).
Then I call the function from zsh/bash from inside the directory where the firmware is :
prog_leonardo /dev/cu.usbmodem144201 Rotator-4.0.0.hex
this will reset the arduino and flash the new version of the firmware.
Do the same thing for the shutter but with Shutter-4.0.0.hex
Ok, I'll give that a shot tonight. I jut came back from the observatory where I had a problem. My Mac wasn't recognizing the rotator or shutter at all. I checked in my system profile on the Mac and it wasn't showing any USB devices connected. ARGH!
This is weird. What version of macOS are you running as at some point there was an issue with Arduino on macOS on Catalina (which has been fixed).
And it works fine with Big Sur 11.1 (juts tested an arduino leonardo on mine).
I'm not a programmer - so your new function is too confusing for me. I don't know how your comment "it uses my Arduino avrdude and the python script is in my dev stuff" would translate to my system. I don't have "dev stuff" so all those file addresses won't on my Mac.
I am using Catalina.
And are you all updated to 10.15.7 ? I think this was fixed in 10.15.4
On my Mac I have installed the Arduino IDE .. which is what my "it uses my Arduino avrdude and the python script is in my dev stuff" comment means.
Aka.. that how avrdude is installed for me. I also have a macports version of it installed and you could use this and change the path to avrdude and its default config.
To make my life easier, I downloaded it too, and copied it to Applications/Tools so I can use your script as is.
Ok, getting closer! I have the USB port working.
But when I run "rduino_pro.py" I get an error that there is no module named serial.
peterkennett@Peters-Air bin % arduino_pro.py
Traceback (most recent call last):
File "/usr/local/bin/arduino_pro.py", line 6, in <module>
ImportError: No module named serial
And what does this mean: "Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding"
You get this error because the Arduino didn't reset to programing mode. So avrdude doesn't get an answer from the butterfly boot loader.
You need to instal python serial library.. which is not simple if you're using the system python.
I'll need to see how to do that as I use macports.
you might be able to do : sudo /usr/bin/pip3 install serial
pip3 install pyserial
Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
|████████████████████████████████| 90 kB 937 kB/s
Installing collected packages: pyserial
Successfully installed pyserial-3.5
Downloading https://files.pythonhosted.org/packages/1f/51/6a260c498162c37d0759f3759b7647a10d8d30caba1cfc9aa4b5b1f0d08b/serial-0.0.97-py2.py3-none-any.whl (40kB)
|████████████████████████████████| 40kB 461kB/s
Collecting pyyaml>=3.13 (from serial)
Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)
|████████████████████████████████| 276kB 97kB/s
Collecting iso8601>=0.1.12 (from serial)
Collecting future>=0.17.1 (from serial)
Downloading https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829kB)
|████████████████████████████████| 829kB 232kB/s
Building wheels for collected packages: pyyaml, future
Building wheel for pyyaml (setup.py) ... done
Created wheel for pyyaml: filename=PyYAML-5.3.1-cp38-cp38-macosx_10_14_6_x86_64.whl size=44627 sha256=49be702d3b4599bf2b222013be5bc452891c8b06362ba4a0ff7883cb82fe8146
Stored in directory: /Users/peterkennett/Library/Caches/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd
Building wheel for future (setup.py) ... done
Created wheel for future: filename=future-0.18.2-cp38-none-any.whl size=491057 sha256=fda9e3851ea0edb87cabe1b958dee6c92bd9994dc9c9bcfe9106c265b0464af0
Stored in directory: /Users/peterkennett/Library/Caches/pip/wheels/8b/99/a0/81daf51dcd359a9377b110a8a886b3895921802d2fc1b2397e
Successfully built pyyaml future
Installing collected packages: pyyaml, iso8601, future, serial
Successfully installed future-0.18.2 iso8601-0.1.13 pyyaml-5.3.1 serial-0.0.97