loading

If you have read any of my other instructables, most noteable the Complete newbie step by step, 3D printer with all parts lists, you know that I remember my own frustrations at incomplete instruction and guides even after I finally figured out the process myself.

This time I'll take the Octoprint monitoring software for a ride.

Octoprint is a software used for (remote) managing and monitoring of your printer. You can even add a webcamera and Watch your printing Progress. I'll be adding the Raspberry pi camera, which in its 1.3 version is a very capeable camera with 5 MegaPixels and up to 1080p streaming.

You are going to use some nerdy software things, like the terminal software putty, and you are going to edit some files in a Linux based environment, but I'll take it step by step, and explain what you are doing.

In this tutorial we are going to use:

  • A RaspBerry Pi. I use a Pi2, but a B or B+ can be used as well. I do not know if older versions are up to the task.
    A class 10 SD Card for your Raspberry.
  • An Ethernet cable you need to connect your Raspberry to your wired Network.
  • An optional Wi-fi usb adapter to connect your Raspberry wirellessly to your Network.
  • If you are using Wi-fi you need to do either
    • Connect your RaspBerry to an external monitor and connect a mouse and Keyboard to set up Wi-fi.
    • Setup a tightVNC server as described in this instructables
  • (Optional) A compatible webcamera or RaspBerry Pi Camera.
  • Downloaded latest version of Octoprint.
  • Downloaded the terminal program Putty.
  • Download Win32 Disk Imager to put Octoprint on our SD Card.
  • (Optional) Download and use tightVNC on both your raspberry and on your computer.

Step 1: List of Contents / Index

Introduction and list of items we are going to use.

  1. This List of Contents / Index
  2. Aquiring needed programs and put Octoprint on SD card
    1. Download Octoprint
    2. Download Putty
    3. Download Win32 Disk Imager
    4. Download AngryIP scanner
    5. Put Octorpint on your SD Card using Win32 Disk Imager
  3. Installation and connecting to your RaspBerry using Putty
    1. Connecting everything and starting up
    2. Connecting to RaspBerry using Putty
  4. Configuring Octopi on RaspBerry Pi
    1. Setup using Rasp-Config
      1. Expand Filesystem
      2. Change User Password
      3. Enable Boot to Desktop
      4. Internationalisation Options
        1. Change Local
        2. Change Timezone
        3. Change Keyboard Layout
      5. Enable Camera
      6. Advanced Options
        1. Change hostname
  5. Install and setup VNC for remote Desktop
    1. Installing Tight VNC
    2. TightVNC server on your Raspberry Pi
    3. TightVNC viewer on your Computer
      1. Java version
      2. Installation version
    4. Updating your installation
    5. Restarting Raspberry
    6. Starting vncserver
    7. Configuring wi-fi
  6. Start using Octoprint
    1. Connect to Octoprint
    2. Login
    3. Connect Octoprint to your Arduino Mega
    4. Octoprint Settings.
    5. Camera feed and Internet Explorer

Step 2: Aquiring Needed Programs and Put Octoprin on SD Card

To get started we need to download 3 programs/files:

  1. Octoprint itself.
  2. Putty
  3. Win32 Disk Imager

Download Octorprint

You can head over to Octoprints offical page, and hit the Download button. Here it gets a Little confusing, but click on the name Guy Sheffer, which will take you to a new page.
Under Popular repositories you click on OctoPi, which takes you to a GitHub page with a lot of stuff on it.

Scroll Down a bit, and you will see:

Where to get it?

Official mirror is here
Alternative mirror is here
Nightly builds are avilable here

We are going to use the newest file found under Official mirros. There has been made some huge improvements in the Nightly build, which I had hope to take advantage off, but the latest version didn't like my wifi-dongle.

So, go to the Official mirror to get the newest file.

Now you are located on a site with a few files listed. Downloaded the one .zip file with the newest date.
It is around 1gb large and the download speed was rather slow for me, so it took around half an hour!

Put it in a folder on your desktop or similar place.

Download Putty

Downloaded Putty is also a bit confusing. You can go to the official page and use the "You can download PuTTY here".

Once again, we end up on a rather confusing page. I take it you sit on a Windows computer, so scroll Down and find the "For Windows on Intel x86" line. Right below that line, you will find what we need:

PuTTY: putty.exe

Click the putty.exe and save it in the same folder you put the Octoprint file. It might take a bit from you click, to you actually get the download dialog pop-up.

Download Win32 Disk Imager

Go to the Win32 Disk Imager page, and click the Download area. This will get you to a new page, and the download should start shortly after.

Download Angry IP Scanner

Go to Angry IP Scanner download area.

Find and click on the line: 32-bit Executable - if you prefer no installation

Put it in the same folder as the rest of your files.

Put Octoprint on your SD Card using Win32 Disk Imager

First you rightclick the Octorprint file and extract it to your current folder.

Insert your SD Card into your computer and make certain you know the drive letter.

Now you rightlick the Win32 Disk imager file and start it as Administrator.

Under "Image File" is a blank Square. Click the folder icon NeXT to it and navigate to your extracted Octoprint file. Select it.
Under Device in Win32 Disk Imager, you make certain the correct drive is selected.

When all is ready, you click the "Write" button and wait.

Step 3: Installation and Connecting to Your RaspBerry Using Putty

Insert your SD Card into your RaspBerry Pi, connect it your your LAN using an Ethernet cable and connect any webcamera or RaspBerry camera you might have. Also insert any usb wi-fi module you would like to use.

If you want to use Wi-fi you need to connect your RaspBerry to an external monitor and connect a mouse. You might configure this using the Putty Terminal program, but that is beyond the scope of this Instructables.

When all is connected, you power up your RaspBerry.

Finding device using Angry IP Scanner

After you turned on your Raspberry you start up AngryIP Scanner. The boxes after "IP Range:" should be correctly populated with relevant settings for your Network, so just press the Start button.

After a bit, a Scan Statistics window pop up. Just close it.

Now use the ruler to scroll Down untill you find a device named something starting with "Octopi" It is in the column named Hostname. Write Down the IP of the device, which in my case is 192.168.1.59

Connecting to RaspbBerry using Putty

With our RaspBerry's IP in hand, we fire up Putty. Enter the IP address in the box under Host Name (or IP address). The box under Port should be 22. Leave everything else as it is and click the Open button.

You will be with with a Putty Security Alert window. Just press Yes. It simply warns you that your RaspBerry has a self-generated security certificate.

You are now presented with a window with a Login as: prompt.'

Use pi as username (login as) and raspberry as password. Note that nothing will appear on screen when entring password.

We are now logged in to our Octopi on RaspBerry pi.

Important: Left-clicking will always paste whatever you have copied. This Means you can't markup something in Putty and then right-click to copy it. Nor can you use shortcuts such as CTRL-C or the like.

Step 4: Configuring Octopi on RaspBerry Pi

In the previous step we connected to our Octopi on our RaspBerry Pi using Putty.

Now type in sudo raspi-config

You are now met with the RaspBerry Pi Software Configuration Tool (Raspi-Config)

Setup using Rasp-Config

You can navigate here using the arrow-keys, TAB and use the ENTER key to execute your selection. In some menus you can select multiple things using SPACE before hitting ENTER to execute your selection.

Expand Filesysten

Select this using arrow keys, and press enter. The window will briefly run some code and present you with a screen with <OK> on it. Hit Enter.
We just told Octpi to use the entire Card, so it doesn't run out of Space.

Chage User Password

This is very, very important, or anyone with access to your Network can log in and take control of your printer.

Select the Change User Password and hit Enter and press Enter in the next screen.

You are now looking at a black, possibly daunting, terminal screen where the last line reads: "Enter new UNIX password". When you type something here, nothing will happen on screen, but that is on purpose.

Type in your password and hit ENTER.

Now you need to confirm your password and hit ENTER when done. Enter on the next screen and you are returned to the raspi-config menu.

Enable Boot to Desktop/Scratch

You only want to do this, if you need to setup Wi-fi.

To enable desktop mode, Hit Enter. Use arrow keys to select "Desktop Log in as user 'pi' at the graphical deskto"p.
Press Enter - you do not need to select <OK>. Just press Enter.

Some codes will briefly run on the screen, and you are returned to the raspi-config menu.

Internationalisation Options.

You do not need to do this, but unless you use a UK keyboard layout, it might be usefull if you are having trouble making the right characters in the Putty sessions to your RaspBerry.

You can always go back and setup this at a later stage, if you find that you need it.

Press enter to activate the option.

Here we have 3 options. Configure as you like:

Change Locale: Hit Enter. After the Black screen goes away, you use arrow keys to navigate down to the selections fitting your country. In my case I select the two starting with da_DK as I live in Denmark. I select them using arrow-keys and Space (see image). Then press ENTER when done.

We are now asked to select Default locale for our environment. I browse up and select da_DK and press ENTER.
You might have more than one option. Just use the top one with your countries initials.

A black terminal screen will run something a while then return you to the raspi-config.

Select the Internationalsation Options once more.

Change Timezone: Hit Enter. After the Black screen goes away, you use arrow keys to navigate to the area most fitting for your country. Mine is Europe. Now select the City matching your time-zone. Mine is Copenhagen.

After a brief black-terminal screen, we are once Again back to the raspi-config.

Select the Internationalsation Options once more.

Change Keyboard Layout: (this option is likely the most important one) Hit Enter. After the Black screen goes away, you are returned to the Raspi-Config.

Enable Camera

This is to enable the RaspBerry Camera. If you use an USB camera, you do not want to hit this one, as it is either or. You can always go back and change this later.

Enable Camera: hit Enter. You are asked if you want to enable support for Raspberry Pi Camera. If you do, you use Arrow-keys to select <Enable> and hit Enter.

You will be returend to the Raspi-config.

Note: There is an options file in the root of your SD Card, where framerate can be changed from the default 10fps to something else.

Add to Rastrack

We do not need this, so skip this option. You can read something about it on http://rastrack.co.uk

It is to track where people use Raspberrys Pis around the World.

If you happen to hit Enter, but don't want to, just press ESC.

Overclock

We do not want this for newer Raspberry Pis. You might want this on older versions, but it is beyond the scope of this instructable.

Advanced Options.

There are 10 options in here, but I am only going to change one of them:

If you are happy with the name Octopi, you just skip this

Hostname: Select this using Arrow Keys and press Enter. You will be presented with some texts on naming conventions. Basically you may not use special characters and no Spaces in it. I'll recommend using a single Word like "3dprinter" or similar.

Hit Enter to continue. Use backspace to delete the name octopi, and type in a name of your choice. Using capitals will not work and the final name will be in small letters.

I call the printer I made for Ultius, so that is what I'll write. Hit Enter to continue. You do not have to select <OK>

<Finish> and Restart

Now either use the sideways arrow keys or TAB to select <Finish>. Select <YES> to restart now.

The Raspberry will restart and your new settings will take effect.

Putty will pop-up a "PuTTY Fatal Error". Sounds so serious, but just click OK.

Just leave the Putty (inactive) window open, as we are going to need it in the next step.

Step 5: Install and Setup VNC for Remote Desktop

If you havn't done so allready, connect to your Raspberry Pi using Putty, as we did in the previous step.

Login using pi as username, and the password you defined. Default password is raspberry if you havn't changed it yet (do it asap)

Installing and setup Tight VNC

Much of the information I use here, is from a post on Ultimaker forum. There are some troubleshooting steps if your raspberry are having trouble downloading the vnc package

We are installing this TightVNC and need to both get a "viewer" on our computer and a "server" on our Raspberry. Luckily for use, it is a pretty simple thing to do.

TightVNC server on your Raspberry Pi

Type in:

sudo apt-get install tightvncserver

Press Y and Enter when asked if you want to continue.

When done, you type in:

tightvncserver [enter]

Setup a password for your remote desktop.

Select n to setup a view-only password.

You are now presented with a screen of information - see image.

TightVNC viewer on your computer.

Go to http://www.tightvnc.com/download.php and either download the installation files for Windows or maybe download the Java viewer, if you do not want to install anything. It requires you have Java installed on your computer.

If you use the install version you might want to do a custom install and deselct the VNC-server. You can always change this later, by running the installation .msi file Again at a later point

In either case, you download and run your software.

Java version:
Enter the IP of your Raspberry - and type in 5901 in port and hit Connect - enter password you choose during VNC installation and press OK - see image.

Installation version

Enter the IP followed by :5901 without any Spaces and hit Connect - enter password you choose during VNC installation and press OK - see image

Using TightVNC desktop

Now we have a nice desktop on our RaspBerry pi. You only really need this if you want to setup wi-fi and can't do it using terminal, as it is rather complicated for normal people

Updating your installation

It is always a good idea to update the installation, so click on the icon with a monitor with a Black screen - see image

Now type in:

sudo apt-get update [enter]

After it finishes, which might take a while, you type in:

sudo apt-get upgrade [enter]

Answer Y to continue, and wait for it.

Restart your Raspberry

Now you either type sudo reboot or click on Menu -> Shutdown... -> Reboot -> O.k.

VNC will tell you the connection has been closed.

Starting VNCServer

As we did not configure VNCServer to start automatically after each reboot, we need to log in to our raspberry using putty and start the VNCserver by typing:

vncserver [enter]

You can now access your VNC desktop using the VNC viewer.

Configuring wi-fi

Click on Menu -> Preferences -> WiFi Configuration - A window/program opens named wpa_gui

Your adapter should be listed as wlan0 - unless you have multiple Wireless adapters connected

Press the [Scan] button - select your Wireless Network and type in your password in the box next to PSK - see image

The Wifi Configuration utility should automatically have figured out the rest. -- see image

Now you are back at the wpa_gui with your network listed just under wlan0

Press Connect - You might have to restart your Raspberry before it decides to get an IP address - see image

Now unhook your Ethernet cable connect your Raspberry to your Arduino Mega board and get ready to start using Octotpi to manage your printer.

Step 6: Start Using Octoprint

Now unhook your Ethernet cable connect your Raspberry to your Arduino Mega board and get ready to start using Octotpi to manage your printer.

Connect to Octoprint

You can either use the Angry IP Scanner to find the new Wireless IP address of your Raspberry, or you can just open a browser and connect to it, using the hostname you specified earlier followed by a .local - see image

Configure Access Control

If you live alone, do not have any other people ever using your Network, and do not have your Printer accessible from the Internet, you can Disable Access Control.

In any other scenario, you want to define a username and a password here. You can add additional users later on.

Login

Now you might think you are good to go, and in a way you are, but first you need to login with the user you just created, so click Login in the upper right corner. Decide for your self if you want this particular browser to remember you.

Connect Octoprint to your Arduino Mega

In upper left corner you see the Connection section. In my case I could just leave everything at AUTO, putting marks in Save connection settings and Auto-connect on server startup.

For this particular Instructables, I had to both specify Serial Port as /dev/ttyACM0 and Baudrate at 250000.

If it doesn't connect, try first setting baudrate at 25000, which is default for latest Marlin firmware, then try changing the Serial Port to one of the options. Change Again if it doesn't Work either.

If you use older Marlin firmware, you might run it at 125000.

You can see the Connection Progress in the State section, just below the Connection section

You can click the Connection and State Words to unfold of collaps that section.

When you have successfully connected, the Machine State, in the State section, should simply read Operational.

Octoprint Settings

I'll not go through all settings in Octoprint but it is worth to remember, that you must hit save for each change you make before going to the next category, or the changes will be lost. Wasted a lot of time on this one.

Camera feed and Internet Explorer,

I can't get the Camera to Work in Internet Explorer, but it Works perfectly in Google Chrome. Might be some guide somewhere for Internet Explorer.
It also Works fine in my iDevices.

<p>Over all a very useful tutorial. Thanks!</p>
<p>nice one :) works like a charm arduino mega with sprinter firmware and ramps :D so you do not have to use a lcd panel and sd reader</p>
<p>great guide but i am failing on the last bit, when i open vncviewer i get the following errors</p><p>Xsession: unable to start X session --- no &quot;/home/pi/.xsession&quot; file, no </p><p>&quot;/home/pi/.Xsession&quot; file, no session managers, no window managers, and no </p><p>terminal emulators found; aborting.</p><p>any ideas </p><p>tia</p>
<p>There is no desktop environment since Octoprint starts with the lite installer. This is what makes all the pretty windows and such. </p><p>sudo ./scripts/install-desktop</p><p>You might need to start it manually, or if that doesn't get you going- research LXDE, desktop environment, window manager, and Raspbian.</p><p>Personally, I'm not going to mess with it and I'll add the wifi through the config file.</p><p> <a href="http://octoprint.org/blog/2016/05/02/new-octopi-release-0-13-0/" rel="nofollow">http://octoprint.org/blog/2016/05/02/new-octopi-re...</a></p>
problem is that for most people it is much easier to setup using a graphical interface.<br><br>If all else fails, go check out Astroprint. I vastly prefer that one over Octoprint as well, since it was made for normal people, and with focus on intuitive usage and not geekstuff over useability like Octoprint.
<p>Thank you for your nice words.</p><p>I'm sorry I really don't have any ideas other than Googling, and I think it's better you do your own googling :)</p><p>If you have the option to hook up the pi to a monitor and keyboard it will make it easier for you?</p><p>Cheers,</p><p>Morten</p>
<p>Hi! </p><p>Great Post! Really helpfull! I am having an issue, i can't connect to the octoprint. I mean : &quot;myusernamen.local&quot; idoesn't work except when i'm on the vnc software.</p><p>I can't connect ever trough the android app. Any clues?</p><p>Thankx in advance</p>
Hello jonibigodes.<br><br>Really glad you found it helpfull. To be honest, I have thought about removing this particular Instructables for a long time, as I ended up making it rather more complicated that it strictly needed to be, in order to cover any scenario I could think off.<br><br>I KNOW people find it helpfull, but it is really not as straightforward as I had hoped, so it also confuse a good deal of people - unfortunately.<br><br>I personally much prefer https://www.astroprint.com/ which offers the same, but it much more user friendly (in my opinion) and nicer looking, faster ui and better for devices.<br>Might need special wifi dongle though!<br><br>Do you mean connect to Octoprint in your browser?<br><br>You might need to use the IP of your device like http://192.168.1.123 (or what your IP is). You might need to specify octoprint port after it. I believe it is port 5000, so it would go like http://192.168.1.123:5000<br><br>Try ditching the .local and connect using http://myusername or append :5000 if it doesn't Work.<br><br>Hope it helps
<p>Just wanted to update everyone on this, if you are exclusively using wifi (like I am), you can bypass having to connect a keyboard and monitor to your raspberry pi altogether. After the step of burning the image to an SD card using the Image Writer, go to your SD card folder and look for a text file called something like &quot;octaprint-network.txt&quot;. In there you can set your wifi SSID and password, save the file then Octaprint will directly connect to your wifi automagically. Follow the rest of the instructions afterward, no need to connect ethernet or a whole computer :)</p>
<p>Great tutorial, was hoping for more on the camera side... While my issue is outside of the scope of this list, was hopeful you'd list what camera and what you did to make it work. While I can find a string to start my camera, not sure where to use said values. </p>
<p>Very very helpful tutorial for people who dont know their way around linux etc. Great detailed explanations with pictures when needed. If your looking for another instructable idea it would be great to see a newbie tutorial to interface an RPI and arduino mega!</p>
<p>I really only bought the Raspberry to use with Octoprint or AstroPrint to control my 3D printer. I am not into using the Arduino or Raspberry just onto themselves for anything else :)</p>
<p>I am completely lost. I cannot get Tightvnc viewer to download onto my PI at all. It keeps asking me what i want to open it with. Also, you never mentioned that I would need an Arduino mega board AT ALL until the end. So here I am Ive gotten everything listed except for the camera and screen which are in the mail. I began following instructions and downloading anyway since those things are not mandatory as of now but boy am I surprised when I get to the end and I need yet another 40 dollar component! There are alot of things I know, linux and Pi are two of the things I do not, I was completely relying on your instructable to be my light in the darkness, ugh, I am just so very frustrated. </p>
<p>This instructable is not about setting up a 3D printer. <br>Only the Ocotprint part.<br><br>Not all 3D printers are using an Arduino Mega. In fact, the market is shifting away from it.<br>That said you can get Arduino AND ramps + drivers for less than $40 combined.<br><br>If you can't get vnc to Work, I'll recommend attaching a monitor and keyboard instead. It is only untill you have set up wifi. If you are using LAN, you do not need it at all.<br><br>I'll recommend reading any instructables, guide or manual through and through, and make sure you follow (understand/see) the work-path before starting on it. It will minimize the risk of unforseen costs and diffictulties.<br><br>That said, I'll recommend using AstroPrint instead. They just introduced Terminal to their software, which was the missing piece. You need the spcified wifi moduled unless you want to run it via LAN though.</p>
<p>Nice tutorial.</p>

About This Instructable

80,607views

97favorites

License:

Bio: I'm blogging about my projects before they make it to Instructables.com Once I've finished a subject on my blog, I'll put ... More »
More by dintid:Ultimaker 2 – Use 5v controlled fan to also get a 24v controlled fan. Duex5 - Use Build in 12v Switching Regulator on 24v System Sbase/Smoothieware - Use a Free PWM Pin and Power Expander or SSR to Control Fans. 
Add instructable to: