My 3D Printer setup - OctoPi, remotely controlled, webcam stream

October 31, 2017

(TBH this post is mostly for myself when I set up my printer in the future and forget how I did things)(Also I'm moving my printer to Kingsport this weekend and wanted something to reference while setting it up at home) 

 

I had a few things I wanted to be able to do after fully setting up my 3D-printer.  I managed to accomplish all of them, as listed below

  • View the progress of the printer from anywhere

  • Remotely abort a print if I see it messed up

  • Don't have to walk a SD card to the printer - wirelessly upload files.

After a few google seraches it became clear that OctoPrint was the best way to accomplish these things.  It supported all the features I wanted with some slight network modifications.  There is a version of OctoPrint called OctoPi that is specifically designed for use with a Raspberry Pi.  I happened to have a Raspberry Pi B+ laying around, so I decided I should use that.  (In the end I upgraded to a Raspberry Pi 3 model B so that the webcam stream is smoother)

 

OctoPi

Setting up OctoPi is well-documented on OctoPrint's website.  I just followed that tutorial, and made sure I changed the wifi network information in the networks.text file.   I used Rufus to burn it to a micro SD card.  Plug in all required cables (Power for the Pi, USB type B cable to the printer, and USB webcam), boot it up, connect the HDMI output to a monitor to figure out what IP address the router assigned to the Pi.  Then go to the computer and type that IP address.  

 

Somewhere in the process I set up login information for OctoPrint.  Without logging in I can't start/stop the printer, but I can see the webcam stream.  This is a good idea so that other people on my wifi network can't mess with the printer.  

 

Router

The router setup will differ based on what router you have, but the steps should be fairly similar.  I have an Asus router.

 

Remote control

For remotely controlling the printer, I set up a "tunnel" to my home network through a VPN.  This way I could connect to the VPN and be on my home network as far as the connection is concerned.  

Go to the network admin page (router.asus.com for me, maybe 192.168.1.1 for other routers) and under the advanced settings click VPN, then find and turn on OpenVPN.  Set up a username/password for it and then export the OpenVPN key.  

Download the OpenVPN app for your phone and open it.  You should be able to add a connection using an OpenVPN key.  I uploaded the key to google drive and then opened that file in the OpenVPN app.  Type your login information and then press the toggle below "Disconnected" (on the iPhone app at least).  You should be connected and able to control the printer now.  

 

Live stream

For seeing the live stream from the webcam I used port forwarding and a dynamic DNS.  In the router settings go to WAN, "Virtual server / port forwarding".  Set service name to "OctoPi" or something, and leave source target blank.  Set the Local IP to the OctoPrint address (ex. 192.168.1.254), and the port range to 1997 (for example - just don't use 5000).

Set the Port Range to 1997 (for example - you can use anything up to 4999 I think).  Set the Local Port to 8080, and the protocol to BOTH.  Click the plus button to add this to the list. 

Next, go to no-ip.org and create an account.  Set up a new hostname like the website says, I used jakabo27.hopto.org.  Don't worry about the IPV4 address, I think no-ip automatically adjusts that.  

Still under WAN on the router, go to the DDNS tab.  Enable DDNS, select NO-IP as your provider, put in the hostname you picked (in my case jakabo27.hopto.org) , and put in your login information or no-ip.com.  We don't need wildcard or IP verification, so leave those at No.  Press apply.

To access the stream, go to [yourwebsite]:[port#].  For example, my live stream is at jakabo27.hopto.org:1997  

 

Other setup

Your timelapses will turn out better if you set the interval to be every change of z-axis.  That way it takes a picture each time the printer moves up a layer, and the model will often be in the same position for each image.  Otherwise the timelapse will look very jumpy if you have a moving bed.  

Octoprint is great immediately after installation, but you can make it even more useful with some plugins.  Here are my favorite plugins:

  • Enclosure Plugin - this plugin gives you basic control of the Raspberry Pi GPIO pins through the OctoPrint web interface.  I installed a relay in my printer connected to some LED strip lights, and connected the relay to GPIO 7.  With the enclosure plugin you can tell it to turn the lights on when it starts a print and turn them off upon completion.  

  • TouchUI - when you load OctoPrint on a phone, the interface looks completely different from the computer view and is much nicer to use on a phone.  It has bigger buttons.  

  • Pushbullet - Pushbullet can be used to share links and files between phones and computers.  This plugin gives you a pushbullet notification (which shows up on all devices you install it on) when a print finishes, including a screenshot of the print.  

  • Cost Estimation - I don't use this much, but it gives you an estimate of how much a print will cost based on the print time and filament cost you input.  

  • Custom Background - If you get tired of the octopus-turtle background, you can change it to a different picture.

  • CuraEngine - used for slicing STL models on the Raspberry Pi.  I don't recommend this because you don't have as much control with print settings compared to using Cura on a desktop/laptop computer.  

Please reload

February 11, 2018

Please reload

Jacob Thompson

jat5@clemson.edu

Clemson, SC

© 2020 By Jacob Thompson

Terms of Use and Privacy Policy

  • Facebook Social Icon
  • Instagram Social Icon
This site was designed with the
.com
website builder. Create your website today.
Start Now