2013-01-18 22:23:50 +00:00
OctoPrint
=========
OctoPrint provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It currently
2012-12-31 12:18:54 +00:00
allows
2012-04-06 14:20:22 +00:00
2012-12-31 12:18:54 +00:00
* uploading .gcode files to the server and managing them via the UI
2013-01-12 23:58:54 +00:00
* selecting a file for printing, getting the usual stats regarding filament length etc (stats can be disabled for
faster initial processing)
2012-12-31 12:18:54 +00:00
* starting, pausing and canceling a print job
* while connected to the printer, gaining information regarding the current temperature of both head and bed (if available) in a nice shiny javascript-y temperature graph
* while printing, gaining information regarding the current progress of the print job (height, percentage etc)
* reading the communication log and send arbitrary codes to be executed by the printer
* moving the X, Y and Z axis (jog controls, although very ugly ones right now)
* changing the speed modifiers for inner & outer wall, fill and support
2013-01-03 14:25:20 +00:00
* optional: visual monitoring of the printer via webcam stream integrated into the UI (using e.g. MJPG-Streamer)
* optional: creation of timelapse recordings of the printjob via webcam stream (using e.g. MJPG-Streamer) -- currently two timelaspe methods are implemented, triggering a shot on z-layer change or every "n" seconds
2012-04-06 14:20:22 +00:00
2013-01-18 22:23:50 +00:00
The intended usecase is to run OctoPrint on a single-board computer like the Raspberry Pi and a WiFi module,
2013-01-19 23:29:48 +00:00
connect the printer to the server and therefore create a WiFi-enabled 3D printer. If you want to add a webcam for visual
monitoring and timelapse support, you'll need a **powered** USB hub.
2012-04-06 14:20:22 +00:00
2013-01-19 23:29:48 +00:00
OctoPrint is Free Software and released under the [GNU Affero General Public License V3 ](http://www.gnu.org/licenses/agpl.html ).
2013-01-14 13:33:00 +00:00
2012-12-31 12:18:54 +00:00
Dependencies
------------
2012-12-06 07:57:18 +00:00
2013-01-18 22:23:50 +00:00
OctoPrint depends on a couple of python modules to do its job. Those are listed in requirements.txt and can be
2012-12-31 12:18:54 +00:00
installed using `pip` :
2012-12-06 07:57:18 +00:00
2012-12-31 12:18:54 +00:00
pip install -r requirements.txt
2012-12-06 07:57:18 +00:00
2013-01-18 22:43:50 +00:00
You should also do this after pulling from the repository, since the dependencies might have changed.
2013-01-18 22:23:50 +00:00
OctoPrint currently only supports Python 2.7.
2013-01-01 20:04:00 +00:00
2012-12-31 12:18:54 +00:00
Usage
-----
2012-12-06 07:57:18 +00:00
2012-12-31 12:18:54 +00:00
Just start the server via
2012-12-05 13:16:50 +00:00
2013-01-18 22:23:50 +00:00
python -m octoprint.server
2012-12-05 13:16:50 +00:00
2013-01-18 22:39:26 +00:00
or alternatively
./run
2012-12-31 12:18:54 +00:00
By default it binds to all interfaces on port 5000 (so pointing your browser to `http://127.0.0.1:5000`
will do the trick). If you want to change that, use the additional command line parameters `host` and `port` ,
which accept the host ip to bind to and the numeric port number respectively. If for example you want to the server
to only listen on the local interface on port 8080, the command line would be
2012-12-06 07:57:18 +00:00
2013-01-18 22:23:50 +00:00
python -m octoprint.server --host=127.0.0.1 --port=8080
2012-12-06 07:57:18 +00:00
2013-01-18 22:39:26 +00:00
or
./run --host=127.0.0.1 --port=8080
2013-01-01 20:04:00 +00:00
Alternatively, the host and port on which to bind can be defined via the configuration.
Configuration
-------------
2013-01-18 22:23:50 +00:00
The config-file `config.ini` for OctoPrint is expected in its settings folder, which is located at `~/.octoprint`
on Linux, at `%APPDATA%/OctoPrint` on Windows and at `~/Library/Application Support/OctoPrint` on MacOS.
2013-01-04 17:38:50 +00:00
2013-01-01 20:04:00 +00:00
The following example config should explain the available options:
[serial]
2013-01-12 23:58:54 +00:00
# Use the following option to define the default serial port, defaults to unset (= AUTO)
2013-01-01 20:04:00 +00:00
port = /dev/ttyACM0
2013-01-12 23:58:54 +00:00
# Use the following option to define the default baudrate, defaults to unset (= AUTO)
2013-01-01 20:04:00 +00:00
baudrate = 115200
[server]
2013-01-12 23:58:54 +00:00
# Use this option to define the host to which to bind the server, defaults to "0.0.0.0" (= all interfaces)
2013-01-01 20:04:00 +00:00
host = 0.0.0.0
2013-01-12 23:58:54 +00:00
# Use this option to define the port to which to bind the server, defaults to 5000
2013-01-01 20:04:00 +00:00
port = 5000
2013-01-02 23:39:17 +00:00
[webcam]
2013-01-12 23:58:54 +00:00
# Use this option to enable display of a webcam stream in the UI, e.g. via MJPG-Streamer.
2013-01-04 17:38:50 +00:00
# Webcam support will be disabled if not set
stream = http://< stream host > :< stream port > /?action=stream
2013-01-12 23:58:54 +00:00
# Use this option to enable timelapse support via snapshot, e.g. via MJPG-Streamer.
2013-01-04 17:38:50 +00:00
# Timelapse support will be disabled if not set
snapshot = http://< stream host > :< stream port > /?action=snapshot
2013-01-12 23:58:54 +00:00
# Path to ffmpeg binary to use for creating timelapse recordings.
2013-01-04 17:38:50 +00:00
# Timelapse support will be disabled if not set
ffmpeg = /path/to/ffmpeg
2013-01-02 23:39:17 +00:00
2013-01-12 23:58:54 +00:00
[feature]
# Whether to enable gcode analysis for displaying needed filament and estimated print time. Disabling this (set
# to False) will speed up the loading of gcode files before printing significantly, but the mentioned statistical
# data will not be available
analyzeGcode = True
2013-01-03 20:38:46 +00:00
[folder]
2013-01-18 22:23:50 +00:00
# Absolute path where to store gcode uploads. Defaults to the uploads folder in the OctoPrint settings folder
2013-01-03 20:38:46 +00:00
uploads = /path/to/upload/folder
2013-01-12 23:58:54 +00:00
2013-01-18 22:23:50 +00:00
# Absolute path where to store finished timelapse recordings. Defaults to the timelapse folder in the OctoPrint
2013-01-12 23:58:54 +00:00
# settings dir
2013-01-03 20:38:46 +00:00
timelapse = /path/to/timelapse/folder
2013-01-12 23:58:54 +00:00
2013-01-18 22:23:50 +00:00
# Absolute path where to store temporary timelapse files. Defaults to the timelapse/tmp folder in the OctoPrint
2013-01-12 23:58:54 +00:00
# settings dir
2013-01-04 17:38:50 +00:00
timelapse_tmp = /path/timelapse/tmp/folder
2013-01-03 20:38:46 +00:00
2013-01-02 23:39:17 +00:00
Setup on a Raspberry Pi running Raspbian
----------------------------------------
2013-01-18 22:23:50 +00:00
I currently run the OctoPrint on a Raspberry Pi running Raspbian (http://www.raspbian.org/). I recommend to use
2013-01-13 12:43:44 +00:00
a maximum baudrate of 115200 baud in your printer firmware, as the used Python serial module does not support
250000 baud in all Linux distributions yet (Raspbian being not one of them, at least according to my experience).
For the basic package you'll need Python 2.7 (should be installed by default), pip and a couple of dependencies
listed in requirements.txt:
2013-01-02 23:39:17 +00:00
cd ~
sudo apt-get install python-pip git
2013-01-27 10:23:01 +00:00
git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint
2013-01-19 12:31:46 +00:00
sudo pip install -r requirements.txt
2013-01-02 23:39:17 +00:00
2013-01-18 22:23:50 +00:00
You should then be able to start the OctoPrint server:
2013-01-02 23:39:17 +00:00
2013-01-27 10:23:01 +00:00
pi@raspberrypi ~/OctoPrint $ ./run
2013-01-02 23:39:17 +00:00
* Running on http://0.0.0.0:5000/
2013-01-04 22:43:32 +00:00
If you also want webcam and timelapse support, you'll need to download and compile MJPG-Streamer:
2013-01-02 23:39:17 +00:00
cd ~
2013-01-21 17:38:31 +00:00
sudo apt-get install subversion libjpeg8-dev imagemagick libav-tools
2013-01-02 23:39:17 +00:00
wget -Omjpg-streamer.tar.gz http://mjpg-streamer.svn.sourceforge.net/viewvc/mjpg-streamer/mjpg-streamer/?view=tar
tar xfz mjpg-streamer.tar.gz
cd mjpg-streamer
make
This should hopefully run through without any compilation errors. You should then be able to start the webcam server:
pi@raspberrypi ~/mjpg-streamer $ ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so"
MJPG Streamer Version: svn rev:
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format............: MJPEG
[...]
o: www-folder-path...: disabled
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
2013-01-02 23:49:44 +00:00
If you now point your browser to `http://<your Raspi's IP>:8080/?action=stream` , you should see a moving picture at 5fps.
2013-01-18 22:23:50 +00:00
Open `~/.octoprint/config.ini` and add the following lines to it:
2013-01-02 23:39:17 +00:00
[webcam]
stream = http://< your Raspi ' s IP > :8080/?action=stream
2013-01-04 17:38:50 +00:00
snapshot = http://127.0.0.1:8080/?action=snapshot
2013-01-04 22:43:32 +00:00
ffmpeg = /usr/bin/avconv
2013-01-02 23:39:17 +00:00
2013-01-18 22:23:50 +00:00
Restart the OctoPrint server and reload its frontend. You should now see a Webcam tab with content.
2013-01-02 23:39:17 +00:00
If everything works, add the startup commands to `/etc/rc.local` .
2012-12-31 12:18:54 +00:00
Credits
-------
2012-12-26 23:04:12 +00:00
2013-01-18 22:23:50 +00:00
The OctoPrint started out as a fork of Cura (https://github.com/daid/Cura) for adding a web interface to its
printing functionality and was originally named Printer WebUI. It still uses Cura's communication code for talking to
the printer, but has been reorganized to only include those parts of Cura necessary for its targeted usecase.
2012-12-26 23:04:12 +00:00
2012-12-31 12:18:54 +00:00
It also uses the following libraries and frameworks for backend and frontend:
2012-12-26 23:04:12 +00:00
2012-12-31 12:18:54 +00:00
* Flask: http://flask.pocoo.org/
2013-01-18 22:43:50 +00:00
* Tornado: http://www.tornadoweb.org/
* Tornadio2: https://github.com/MrJoes/tornadio2
* Socket.io: http://socket.io/
2012-12-31 12:18:54 +00:00
* jQuery: http://jquery.com/
* Bootstrap: http://twitter.github.com/bootstrap/
* Knockout.js: http://knockoutjs.com/
* Flot: http://www.flotcharts.org/
* jQuery File Upload: http://blueimp.github.com/jQuery-File-Upload/
2013-01-02 23:39:17 +00:00
2013-01-03 14:25:20 +00:00
The following software is recommended for Webcam support on the Raspberry Pi:
2013-01-02 23:39:17 +00:00
* MJPG-Streamer: http://sourceforge.net/apps/mediawiki/mjpg-streamer/index.php?title=Main_Page
2013-01-18 22:23:50 +00:00
I also want to thank [Janina Himmen ](http://jhimmen.de/ ) for providing the kick-ass logo!
2013-01-18 23:06:41 +00:00
Why is it called OctoPrint and what's with the crystal ball in the logo?
------------------------------------------------------------------------
2013-01-21 17:38:31 +00:00
It so happens that I needed a favicon and also OctoPrint's first name -- Printer WebUI -- simply lacked a certain coolness to it. So I asked The Internet(tm) for advise. After some brainstorming, the idea of a cute Octopus watching his print job remotely through a crystal ball was born... [or something like that ](https://plus.google.com/u/0/106003970953341660077/posts/UmLD5mW8yBQ ).
2013-01-27 10:23:01 +00:00
What do I have to do after the rename from Printer WebUI to OctoPrint?
----------------------------------------------------------------------
If you did checkout OctoPrint from its previous location at https://github.com/foosel/PrinterWebUI.git, you'll have to
update your so-called remote references in git in order to make 'git pull' use the new repository location as origin.
To do so you'll only need to execute the following command in your OctoPrint/PrinterWebUI folder:
2013-01-27 10:23:55 +00:00
git remote set-url origin https://github.com/foosel/OctoPrint.git
2013-01-27 10:23:01 +00:00
After that you might also want to rename your base directory (which probably still is called 'PrinterWebUI') to 'OctoPrint'
and delete the folder 'printer_webui' in your base folder (which stays there thanks to Python's compiled bytecode files
even after a rename of the Python package to 'octoprint').
After that you are set, the configuration files are migrated automatically :)