How Do I Compile Firmware to Upload Through Octoprint
I thought this would exist useful to document here, every bit it's something that I can refer dorsum to, and hopefully will assistance others!
I have an Anet A8 3D Printer for numerous dwelling projects, and I have got and so much utilise out of it since getting information technology – love the versatility, and accept fifty-fifty designed some parts to help around the house!
The printer is managed through the very popular Octoprint. I actually have the dedicated Octopi image running on a Raspberry Pi Goose egg W which works great and is a very cheap way to get your printer Wi-Fi enabled! It's pretty much a case of but flashing the epitome to an SD card, and so connecting your printer via a USB cable.
With my printer continued to my Pi, whenever I wanted to update the printers firmware (which is flashed with Marlin) I would accept to disconnect from the Pi, and connect to a Windows ten tablet (equally my Mac does non play prissy with the serial chip on the printer), so I went in search of a ameliorate solution, and I came across some tips on how I could flash the firmware using a Raspberry Pi (or my Octopi!). Details on this below:
1. Compile your firmware
I'g not going to go into details on how to download or install the firmware – In that location is enough of documentation out in that location on how to do this normally. But I will touch on how to become that firmware gear up to install from your Octopi / Raspberry Pi.
The CPU on Raspberry Pis is rather slow, and doing the total compile on the Pi would take a very long time! Also equally well-nigh the documentation is aimed at how to configure Arduino to flash your 3DP firmware, with the Octopi not having a GUI installed that's an boosted complexity.
So – Nosotros can get effectually this past using your much more powerful PC to compile the firmware. Then it'south just a instance of uploading to the Pi and flashing. To compile the firmware into a HEX file:
– Click Sketch -> Export Compiled Binary
This volition salve the HEX file into the same directory as your ino file. Make a annotation of where that file is, or have your file explorer open ready for the adjacent step.
2. Upload HEX file to your Octopi / Octoprint
There are plenty of ways you can do this, and y'all may have a preferred method, nonetheless I am getting the file into my Octopi using SCP from my mac. If you are a windows user you tin use WinSCP.
I uploaded the file into the /home/pi folder gear up for the next footstep.
Notation: The default password for octopi is the same as Raspbian. User: pi / Password: raspberry
SCP example:
scp [e-mail protected]:/home/pi
iii. SSH into Octopi and wink firmware
Next you volition need to SSH into your Octopi / Raspberry Pi so we tin carry out the steps to install and flash. On Windows yous tin use PuTTY.
Once logged in:
This will install avrdude – the application which runs in the background to Arduino to upload your compiled code. This is what we will use to upload the HEX file to the mainboard.
apt-get update
apt-get install avrdude
Now we need to determine what the (Linux) proper name of the USB Serial port is that the printer is connected to. The best place to run into this is in your connection tab of Octoprint:
Every bit above – in my instance information technology's /dev/ttyUSB0
Whilst you are in Octoprint, make sure y'all Disconnect from the printer – that style information technology volition release the Serial port for y'all to flash the lath.
And finally – we can now flash the firmware:
avrdude -p m1284p -c arduino -P [USB Port from Octoprint] -b 57600 -D -U flash:west:[file you lot uploaded earlier]:i
In my example:
avrdude -p m1284p -c arduino -P /dev/ttyUSB0 -b 57600 -D -U flash:w:Marlin.ino.sanguino.hex:I
NOTE: The above code is specific to the Anet A8 v1.0 board. If you are using a different setup such equally RAMPS, yous will need to cheque which processor is beingness used and adjust accordingly.
The board will automatically reset when consummate, and all being well you should be running the new firmware!
Please note – I do not have any responsibility for any damage / bricking / in-operation of your board. Usually these are not terminal if something does go wrong, simply it's too much to explain here if something does.
Happy Printing!
Source: https://www.oshelp.co.uk/?p=148
0 Response to "How Do I Compile Firmware to Upload Through Octoprint"
Post a Comment