Installing Octoprint For Os X
Installing OctoPrint to your Pi. Head over to the OctoPrint website and download the latest zip file. Once downloaded, unzip the file so, you are left with a.img file. Next, you will need some tools to be able to write the image to the SD card. For this we will use a tool called Etcher, you can download it from Etcher’s website. OctoPrint comes with the ability to cobble together timelapse recording of prints and slice STL files straight from OctoPrint. As such, it's a comprehensive open-source 3D printing software suite. How to Install OctoPrint on Raspberry Pi. Since there's a Raspbian-based image of OctoPrint, OctoPi, installing OctoPrint on the Raspberry Pi is.
I have started modifying my own 3D printer and one of the mods is a WEB interface. To have the WEB interface, the printer is connected to its own WEB server which runs Octoprint.
Octoprint is an open-source project which is intended to allow 3D printing without a host (regular PC) connected to the printer. Usually, the host is replaced with a Raspberry Pi, connected to LAN or WLAN and running an Octoprint instance. In this case, I have replaced the Raspberry Pi with an OrangePi Zero.
OrangePi Zero
I have chosen the OrangePi instead of a Raspberry Pi (3B version), because I had issues with a power supplies – it is quite hard to get a good PSU suitable for RPi and OrangePi Zero seemed to work a lot better even with cheapest USB Chargers. Also, the OrangePi Zero is smaller and has just enough I/O for this use case: one USB (as only one is needed to connect to the printer), one LAN connector, and some I/O pins for external buttons (will be used to power-off/reboot the system).
Furthermore, the Orange Pi Zero has a quad core CPU running at 1GHz and 512MB of RAM which is plenty, if basic WEB interface is going to be used and might not be enough if a WEB Cam streaming (or other RAM and CPU intensive features) will be used for viewing the printing process in real time. During printing, CPU usually sits at around 5% and RAM – at 25-30% of usage. Only during gcode load to the OrangePi CPU sits at 100% and it might take several seconds to load the file. It seems that high CPU usage is caused by printing time calculations which are done during the first file load to the Octoprint.
First steps with the OrangePi Zero
Firstly, we need an OS running on the Orange Pi. Armbian is a good Linux choice on such small computers.
Installation is quite simple. First of all, you need to download Armbian from official page (I have chosen ‘bionic’ distro which is Ubuntu based)(note that the link is for OrangePi Zero and not Zero+). Then extract the file you have downloaded. To write extracted ISO file to an SD card, you can use BalenaEtcher (this is what I use to flash an SD card). After writing the file to the SD card, insert it into Orange Pi Zero, connect LAN cable and power it up by connect to an USB cable. It might tike some minutes on first boot, because Armbian expands its partition to make all space on SD card usable.
Next thing to do, is to SSH to the Orange Pi. For that you need to know the IP address of the device. The easiest method should be just to check it through your router admin panel. The second way of finding out the IP is to directly connect USB-UART adapter to the Orange Pi header near the LAN connector.
After figuring out the IP address, you can connect to the device with SSH using either a terminal on Linux or a terminal emulator such as Putty on Windows machine.
On the first connection, you will be asked to create a new ‘regular’ user. So, I have created a user named octopi
which will be used in the further setup.
Finally, a good practice before doing anything else is updating the system:
Installing Octoprint
A good guide how to install Octoprint on a Linux machine is here. As there is everything that you might need, I will show only steps that I have done, leaving behind everything that I haven’t needed (such as a webcam setup).
Firstly, python virtual environment needs to be installed:
Then OctoPrint folder is created:
Then I tried running virtualenv venv command, but got message that virtualenv is not installed, so I installed it:
After that, virtual environment can be created:
And finally, it can be activated:
Next, we need to install octoprint into virtual environment:
Also, octopi (the user) needs to have access to the serial ports:
Finally, to start Octoprint type:
Now if you type in a web browser <octoprintIP>:5000 (where <octoprintIP> is Orange Pi IP address) you should connect to its web interface. On the first connection it will show setup wizard:
Here you can set up some features, like user credentials (for connecting to the web interface), anonymous usage tracking, web camera and other. Most of it I have left unchanged. Also, keep in mind, that setting up a web camera at this point is not a good idea, because it needs more configuration trough terminal (see the tutorial).
After finishing setup wizzard octoprint server can be closed (from already opened terminal) with typing in Shift+C.
Automatic startup
It is good idea to start the octoprint automatically during system startup, as mentioned in the tutorial:
Then open /etc/default/octoprint (note: at this point you should know how to use vi editor to modify files, if not – google the basic commands or use another editor):
And change a line to look like this:
Note, that in the path above, ‘octopi’ is your created user during Armbian setup. Also, # should be deleted from the start of the line. Save and close.
After that add script to autostart:
Now, the service should autostart on system startup, also it can be started, stopped or restarted by typing:
Adding restart/shutdown commands in OctoPrint’s menu
To have ability to easily restart/shutdown system or restart OctoPrint service from the WEB interface, these commands need to be added in Settings-> Commands tab:
Restart OctoPrint: sudo service octoprint restart
Restart system: sudo shutdown -r now
Shutdown system: sudo shutdown -h now
After typing those commands in and closing the settings tab you will notice that after clicking either one of those buttons in the menu nothing will happen, because it will ask (if a user is connected) through terminal to type in user’s (in this case octopi’s) password. That is not convenient. To change this behavior and allow directly do those actions trough WEB UI, octopi user needs to have password-less access to the /sbin/shutdown
program.
So, let’s create and edit the file:
And add the line to it:
Save and close. After this, the WEB UI should allow you to shut down and restart the system directly from within the WEB UI, but it won’t allow you to directly restart the service. To change that, edit again the same file:
And add a second line:
Save and close.
Now you should be able to restart the service within the WEB UI.
Accessing WEB UI through 80 port
For access of 80th port haproxy
was used.
First of all, it needs to be installed:
Then edit the haproxy
configuration file (you might want to make a backup of this file before editing it):
And replace all lines in the file with these:
Then edit the file:
And add (or change) a line:
Also, you might want to add a line to the ~/.octoprint/config.yaml
file:
After that haproxy server can be started/stopped/restarted with:
At this point, you should be able to access Octoprint through OrangePi’s IP address instead of a port 5000.
Summary
Installing Octoprint For Os X Download
So, this was a first step of adding an OrangePi Zero to a 3D printer. This allows the 3D printer to be controlled trough a WEB interface with any device connected to the same LAN.
Next step is going to be two additional buttons for the OrangePi, so it could be restarted/powered off with physical push buttons. Also, the OrangePi needs a small case, having a bare board lying on the table is not a convenient solution.
All plugins listed in this repository can be installed using the Plugin Manager bundled with OctoPrint or alternatively via command line.
You have the following three options..
Installing Octoprint For Os X Mac
Via the built-in repository browser of the Plugin Manager
Open the plugin repository in the Plugin Manager's settings dialog, find the plugin you are interested in there and install it with the 'Install' button provided next to it.
Note: If you cannot find the plugin, try refreshing the list from the repository via 'Refresh list from repository' behind the little wrench icon in the upper right corner:
Via the URL and the Plugin Manager
Copy the URL in the little 'Installation' box that's part of every plugin page under 'URL' and paste that into the 'Install from URL' text box in the Plugin Manager's settings dialog. If it also says it needs --process-dependency-links
then click on 'Advanced options' at the bottom of the dialog and make sure that the checkbox 'Use --process-dependency-links with pip install' is checked. Then hit 'Install'.
Via the command line
Copy the full 'Installation' command listed on each plugin page under 'Command line' and paste it into the command line of the host you installed OctoPrint on.
Raspberry Pi For Octoprint
Note: Make sure you are using the correct version of pip
-- on OctoPi you'll need to use ~/oprint/bin/pip
instead of just pip
.