diff --git a/README.md b/README.md index 98923ac..47d6338 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ -Printer WebUI -============= +Attention +========= -The Printer WebUI provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It currently +OctoPrint -- formerly known as Printer WebUI -- will be migrated to a new repository location reflecting its new name on Saturday 26th 2013. It will then +be located at http://github.com/foosel/OctoPrint. Please be prepared to upgrade your links and remote refs. Sorry for the inconvenience. + +OctoPrint +========= + +OctoPrint provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It currently allows * uploading .gcode files to the server and managing them via the UI @@ -16,7 +22,7 @@ allows * 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 -The intended usecase is to run the Printer WebUI on a single-board computer like the Raspberry Pi and a WiFi module, +The intended usecase is to run OctoPrint on a single-board computer like the Raspberry Pi and a WiFi module, 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. @@ -24,34 +30,34 @@ If you want to add a webcam for visual monitoring and timelapse support, you'll Dependencies ------------ -Printer WebUI depends on a couple of python modules to do its job. Those are listed in requirements.txt and can be +OctoPrint depends on a couple of python modules to do its job. Those are listed in requirements.txt and can be installed using `pip`: pip install -r requirements.txt -Printer WebUI currently only supports Python 2.7. +OctoPrint currently only supports Python 2.7. Usage ----- Just start the server via - python -m printer_webui.server + python -m octoprint.server 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 - python -m printer_webui.server --host=127.0.0.1 --port=8080 + python -m octoprint.server --host=127.0.0.1 --port=8080 Alternatively, the host and port on which to bind can be defined via the configuration. Configuration ------------- -The config-file `config.ini` for Printer WebUI is expected in its settings folder, which is located at `~/.printerwebui` -on Linux, at `%APPDATA%/PrinterWebUI` on Windows and at `~/Library/Application Support` on MacOS X. +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. The following example config should explain the available options: @@ -89,21 +95,21 @@ The following example config should explain the available options: analyzeGcode = True [folder] - # Absolute path where to store gcode uploads. Defaults to the uploads folder in the Printer WebUI settings folder + # Absolute path where to store gcode uploads. Defaults to the uploads folder in the OctoPrint settings folder uploads = /path/to/upload/folder - # Absolute path where to store finished timelapse recordings. Defaults to the timelapse folder in the Printer WebUI + # Absolute path where to store finished timelapse recordings. Defaults to the timelapse folder in the OctoPrint # settings dir timelapse = /path/to/timelapse/folder - # Absolute path where to store temporary timelapse files. Defaults to the timelapse/tmp folder in the Printer WebUI + # Absolute path where to store temporary timelapse files. Defaults to the timelapse/tmp folder in the OctoPrint # settings dir timelapse_tmp = /path/timelapse/tmp/folder Setup on a Raspberry Pi running Raspbian ---------------------------------------- -I currently run the Printer WebUI on a Raspberry Pi running Raspbian (http://www.raspbian.org/). I recommend to use +I currently run the OctoPrint on a Raspberry Pi running Raspbian (http://www.raspbian.org/). I recommend to use 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). @@ -116,9 +122,9 @@ listed in requirements.txt: cd PrinterWebUI pip install -r requirements.txt -You should then be able to start the WebUI server: +You should then be able to start the OctoPrint server: - pi@raspberrypi ~/PrinterWebUI $ python -m printer_webui.server + pi@raspberrypi ~/PrinterWebUI $ python -m octoprint.server * Running on http://0.0.0.0:5000/ If you also want webcam and timelapse support, you'll need to download and compile MJPG-Streamer: @@ -145,23 +151,23 @@ This should hopefully run through without any compilation errors. You should the o: commands..........: enabled If you now point your browser to `http://:8080/?action=stream`, you should see a moving picture at 5fps. -Open `~/.printerwebui/config.ini` and add the following lines to it: +Open `~/.octoprint/config.ini` and add the following lines to it: [webcam] stream = http://:8080/?action=stream snapshot = http://127.0.0.1:8080/?action=snapshot ffmpeg = /usr/bin/avconv -Restart the WebUI server and reload its frontend. You should now see a Webcam tab with content. +Restart the OctoPrint server and reload its frontend. You should now see a Webcam tab with content. If everything works, add the startup commands to `/etc/rc.local`. Credits ------- -The Printer WebUI started out as a fork of Cura (https://github.com/daid/Cura) for adding a web interface to its -printing functionality. 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. +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. It also uses the following libraries and frameworks for backend and frontend: @@ -175,3 +181,5 @@ It also uses the following libraries and frameworks for backend and frontend: The following software is recommended for Webcam support on the Raspberry Pi: * MJPG-Streamer: http://sourceforge.net/apps/mediawiki/mjpg-streamer/index.php?title=Main_Page + +I also want to thank [Janina Himmen](http://jhimmen.de/) for providing the kick-ass logo! diff --git a/printer_webui/LICENSE b/octoprint/LICENSE similarity index 100% rename from printer_webui/LICENSE rename to octoprint/LICENSE diff --git a/printer_webui/__init__.py b/octoprint/__init__.py similarity index 100% rename from printer_webui/__init__.py rename to octoprint/__init__.py diff --git a/printer_webui/printer.py b/octoprint/printer.py similarity index 99% rename from printer_webui/printer.py rename to octoprint/printer.py index 4c282bb..a827509 100644 --- a/printer_webui/printer.py +++ b/octoprint/printer.py @@ -8,10 +8,10 @@ import threading import copy import os -import printer_webui.util.comm as comm -from printer_webui.util import gcodeInterpreter +import octoprint.util.comm as comm +from octoprint.util import gcodeInterpreter -from printer_webui.settings import settings +from octoprint.settings import settings def getConnectionOptions(): """ diff --git a/printer_webui/server.py b/octoprint/server.py similarity index 98% rename from printer_webui/server.py rename to octoprint/server.py index bbf3fc7..5c8798d 100644 --- a/printer_webui/server.py +++ b/octoprint/server.py @@ -10,16 +10,16 @@ import os import fnmatch import threading -from printer_webui.printer import Printer, getConnectionOptions, PrinterCallback -from printer_webui.settings import settings -import printer_webui.timelapse as timelapse +from octoprint.printer import Printer, getConnectionOptions, PrinterCallback +from octoprint.settings import settings +import octoprint.timelapse as timelapse BASEURL = "/ajax/" SUCCESS = {} UPLOAD_FOLDER = settings().getBaseFolder("uploads") -app = Flask("printer_webui") +app = Flask("octoprint") printer = Printer() @app.route("/") diff --git a/printer_webui/settings.py b/octoprint/settings.py similarity index 70% rename from printer_webui/settings.py rename to octoprint/settings.py index 97fc40c..a7a743c 100644 --- a/printer_webui/settings.py +++ b/octoprint/settings.py @@ -6,7 +6,8 @@ import ConfigParser import sys import os -APPNAME="PrinterWebUI" +APPNAME="OctoPrint" +OLD_APPNAME="PrinterWebUI" instance = None @@ -52,18 +53,12 @@ class Settings(object): self.load() def init_settings_dir(self): - # taken from http://stackoverflow.com/questions/1084697/how-do-i-store-desktop-application-data-in-a-cross-platform-way-for-python - if sys.platform == "darwin": - from AppKit import NSSearchPathForDirectoriesInDomains - # http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/func/NSSearchPathForDirectoriesInDomains - # NSApplicationSupportDirectory = 14 - # NSUserDomainMask = 1 - # True for expanding the tilde into a fully qualified path - self.settings_dir = os.path.join(NSSearchPathForDirectoriesInDomains(14, 1, True)[0], APPNAME) - elif sys.platform == "win32": - self.settings_dir = os.path.join(os.environ["APPDATA"], APPNAME) - else: - self.settings_dir = os.path.expanduser(os.path.join("~", "." + APPNAME.lower())) + self.settings_dir = _resolveSettingsDir(APPNAME) + + # migration due to rename + old_settings_dir = _resolveSettingsDir(OLD_APPNAME) + if os.path.exists(old_settings_dir) and os.path.isdir(old_settings_dir) and not os.path.exists(self.settings_dir): + os.rename(old_settings_dir, self.settings_dir) def load(self): self._config = ConfigParser.ConfigParser(allow_no_value=True) @@ -144,3 +139,16 @@ class Settings(object): sectionConfig[key] = value self._changes[section] = sectionConfig +def _resolveSettingsDir(applicationName): + # taken from http://stackoverflow.com/questions/1084697/how-do-i-store-desktop-application-data-in-a-cross-platform-way-for-python + if sys.platform == "darwin": + from AppKit import NSSearchPathForDirectoriesInDomains + # http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/func/NSSearchPathForDirectoriesInDomains + # NSApplicationSupportDirectory = 14 + # NSUserDomainMask = 1 + # True for expanding the tilde into a fully qualified path + return os.path.join(NSSearchPathForDirectoriesInDomains(14, 1, True)[0], applicationName) + elif sys.platform == "win32": + return os.path.join(os.environ["APPDATA"], applicationName) + else: + return os.path.expanduser(os.path.join("~", "." + applicationName.lower())) \ No newline at end of file diff --git a/printer_webui/static/css/bootstrap-responsive.css b/octoprint/static/css/bootstrap-responsive.css similarity index 100% rename from printer_webui/static/css/bootstrap-responsive.css rename to octoprint/static/css/bootstrap-responsive.css diff --git a/printer_webui/static/css/bootstrap-responsive.min.css b/octoprint/static/css/bootstrap-responsive.min.css similarity index 100% rename from printer_webui/static/css/bootstrap-responsive.min.css rename to octoprint/static/css/bootstrap-responsive.min.css diff --git a/printer_webui/static/css/bootstrap.css b/octoprint/static/css/bootstrap.css similarity index 100% rename from printer_webui/static/css/bootstrap.css rename to octoprint/static/css/bootstrap.css diff --git a/printer_webui/static/css/bootstrap.min.css b/octoprint/static/css/bootstrap.min.css similarity index 100% rename from printer_webui/static/css/bootstrap.min.css rename to octoprint/static/css/bootstrap.min.css diff --git a/printer_webui/static/css/jquery.fileupload-ui.css b/octoprint/static/css/jquery.fileupload-ui.css similarity index 100% rename from printer_webui/static/css/jquery.fileupload-ui.css rename to octoprint/static/css/jquery.fileupload-ui.css diff --git a/printer_webui/static/css/ui.css b/octoprint/static/css/ui.css similarity index 92% rename from printer_webui/static/css/ui.css rename to octoprint/static/css/ui.css index 39e3f0b..6632ef6 100644 --- a/printer_webui/static/css/ui.css +++ b/octoprint/static/css/ui.css @@ -57,6 +57,14 @@ table th.gcode_files_action, table td.gcode_files_action { width: 20%; } +#temperature-graph { + height: 350px; + width: 100%; + background-image: url("/static/img/graph-background.png"); + background-position: center; + background-repeat: no-repeat; +} + #temp { overflow: hidden; } diff --git a/printer_webui/static/img/glyphicons-halflings-white.png b/octoprint/static/img/glyphicons-halflings-white.png similarity index 100% rename from printer_webui/static/img/glyphicons-halflings-white.png rename to octoprint/static/img/glyphicons-halflings-white.png diff --git a/printer_webui/static/img/glyphicons-halflings.png b/octoprint/static/img/glyphicons-halflings.png similarity index 100% rename from printer_webui/static/img/glyphicons-halflings.png rename to octoprint/static/img/glyphicons-halflings.png diff --git a/octoprint/static/img/graph-background.png b/octoprint/static/img/graph-background.png new file mode 100644 index 0000000..aa93d01 Binary files /dev/null and b/octoprint/static/img/graph-background.png differ diff --git a/octoprint/static/img/logo.png b/octoprint/static/img/logo.png new file mode 100644 index 0000000..bf5286f Binary files /dev/null and b/octoprint/static/img/logo.png differ diff --git a/octoprint/static/img/tentacle-20x20.png b/octoprint/static/img/tentacle-20x20.png new file mode 100644 index 0000000..ba16913 Binary files /dev/null and b/octoprint/static/img/tentacle-20x20.png differ diff --git a/octoprint/static/img/tentacle-22x22.png b/octoprint/static/img/tentacle-22x22.png new file mode 100644 index 0000000..5010eba Binary files /dev/null and b/octoprint/static/img/tentacle-22x22.png differ diff --git a/octoprint/static/img/tentacle-32x32.png b/octoprint/static/img/tentacle-32x32.png new file mode 100644 index 0000000..de8ef20 Binary files /dev/null and b/octoprint/static/img/tentacle-32x32.png differ diff --git a/octoprint/static/img/tentacle-76x76.png b/octoprint/static/img/tentacle-76x76.png new file mode 100644 index 0000000..6bfb1a5 Binary files /dev/null and b/octoprint/static/img/tentacle-76x76.png differ diff --git a/printer_webui/static/js/WebSocketMain.swf b/octoprint/static/js/WebSocketMain.swf similarity index 100% rename from printer_webui/static/js/WebSocketMain.swf rename to octoprint/static/js/WebSocketMain.swf diff --git a/printer_webui/static/js/WebSocketMainInsecure.swf b/octoprint/static/js/WebSocketMainInsecure.swf similarity index 100% rename from printer_webui/static/js/WebSocketMainInsecure.swf rename to octoprint/static/js/WebSocketMainInsecure.swf diff --git a/printer_webui/static/js/bootstrap.js b/octoprint/static/js/bootstrap.js similarity index 100% rename from printer_webui/static/js/bootstrap.js rename to octoprint/static/js/bootstrap.js diff --git a/printer_webui/static/js/bootstrap.min.js b/octoprint/static/js/bootstrap.min.js similarity index 100% rename from printer_webui/static/js/bootstrap.min.js rename to octoprint/static/js/bootstrap.min.js diff --git a/printer_webui/static/js/jquery.fileupload.js b/octoprint/static/js/jquery.fileupload.js similarity index 100% rename from printer_webui/static/js/jquery.fileupload.js rename to octoprint/static/js/jquery.fileupload.js diff --git a/printer_webui/static/js/jquery.flot.js b/octoprint/static/js/jquery.flot.js similarity index 100% rename from printer_webui/static/js/jquery.flot.js rename to octoprint/static/js/jquery.flot.js diff --git a/printer_webui/static/js/jquery.iframe-transport.js b/octoprint/static/js/jquery.iframe-transport.js similarity index 100% rename from printer_webui/static/js/jquery.iframe-transport.js rename to octoprint/static/js/jquery.iframe-transport.js diff --git a/printer_webui/static/js/jquery.ui.widget.js b/octoprint/static/js/jquery.ui.widget.js similarity index 100% rename from printer_webui/static/js/jquery.ui.widget.js rename to octoprint/static/js/jquery.ui.widget.js diff --git a/printer_webui/static/js/knockout-2.2.0.js b/octoprint/static/js/knockout-2.2.0.js similarity index 100% rename from printer_webui/static/js/knockout-2.2.0.js rename to octoprint/static/js/knockout-2.2.0.js diff --git a/printer_webui/static/js/socket.io.js b/octoprint/static/js/socket.io.js similarity index 100% rename from printer_webui/static/js/socket.io.js rename to octoprint/static/js/socket.io.js diff --git a/printer_webui/static/js/socket.io.min.js b/octoprint/static/js/socket.io.min.js similarity index 100% rename from printer_webui/static/js/socket.io.min.js rename to octoprint/static/js/socket.io.min.js diff --git a/printer_webui/static/js/ui.js b/octoprint/static/js/ui.js similarity index 100% rename from printer_webui/static/js/ui.js rename to octoprint/static/js/ui.js diff --git a/printer_webui/templates/index.html b/octoprint/templates/index.html similarity index 98% rename from printer_webui/templates/index.html rename to octoprint/templates/index.html index 2910478..3dfd227 100644 --- a/printer_webui/templates/index.html +++ b/octoprint/templates/index.html @@ -1,9 +1,9 @@ - Printer WebUI + OctoPrint - + @@ -20,7 +20,7 @@ @@ -118,7 +118,7 @@
-
+
diff --git a/printer_webui/timelapse.py b/octoprint/timelapse.py similarity index 98% rename from printer_webui/timelapse.py rename to octoprint/timelapse.py index 8658835..189b048 100644 --- a/printer_webui/timelapse.py +++ b/octoprint/timelapse.py @@ -2,7 +2,7 @@ __author__ = "Gina Häußge " __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' -from printer_webui.settings import settings +from octoprint.settings import settings import os import threading diff --git a/printer_webui/util/README b/octoprint/util/README similarity index 100% rename from printer_webui/util/README rename to octoprint/util/README diff --git a/printer_webui/util/__init__.py b/octoprint/util/__init__.py similarity index 100% rename from printer_webui/util/__init__.py rename to octoprint/util/__init__.py diff --git a/printer_webui/util/avr_isp/__init__.py b/octoprint/util/avr_isp/__init__.py similarity index 100% rename from printer_webui/util/avr_isp/__init__.py rename to octoprint/util/avr_isp/__init__.py diff --git a/printer_webui/util/avr_isp/chipDB.py b/octoprint/util/avr_isp/chipDB.py similarity index 100% rename from printer_webui/util/avr_isp/chipDB.py rename to octoprint/util/avr_isp/chipDB.py diff --git a/printer_webui/util/avr_isp/intelHex.py b/octoprint/util/avr_isp/intelHex.py similarity index 100% rename from printer_webui/util/avr_isp/intelHex.py rename to octoprint/util/avr_isp/intelHex.py diff --git a/printer_webui/util/avr_isp/ispBase.py b/octoprint/util/avr_isp/ispBase.py similarity index 100% rename from printer_webui/util/avr_isp/ispBase.py rename to octoprint/util/avr_isp/ispBase.py diff --git a/printer_webui/util/avr_isp/stk500v2.py b/octoprint/util/avr_isp/stk500v2.py similarity index 100% rename from printer_webui/util/avr_isp/stk500v2.py rename to octoprint/util/avr_isp/stk500v2.py diff --git a/printer_webui/util/comm.py b/octoprint/util/comm.py similarity index 99% rename from printer_webui/util/comm.py rename to octoprint/util/comm.py index 6666968..c842c31 100644 --- a/printer_webui/util/comm.py +++ b/octoprint/util/comm.py @@ -12,10 +12,10 @@ import Queue as queue import serial -from printer_webui.util.avr_isp import stk500v2 -from printer_webui.util.avr_isp import ispBase +from octoprint.util.avr_isp import stk500v2 +from octoprint.util.avr_isp import ispBase -from printer_webui.settings import settings +from octoprint.settings import settings try: import _winreg diff --git a/printer_webui/util/gcodeInterpreter.py b/octoprint/util/gcodeInterpreter.py similarity index 99% rename from printer_webui/util/gcodeInterpreter.py rename to octoprint/util/gcodeInterpreter.py index 8ba22ab..1db8585 100644 --- a/printer_webui/util/gcodeInterpreter.py +++ b/octoprint/util/gcodeInterpreter.py @@ -5,7 +5,7 @@ import math import re import os -from printer_webui.util import util3d +from octoprint.util import util3d preferences = { "extruder_offset_x1": -22.0, diff --git a/printer_webui/util/util3d.py b/octoprint/util/util3d.py similarity index 100% rename from printer_webui/util/util3d.py rename to octoprint/util/util3d.py diff --git a/run b/run new file mode 100644 index 0000000..0458401 --- /dev/null +++ b/run @@ -0,0 +1,7 @@ +#!/bin/sh + +PYTHON=`which python` +DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +cd $DIR +$PYTHON -m octoprint.server $@ \ No newline at end of file