Octoprint Installation Guide
Do you have a 3D printer? If you have one sitting around that you use on the regular, a Web UI app would be a wonderful addition to it. You have heard or are using hosts such as Repetier or Cura by now and this is part of the standard 3D printing toolchain. A Web Application takes you a step further by including all the complexity of an application and your browser. Your browser is something you use naturally so making a page for your printer and putting it online sounds like the best way to maximize your printer’s use. Let’s get started.
Before we begin this project, there are several things you will have to get. This guide is for installation of OctoPi on the Raspberry Pi B/B+ models or above. Try to go with a Raspberry Pi that has 4 usb slots, and an ethernet port so you have enough space to connect the keyboard, mouse, and wifi adapter.
Now take all the files you have downloaded and store them somewhere on your desktop. The SD image takes a while so be patient and feel free to resume when it’s done.
When the download is done, go over and install the ImageWriter software. I installed it in the folder that I was using to setup the OctoPi. After installing it, check if the address is the right one to your SD card. Go ahead and select the location of the Image and write it to the SD card. A couple notes before you do the following: make sure your SD card has been formatted and is ready to go before writing a new image to it. This helps with preventing further problems.
Cloning your SD card:
This is off topic but before erasing your SD card, you have the option to clone it so you can use it in a future reinstall. Using the ImageWriter software, select a location and a name for the image you want to clone your SD to and press READ. It should take you around 10/15mins. When it’s done, put that image file in a safe place and write it back to any SD whenever you need it to save your Raspberry Pi work.
Thanks to Whitson Gordon for the nice article and tip.
Configure Raspberry Pi with PuTTY
After writing the software to the SD card, connect the webcam and the wifi adapter if you have that.
This guide doesn’t differ much if you where using ethernet but it’s a little bit more involved with the wifi adapter. You need to connect the mouse and keyboard and have access to the net through the wifi adapter.
Insert the Raspberry Pi and connect it to the LAN using the ethernet cable. After the Pi has started, open up Angry IP Scanner and scroll down looking for OctopPi under host name. After you find it, write the IP down and go to the next step.
Here are the steps to set up Wi-Fi on your Raspberry Pi. First turn on the Raspberry Pi with no wifi adapter connected to it. Then you want to access the terminal console and type the following command:
sudo nano /etc/network/interfaces It takes you into a the network interfaces configuration file. Check for
auto wlan0. If this is correct, it should also link you to the wpa_supplicant file. This is the file you will enter the network details. Type
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf in the terminal to access the file.
The fields you need to know are your Wifi SSID and password. Enter those details in the wpa-ssid and wpa-pask fields. When you are done, Ctrl + X out of the file to save it. Shut down the Pi and reboot it up. If the details where entered successfully, it should be connected to the internet.
Here is a trouble shooting guide. The keyboard doesn’t have “” by default so you have to change the keyboard layout to us. You do that using the
sudo nano /etc/default/keyboard to change it to your country when you see the XKBLAYOUT=”gb” parameter.
Finding your Pi’s IP address
Once you have the Pi rebooted and connected through the Wifi Adapter, the command:
sudo ifconfig allows you to view the network connections that your Raspberry Pi has. Copy down the ip address that is after the inet addr parameter. Remember, if your iP starts with 192.168 or 10.0 then it is an internal(local) address. That means someone outside your house cannot reach your Pi. If you are interested in a webserver that other people outside the house can reach, I will update it here.
Connecting to PuTTy
Now that you have the Pi’s IP; enter it under hostname in putty. Leave the port number 22 by default, don’t touch anything else and press open. Click yes on the on the security message. It just lets you know the Pi has a self generated security certificate. When presented with login as a prompt, use “pi” as the username and “raspberry” as the password. You should be able to login using puTTy by this point.
If you run into some issues with connection being refused, here’s how I fixed it. I went into my network interfaces file and I noticed that the bottom two entries of my wlan0 were commented out (#). Remove the hashtag from both lines and it should work when you reboot and try again with PuTTy. Remember to use
startx if you want to access the GUI. Before moving on, make sure you run two more commands to upgrade your board to the latest files:
sudo apt-get upgrade and
sudo apt-get update
Configuring OctoPi Settings
sudo raspi-config to access the configuration page. Here you can change things such as: Enable Boot to Desktop so you can setup the wifi later. In Internationalisation mode, select the keyboard from your region here. I also used this setting to change the time to my local area. Navigate to the advanced options and change the host name if you want to name it something more unique. When you are done, save and quit the config menu.
Install TightVNC on your computer. This is a viewer install that allows you to interact with the pi’s desktop. Download the same application on your Pi by logging into PuTTy and entering the following command:
sudo apt-get install tightvncserver. Press Y when it asks and ensure the download is successful. When it’s finished working, type
tightvncserver and it should prompt you to make a password for this connection to your Pi. Select “n” when it asks view only password and press enter. On your desktop, open the .jar file. You must have JAVA installed. Enter your iP where it asks and “5901” under port. Then it should ask you for the password you saved earlier when you installed it in the Pi. Voila, if done right, you should see the desktop of your Pi. Go web surfing a bit.
Configuring Wi-Fi (My Solution)
Now that you have access to the desktop, configuring the wi-fi is a bit easier from here. Here is a great time to troubleshoot the wifi. I just feel like it’s easier to edit the
sudo nano /etc/network/interfaces file. Add your ssid and password in this screen. This ensures your wlan0 works when you reboot the network service. The page should look something like this:
The first page should bring up a username and password page. You can pick a custom username and for the password, I would suggest you use a string to md5 converter to create a strong secure password. Then I would use the Intel password checker to check if it’s secure. Enter the username and password and you should be in the OctoPrint main screen. Make sure to keep access control “enabled”. Then you should be able to access the OctoPi login screen.
After setting up your account, connect your Pi to your Arduino. Start up your printer and get a feel for you to move it with your browser. That is precisely the software to hardware tool chain that enables 3D printers to greatly improve their skills. There’s lots to this program. You can add users that can use your printer. You could make it open to the web (local by default). Make sure to save your connection settings. Also when editing your preferences, remember to press save before closing the menu.
As a backup tip, you can clone the image of your SD for backup now so you will always have this image to work with as you improve the system and hardware configurations. The next blog post in this series will be about how to use and maximize octopi. If you have any comments or questions, please feel free to drop them and I will answer it for you. Until next time..
Kurt | 32Studios
Credits: Thanks to dintid for the wonderful instructable!