platformio to the rescue:
Platformio is a command line utility that can build and flash arduino source code. It works well with any of the firmware's compiled from source, i.e. Marlin, Repeiter etc. In fact I don't even use the Arduino IDE at all now. I use VI (any text editor will work) to edit the Configuration.h and platformio to compile and upload it.
Find out more about platformio here: http://platformio.org/
Log into your RPi via ssh and issue the following commands
Code: Select all
# Install dependencies
sudo apt-get install libmpc-dev libelf1 libftdi1
# Install platformio
sudo pip install platformio
I keep a copy of my firmware in git to track changes etc so I checkout to a local directory on octopi, but you could just download and unzip your printer offical source file.
e.g.
Code: Select all
git clone https://git.com/madeinoz67/BigBox-dual-Marlin.git
To initially setup platformio. Create a file called platformio.ini in the root of your firmware directory directory and put the following into it.
This example below is for my new BigBox printer which runs a Rumba control board using Marlin firmware, Change the relevant fierlds and name to suit your printer.
Code: Select all
[platformio]
src_dir = Marlin
lib_dir = lib
[env:bigbox]
platform = atmelavr
framework = arduino
board = megaatmega2560
upload_port=/dev/ttyACM0
lib_install=7
to compile firmware
Code: Select all
pio run
then to upload to your board (make sure OctoPi is disconnected from printer via OctoPi web interface else it will fail because the serial port is in use)
Code: Select all
pio run -t upload
The first time you run pio it may ask you to install the avr tools and other dependencies. This should also automaticall download libraries for you as well! No need to pull out the laptop and fish around for the USB cable!
Stephen...