This would be sweet feature.
I agree, I'm a bit worried though about the security implications of this. I think @hendricksonrw and me talked about that a couple of months back too...
Maybe in order to activate a hex file that has been uploaded to the client, you need to re-enter the password, or another admin-level password?
Sounds like an idea
Would love it.
Best Regards
Davide Ardizzoia
I do this already, and it wasn't so difficult to set up. The program I am using is called Ino, and I can edit, compile, and upload firmware directly from an ssh instance. There was some minor hacks involved to get it to work, but it is spelled out in the readme file I keep on the firmware repo: https://github.com/starno/Ino-Delta-Marlin It's not as nice as being able to access it from Octoprint directly, but the ability to keep an instance of firmware local to each machine on each machine has been a real game changer for me.
I just run the Arduino IDE on the PI via VNC. A bit slow but otherwise fine.
This is what I posted to the octopi issue list about what I needed to setup to update Marlin straight from Raspi
sudo pip install ino
sudo apt-get install arduino
cd Marlin-Marlin-v1
ln -s Marlin src
ino build -m mega2560
ino upload -p /dev/ttyACM0 -m mega2560
Hi everybody,
I too would be interested in this and I am quite willing to implement this myself as a system command.
Now, as mentioned above, this is already possible by following this simple procedure:
The way I see it implemented as a system command takes away a lot of the hassle:
Note that I personally prefer to compile the firmware on a PC (my Ubuntu workstation) where I can keep any changes in git/etc rather than compiling it on the RPi OctoPrint server (which at this stage I consider to be a dedicated machine).
What does everybody think about this proposed solution?
I keep my files on another machine and have a simple script that mounts the file system, compiles it and downloads it with ino and then un-mounts the file system. My intention was to run it from the system menu but it didn't work, probably due to running as the wrong user. I decided I wanted to see the output from ino anyway, so I just SSH in and run it.
Since downloading takes a substantial time I don't think takes much longer than it does with the IDE on my server.
Closer integration with OctoPrint would be nice but the current system I use is fairly painless. On one machine I have to remember to disconnect in OctoPrint to free the USB port, but on another I connect OctoPrint via the serial port on the expansion connector, so the USB connection is dedicated to firmware updates.
@nophead
Hi Chris
I definitely think your method is very practical but it assumes an infrastructure is already in place (file server, proper network mounts, etc). For the occasional firmware upgrade I have suggested a simple recipe (4 lines) in a Quick Tip in the wiki, which is relatively safe and guaranteed to work. It can be found here: https://github.com/foosel/OctoPrint/wiki/Assorted-OctoPrint-Quick-Tips#flashing-a-new-arduino-firmware-directly-from-your-octoprint-host
@AndrewBCN Thanks! I was able to update Marlin using the Pi with your help. I made a little script which stops OctoPrint, updates and restarts. I did have to change ttyUSB0 to ttyACM0, and I'm not enough of a Pi/Linux guy to know why, but it worked with that change. I also used three -v instead of four because I like a progress bar, plus the constant readout slows the process down.
@dansantee You are welcome! Btw I have edited the wiki and added your two tips (with proper attribution).
Gina, you may want to close this issue perhaps, since the QuickTip is easy to use and solves the problem?
For those who want to compile/upload from the raspberrypi. I managed to do it like this
Install the packages, arduino libraries, make (doublecheck) and pyserial (should be installed if already running OctoPrint). And clone the sources, in my case I tested Repetier Firmware devel branch.
I did not use arduino-mk from Raspbian repo because was outdated and didn't compile.
sudo apt-get install -y arduino make pyserial
cd ~
git clone https://github.com/sudar/Arduino-Makefile.git
git clone https://github.com/repetier/Repetier-Firmware.git
cd Repetier-Firmware
git checkout work092
Create the makefile, if you are using a different board try make show_boards
cd ~/Repetier-Firmware/src/ArduinoAVR/Repetier
cat > Makefile <BOARD_TAG = mega2560
ARDUINO_PORT = /dev/ttyACM*
include ~/Arduino-Makefile/Arduino.mk
EOT
Then edit/replace configurations.h and then verify make or compile/upload make upload
Just remember to release serial communication from Octoprint. (maybe sudo service octoprint stop before and sudo service octoprint start after flashing.
Isn't this resolved by https://plugins.octoprint.org/plugins/firmwareupdater/
yeah, at least partially (the plugin does not support every single board available right now out of the box),
But as long as the firmware can be uploaded with avrdude on the board, it's only a matter of adding one/two lines in the plugin HTML template (that's what I did for my old sanguinololu board and it works well)
Compilation of the firmware still needs to be done separetly
@foosel I think this can be closed
Ah, good point!
Most helpful comment
This is what I posted to the octopi issue list about what I needed to setup to update Marlin straight from Raspi