OctoPrint and Firmware updates

Post Reply
User avatar
Master Maker
Posts: 222
Joined: Tue Jun 24, 2014 11:41 am
Location: Bunbury, WA

OctoPrint and Firmware updates

Post by seaton » Sun Mar 13, 2016 12:40 pm

I've been doing more and more printing with Octoprint on a RPi over WIFI so I run un-tethered from my PC for printing. However when I tweak or need to Re-Upload new firmware I need to unplug RPI and plug in my laptop, this can be a bit bothersome when its in another room.

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.


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

src_dir = Marlin
lib_dir = lib

platform = atmelavr
framework = arduino
board = megaatmega2560



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!


Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton

Re: OctoPrint and Firmware updates

Post by parkview » Mon Mar 14, 2016 9:01 pm

Nice one. That sounds very handy. So much to play with - not enough time...

Post Reply