If the comm layer starts sending state changes (e.g. to auto detect)
before the constructor returns, self._comm in the printer interface is
still None and thus states can't be decoded.
Probably part of #3653
We don't want to try to send our beforeDisconnect script if we aren't
properly connected, as that will severely delay Disconnect execution, so
we now limit that to operational states and thus allow a quick(er)
connection abort during auto detection or connection attempt.
Instead hold them back until the next slot.
Otherwise we might never get the final switch to Offline as after that
there are no current data upgrades anymore.
Static assets where being sent with session cookies. That doesn't make
sense and might actually cause issues if an asset takes *just* long
enough to load to be overtaken by a login request from something like
the loginui.
Found with the E2E tests, which turned out to be less flaky themselves
than thought 🥳
We now wait for full app initialization (OctoPrint.coreui.startedUp &
OctoPrint.loginui.startedUp) before trying to test against things.
At least in local test runs that solved the flakiness.
It might cause SyntaxErrors in third party plugins that cannot be
caught by the system and which then nuke ALL other third party plugins.
See Sebclem/OctoPrint-SimpleEmergencyStop#14 and
FormerLurker/Octolapse#567
This change can manually be applied by setting
``` yaml
devel:
webassets:
minify: false
```
in config.yaml
filetype dependency requires paths as str, so we need to make sure
we provide what will be identified as a native str type under both
py2 and 3.
Closes#3630
Add "setTargetFromProfile" and "setTargetToZero" wrapper for setting entire profiles
Add helper function to retrieve the temperature profiles description
Just because we run with `--debug` doesn't mean we also have installed
the development dependencies. So in case we can't import `pyinstrument`
we should handle that gracefully even if `perfprofile` is requested.
We actually also support moving folders, so why not reflect that in the
UI. And instead of introducing a new permission, we should stick to
what a move actually is - a (re)upload and a delete, so if both of these
permissions are granted, moving is allowed as well. Also make sure to
disable the move action for anything not on local storage, also
visually. Finally, make current (source) folder visible and use it to
preselect entry from folder list, which should also be calculated from
the existing data instead of requiring another file list fetch.
We now also include publication date, last push date, release & release
date and github stars in the UI (if available), allow sorting by all
that and also visually highlight abandoned/disabled/incompatible
plugins. Also there's a now a filter to hide abandoned plugins and an
indicator of how many plugins of all available ones are being shown with
the currently active filters and search.
Implements #3606
We now need to have at least 150MB (configurable) of free disk space on
all of site-packages, plugins and temp folder locations available in
order to enable updates.
Closes#2312
That somehow got forgotten. Wasn't needed since bundled always get
loaded, however now that we display that kind of information in the
plugin manager it should reflect reality.
Now they no longer are separate processes but one merged one.
Port detection now will only test the two most common baudrates plus
any additionally configured ones if there is more than one port to test,
that way the additional overhead of having to cycle through both port
and baudrate should be greatly reduced.
As a consequence all avr_isp references have been finally removed.
Closes#3394
Current Jinja versions no longer allow modifying variables set outside
of for loops inside them. So something like:
{% set mark_active = True %}
{% for item in items %}
# do something
{% if mark_active %}
# do something more
{% set mark_active = False %}
{% endif %}
{% endfor %}
no longer works - mark_active will be reset on every iteration of the
loop to its initial value False. The fix is to use namespaces to
hold the modifiable values instead:
{% set ns = namespace(mark_active = True) %}
{% for item in items %}
# do something
{% if ns.mark_active %}
# do something more
{% set ns.mark_active = False %}
{% endif %}
{% endfor %}
See also #1697 and
https://jinja.palletsprojects.com/en/2.11.x/templates/#assignments
The Jinja dependency upgrade thus introduces a breaking change for
plugins as well. However, it was necessary for security reasons: older
versions have a bug that could allow template authors to break out of
the template sandbox. Not a huge risk in the context of OctoPrint
(plugins already have a lot more power than jinja would give them),
but still overdue to fix.
This reverts commit 73fbd15b
The change causes a full rescan for renaming on the uploads folder.
Unintended, needs to be looked at closer at a later date.
We didn't change any code between the last working build and the current
state since this is the master branch, so stop complaining. We'll
fix this in maintenance/1.4.1 in one way or the other.
Anything that's been closed for over a year definitely is outdated.
We really don't want people to play necromancer on ancient tickets,
it just causes support overhead (having to explain that code has
changed a ton since then and issue is likely a different one) or
user frustration (no reply).
If we can't load stuff from the backend, don't get stuck in "pip not
available" mode (which confuses people terribly) but instead show a
dedicated error.
We can't query the setting from the firmware, and we also can't reliably
track it through OctoPrint as it could be modified through GCODE
triggered through a file on the SD card and/or interactions with the
controller. Hence we now properly reflect that this value is write only
by emptying it 5s after focus loss (with a little opacity pulse to warn
about that) and immediately on sending.
That should hopefully make it a bit clearer that this value cannot be
trusted and will never reflect the firmware value unless query commands
or status reports are added for that in firmware.
Closes#3569 (though in a different way than intended by OP)
It's causing issues on rollback (integer can't be accessed like a dict).
We don't actually need it at the moment, so remove it for now and
instead add some sanity checking to the file reader.
User group is no longer enforced on all users. It is pre-checked
for new users (unless made non default) but can be disabled. That
makes it possible to have users without groups (and thus no
permissions) so beware!
TODO: Issue with default=False being written to groups.yaml,
causing the users group to not be enabled by default. Will be
solved in another commit.
Closes#3547
Use tornado.gen.coroutine as tornado.web.asynchronous is now deprecated
tornado.ioloop.PeriodicCallback no longer supports the io_loop argument.
tornado.httputil.HTTPServerRequest.supports_http_1_1 is now depricated use tornado.httputil.HTTPServerRequest.version attribute instead
We might not get the full set of data we want from the add_file
call and thus need to enrich the data further with our own
analysis results.
Whatever we get supplied from the caller will always win.
* Run with silent=false to catch issues in templates, such as missing
extensions
* Add missing extensions to fix compile errors
* Fix formatting (can't apply settings to multiple headers, need to
reapply, ini format!)
To profile a given request, just add ?perfprofile to the url. Instead of
returning the actual results, an HTML presentation of the profiling
results is returned.
This is only enabled when debug mode is enabled.
Should work around rare cases where the firmware reports invalid
tools that aren't invalid. Should usually not be needed, but there
are enough people with broken configs out there that this might
actually help people to stay running, as meh as it is.
Fixes errors from Click about ASCII encoding:
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment
This system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the follow
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
Should hopefully unearth cases where the system has a connection to the
internet but name resolution is broken in some way.
We default to resolving octoprint.org.
It was not comparing scheme (which it should), it was doing the hostname
check case sensitively (which it shouldn't) and it didn't take into
account default ports.
Should close#3519
Provides one part of the solution to #3482. The other part is sadly
on the shoulders of the user, who needs to setup either a whole domain
hierarchy to not run into "third party page" issues that would trigger
SameSite=Lax blocking, or needs to reconfigure their setup to use
https and make sure to set Secure to true.
Closes#3482 (there's nothing else I can do here)
Copied the description about errors-argument from Pyh-Doc (https://docs.python.org/3/howto/unicode.html).
Im not sure how to create the HTML-Doc out of this file. So, I could not test the doc-output.
Otherwise the page won't load at all because the js/css/less files are
taken from the gz versions which are empty.
Introduced by #3497
TODO: Fix gzip encoding under Python 2 (gzip.compress doesn't exist)
Order definition might contain either the plugin identifier or the
identifier of the component it replaces. Take that into account when
resolving order mapping.
Closes#3403
Gets rid of sliders as well (since those don't work without an upper
limit) and adds a note to both that they are "write-only" as we don't
have a way to query the current values from the firmware (yay...).
Modifies #3503
Also fixes a bug in #3503, which only adjusted the client side
boundaries but forgot about the server side.
* url_for in preload instead of (potentially wrong due to prefixes)
absolute URLs to /static/...
* error resilience in case of any issues during .gz generation
* bug fix in mime type detection
* code formatting & naming here and there
Used to default to 5s, now set by default to 10s, can be completely
disabled by settings devel.sockJsConnectTimeout to 0.
Might be a possible solution for #3502.
Memoize `settings.config_hash` and `settings.effective_hash`. The
hashes will only be calculated on the first call to the respective
functions. These memoized values are invalidated when the settings
object becomes dirty, or the settings are loaded from the config file.
Reason for change: During a refresh of the root route (/), the hash of
`settings.effective.yaml` is calculated 5 times. Each call lead to a
large configuration object to be serialized to a YAML string, which would
then be hashed. As it turns out, serializing to YAML is expensive.
Note: while I do not see `settings.config_hash` hit during a refresh,
but making a change to it was easy and appropriate. It's possible that
other areas of the application may see some benefit.
Performance (on my 2016 Macbook Pro:
- building of initial cache on startup:
- before: ~3.4s
- after: ~2.9s
- loading `http://octoprint/?_refresh=1`
- before: ~1100ms
- after: ~200ms
- Only compute etag once (rather than twice) per request.
- Only stat files once per request.
- Avoid calling `isdir` or `isfile` in `collect_files`.
- Leave it to `compute_lastmodified` to stat files, which tells us if
the path exists, if it is a file, and it's last modified.
- Reduces the number of stat systemcalls by 50%.
Some firmware variants (Ultimaker 2/2+, maybe others) send a file
selected message while just scrolling through the SD file list on the
integrated controller unit. M27 polling right after file selection might
cause issues for them. This patch allows to work around that.
Closes#3479
See also #1407
It's 2020, and that version was from 2013. Lots of stuff changes in that
time.
Also, get rid of some tests that are now universally supported, as well
as tests that are enabled and never used
This also signficantly improves performance, since the new version is
much simpler.
This compresses the static assets with gzip on server startup, and then
serves them up compressed to clients.
The compression is done at server startup because some boards have very
anemic CPUs and slow "disks", so loading from disk pre-compressed and
avoiding CPU usage is a big win.
Renamed to firmware check, published to PyPI, on a different release
cycle and version number scheme than core OctoPrint but still considered
bundled via a new mechanism to mark external plugins as such.
This will speed up deployment of new firmware checks in case of new
printers with disabled thermal runaway protection, or stuff like the CBD
firmware.
For some reason people just don't seem to see the big fat blue "Print"
button on their loaded print job and then get confused when they can't
reprint the same file that's already loaded. So let's work around this.
If the socket is already logged out it will be an AnonymousUser
and thus not a SessionUser.
We shouldn't actually be pushing this without a round over an RC but
frankly I don't want to postpone the release for two weeks (as next week
is kinda busy) just to solve this obvious issue with zero side effects.
So here I am doing things I shouldn't.
is_blueprint_protected should mean a requirement of a logged in non
anonymous user. Implemented accordingly. Got forgotten during switch to
granular permission system.
Otherwise alternative UIs might still be wide open, and caching and such
was also really painful to solve before.
The LoginUI Plugin is pretty much just a distilled ForceLogin plugin.
Also declared it as hidden so it won't show up/be manageable by the
plugin manager.
It was not reported if firmware detection was disabled, even though one
should not have anything to do with the other.
Not a regression, but considering that it negatively impacts the printer
safety plugin that relies on firmware info it'll go into 1.4.0
regardless.
Was present in forcelogin and made sure that plugins triggering a
message on the socket immediately after connect would get through right
after auth.
Without this a lot of plugins out there run into issues, so this is a
backwards compatibility fix for a regression in 1.4.x.
See also #3400
We need to actually try to identify the user just like we used to do
with the forcelogin plugin. Just checking permissions will only work
if we already have a session.
Closes#3434
E.g. in Firefox reopen tab while server is down - FF will use a cached
copy and for some reason sockjs won't notice that stuff is down. So now
we have a timeout of 5s for initial connection that takes care of that.
May act as entry point for any kind of push messages a plugin might
wish to send to the client after a connect happened. Since depending
on the current permission configuration this might only be possible
once the client has authenticated on the socket, this is required.
Should close#3400
Needed its own permission, which in turn needed some changes in how the
whole "guest without read permission" situation is handled. I've
reintroduced a custom login view since the main UI would not be able
to fully load up without settings access. Said login view will override
the default UI view if the account in question does not have
Permissions.STATUS and also Permissions.SETTINGS_READ. It pretty much is
the forcelogin plugin from 1.3.x.
Closes#3425
We should only clear out the identity when the session has actually
been deemed deleted, not just on staleness due to e.g. a client IP
change.
Closes#3370
Remove code that would lead to a refresh upon receiving a
'Cache-Control: no-cache' or 'Pragma: no-cache' in a request. The
purpose of these headers is to invalidate intermdiate proxy caches, not
that of an application server. A refresh in octoprint would lead to
several seconds of high CPU utilization on lower-power systems (like the
Raspberry Pi), leading to stuttering in print jobs.
It is still possible to explicitly cause a refresh by including
`_refresh` in the query parameters of a request.
We already have Github's releases with all the changes, we don't need to
keep everything twice.
Instead of the changelog included in the about dialog there's now a link
to the release list, that should suffice.
Implements #3342
Additional "clean up all leftovers" feature to clean up anything left
over by plugins already uninstalled.
Also takes care of entries in the disabled plugin list now.
See also #3299
Plugin data can now be cleaned up
* on a plugin's uninstall through the plugin manager
* manually through a new action button in the plugin manager
Implements #3299
Ideas for further improvement:
* Management interface to show "orphaned" plugin data and delete
on request.
Will allow people to circumvent the
shoot-yourself-in-the-foot-countermeasures by editing config.yaml.
If they do that and stuff then fails due to platform instability it's
their problem.
Should fix#3301, or at least make it way less likely to happen.
The problem seems to have been made worse by `M25` not being blocking
on Klipper and thus the SD printing not being guaranteed to have stopped
yet after its return, meaning the following `M26 S0` will be denied,
causing the file position to not be properly reset and hence the issue
to arise in the first place.
On the push socket only available for admin users.
ClientOpened now also get the remoteAddress stripped from the payload
for guests on the push socket.
Implements #783
No, this doesn't mean that you can start timelapses manually or
anything, only that you do not need to be connected to a printer in
order to change the default timelapse configuration.
The previously suggested `service` folder is not available in a canonical
systemd installation. Instead new services should be placed in
`/etc/systemd/system/`
sorted does no longer support sorting None values under Python 3. This
patch introduces a utility function that ensures that None values are
replaced by a configurable default value ("" by default) and utilizes
it in places where sorted gets called with a custom sorting key that
can potentially consist of None values.
Closes#3300
* Set X-Content-Type-Options to nosniff
* Set X-Frame-Options to sameorigin (if not configured otherwise)
* SockJS iframe fallback no longer embeds sockjs library from a CDN
* SockJS no longer rewrites the unused JSESSIONID cookie
This is the last version that supports stock OctoPi 0.14, catering
towards the ancient setuptools and pip versions found on it becomes
more and more unjustifiable overhead.
We don't want to get swamped by third party plugin error messages on
sentry as that costs money.
Blacklist astroprint messages since they caused issues in the past.
Making the plugin hook work would be a ton of overhead due to the
components dictionary that needs to be supplied to it for user manager
initialization, however at the very least we should support
configuration of the used user manager class.
Both features are rarely used if at all, but we should be aware of this.
Also changed some wording, fixed to unicode and removed redundancy from
the sub commands (e.g. just "add" instead of "add_user") and flags.
Revalidation header from ceade46dd7 was
overwriting custom header in case of active wizards, causing the browser
to cache HTML code with enabled wizards.
This fixes this by checking if the headers in question actually need to
be set and aren't already there.
If the printer keeps requesting the same line over and over again,
something is either seriously wrong with the line or with the connection
In any case, log an error and disconnect.
Fixed plugin install message for UI (never worked!)
Fixed grammar in connectivity initial setup
Added space at end of lines for several multiline messages
Added confirmation dialog before disabling plugin
Added configuration options to control the confirmation dialogs
Defaults are not to confirm for disabling but confirm for uninstalling
Originally introduced by PR #673 to fix reconnect issues on pyserial,
OctoPrint will first open the serial port with PARITY_ODD then close it
again and reopen with the desired PARITY_NONE. This works around issues
likely sitting somewhere in the linux tty layer, at least on some
distributions, that don't necessarily exist on other platforms.
Stop doing the workaround on FreeBSD to start with, as this is the only
platform I can effectively test. I suspect MacOS/Windows likely also don't
need to do this.
events > subscriptions[] > event may be either a string (existing
functionality) or now a list of strings. If a list, the subscriptions
are treated the same for each event in the list.
To make it possible for command subscriptions to determine which event
was triggered, a {__eventname} substitution has been added.
While long term we want to have unicode here, the rest of the code
is not even remotely prepared for handling utf-8 strings as visible in
the large amount of unicode issues visible in sentry.
So for now we go back to byte objects and fix#3091 differently
We know that python 2.7 is about to reach end of life. We are making
preparations for this in the devel branch. We don't need pip going
around and alarming our users about something they cannot solve, and
which pretty much is already solved anyhow.
So we nuke this stupid message present in current pip versions. Hard.
See also #2988
We are only interested in
* Exceptions that are
* logged either in octoprint.* or tornado.* and not from third party
plugins or unhandled
Implements #3094
It was causing a ton of issues with backend code using `Settings.save`
to persist changes outside of REST API calls, triggering configuration
update dialogs in the frontend way too often and when not needed.
Added a flag instead to cause the `save` method to trigger an event and
setting that to False by default. Settings REST API uses it, other
callees in e.g. plugin code will be able to as well in the future if
necessary.
It would be cleaner to always trigger this event and adjust calling code
and frontend code to compensate, but with third party plugins out there
this is not going to happen reliably so we go this route.
It's no longer installable from source under OctoPi 0.14 due to an
unpinned setup_requires dependency on setuptools_scm, and since we still
have to support that installation scenario that is a problem. Thankfully
it's only used in the plugin manager for parsing the notice date, and
we can just use datetime.strptime for that.
With the inclusion of the ForceLogin plugin that doesn't serve a real
purpose anymore in most cases, and it was only ever more of a rate
limiting feature than an actual security measure anyhow. Plus it lead to
a ton of false security alarms along the lines of "OMG UI_API_KEY IN THE
SOCKET HANDSHAKE, PWNED!!1!".
On stock installations, the behaviour will be unchanged since the
ForceLogin plugin prevents any kind of API access without authentication
that isn't the login request itself, including access to blueprint
plugin endpoints that do not specify that they are unprotected.
If a user decides to disable the ForceLogin plugin but keep access
control enabled, anonymous API access will now be possible without API
key or the need to fetch the current UI API Key from the server via the
websocket or the source code of the index page. This is a change
compared to earlier behaviour, but with a very limited impact as as
mentioned the UI API Key was so far also easily obtainable either via
the websocket or by parsing a fresh copy of the HTML page.
If the user decides to disable access control, there's no change
compared to previous behaviour.
Disabling the API - which was so far the only real use case for having
the UI API Key in the first place apart from basic rate limiting - has
also been removed. Allowing this only made things horribly complex as
the default frontend fully depends on the API's availability. Users
who do not wish third parties to have access to the API should
simply leave the ForceLogin plugin enabled.
Chamber temperatures reported via M105 will only be parsed if the
fw reports chamber capabilities (through Cap:CHAMBER_TEMPERATURE:1) or
the currently selected printer profile has a heated chamber configured.
This is to avoid incompatibility issues with firmware variants that
might already use the C parameter for something else (which might be the
case since we don't have a reliable well defined standard that people
need to adhere to...)
Chamber temperature commands M141 and M191 will only be allowed to be
sent if the selected printer profile has a heated chamber configured.
This mirrors the behaviour for the bed temperature commands M140 and
M190 and heated bed configuration.
Display of chamber data in the graph will only happen if the printer
profile has a heated chamber configured.
Implements one workflow behind #321
Instead of a boolean option to block sending of M0 *and* M1 and
hardcoding them and M25 to pause an ongoing print, we now have two lists
for blocked commands and pausing commands respectively.
Blocked by default: M0 and M1.
Pausing by default: M0, M1 and M25.
Implements #2970
-4 or --ipv4 will behave as if "--host 0.0.0.0" (or any other specific
v4 address) was supplied and only bind the server socket to v4. It will
be ignored if a v6 address is set to bind to.
-6 or --ipv6 will only bind the server socket to v6 instead of dual
stack on both v4 and v6. It will be ignored if a v4 address is set to
bind to.
Implements #2904
Improves performance of file manipulation, especially in cases with a
lot of files in the folder, without the added complexity of fully
decoupling metadata file serialization from general processing.
Better fix for #3057
Makes more sense than putting them into sys.modules as <identifier>,
which also can cause conflicts (e.g. in the case of octoprint.plugins
.logging which then suddenly gets found instead of the built-in crucial
logging module).
After two days of trying to make the plugin loading work completely,
including loading bundled templates etc, using only native importlib
methods, I've finally given up and bundled the (deprecated) imp module
for Python 3+ which relies on importlib but does some magic I've yet to
figure out which makes stuff just work.
Replacing imp completely with something more slim is something for
another day, for now we want to get stuff to work under Py3 with as
little warnings as possible.
Adding a plugin's identifier to the list plugins._forcedCompatible in
config.yaml will make OctoPrint ignore its python compatibility status,
e.g.
plugins:
_forcedCompatible:
- myplugin
This might be helpful for plugin authors during development but should
NOT be used in production!
See also #2722
We could also have set ALLOW_UNICODE globally, but this way we might
catch situations where we definitely do not expect mixed results between
py2 and py3.
If selected, the current layer is drawn at 30% opacity and then the progress is drawn over the top at 100%
Added additional checkbox on GCodeView page to include current layer as preview
The current 2.7 Python binary on Debian returns "2.7.15+" as its version, which
is not PEP440 compliant. Tthere is no feedback at all from Debian maintainers
regarding the bug report as of now:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914072
This patch makes sure to drop any trailing '+' character in a version string.
Fixes#3049
It lives on as curalegacy at
https://github.com/OctoPrint/OctoPrint-CuraLegacy
which will be added to the plugin repository once the first RC of 1.3.11
lands.
Due to this change, the general handling of STL files has also changed
slightly. They will no longer be supported by upload out of the box
unless a SlicerPlugin is available (which will now by default extend the
extension tree with STL files, unless overwritten). As a consequence of
that the file type filters in the file list have also been adjusted to
only show up if there are additional file types to filter for.
Also make sure that our environment specific dependencies get recorded
to the wheel so that we don't have to build in the same environment as
the software will run later (consider this work towards a PyPI release
that might also be backported).
* When no plugins are installed, backup does not create a
plugin_list.json file.
* Restore then fails when it tries to read the missing file.
* Add check to ensure plugin_list.json exists before restoring
from backup.
That's normal for plugins that were installed as eggs instead of wheels
and we don't want to raise the error in this case. If we also don't find
egg metadata we'll log a warning anyhow.
Any other exceptions will be raised though.
Normally I'd say, broken files are broken files, but since in case of an
encoding error in config.yaml the server won't come up anymore we are
erring on the side of caution here and running with errors="replace"
The general consensus regarding codecs.open appears to be that it's only
left in Python 3 for backwards compatibility (which I find kind funny
but I digress...) and that io.open should be used instead for Py2.6+
since it's available and behaving the same in both versions. So that's
what we do here.
NamedTemporaryFile doesn't support the encoding parameter under py2.
However, without it specifying text mode defaults to ascii, causing some
issues especially with config files containing utf-8.
By swapping NamedTemporaryFile for mkstemp and a custom io.open call
(parameterized according to the open mode) we can support a proper
encoding aware atomic_write.
Admin only access by default for these was implied by not having them
added to one of the three major default groups, making it explicit is
more clear though.
That way we can easily provide a Read Only group that allows read-only
access and which can then be added to the Guest group by users who
desire anonymous read-only access, similar to disabling the forcelogin
plugin in 1.3.10+
No events are about to be removed in 1.4.0, only the payload fields
marked as deprecated. And for some reason ReST doesn't appear to allow
including that piece of information within the `deprecated` directive,
so now we have a slightly different way of expressing it...
Necessary requests were wrongfully denied after initial setup of a user
account due to hasBeenCustomized still being used and its deprecated
wrapper wrapping the always False implementation in the UserManager base
class instead of the adjusted one in the FileBasedUserManager. Evil bug.
where required. At some places it's not.
Also, "if foo in some_dict.keys()" is unnecessarily slow.
Replaced with "if foo in some_dict".
I left "for key in some_dict.keys()" alone;
"for key in some_dict" is equivalent but not always obvious.
Should no longer match lines like
FIRMWARE_NAME:Marlin 1.1.7-C2 (Github) SOURCE_CODE_URL:https://github.com/Robo3D/Marlin-C2 PROTOCOL_VERSION:C2 MACHINE_TYPE:RoboC2 EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff EMERGENCY_CODES:M108,M112,M410
but should pass unit tests.
Fixes#2945
Should no longer match lines like
FIRMWARE_NAME:Marlin 1.1.7-C2 (Github) SOURCE_CODE_URL:https://github.com/Robo3D/Marlin-C2 PROTOCOL_VERSION:C2 MACHINE_TYPE:RoboC2 EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff EMERGENCY_CODES:M108,M112,M410
Fixes#2945
Allow configuration of whether to enable the plugin if firmware support
is detected, always or never. Handle PROMPT_SUPPORT capability report
accordingly.
See MarlinFirmware/Marlin#12982
Note: Has to be enabled manually for now as long as we cannot detect
that the firmware indeed has support for M876 and hence has it as part
of the EMERGENCY_PARSER.
See MarlinFirmware/Marlin#12982
These are never what we want, as they swallow KeyboardInterrupt.
TODO: many of these handlers really should be more specific and/or
log that they replaced an unparseable value with a default.
Currently uses a sponsored sentry instance on sentry.io. Error tracking
is disabled by default and currently still has to be enabled through
manual configuration in config.yaml (plugins.errortracking.enabled=true)
So far we only checked for keys or auth headers on the API, the plugin
so far only checked if there was an existing cookie via a passive login.
Now it will try to login the user from any provided api keys or
authorization headers as well and only fall back to the passive login if
that doesn't succeed. A call to the frontend with either will thus not
trigger the login dialog.
See #2997
If an M27 to query SD status came after the change of state to printing
but before the M24 to actually start the print on the printer's side the
firmware would report "Not SD printing" and OctoPrint would consequently
cancel the just start job right away.
This patch introduces a new "Starting" state that will be active while
preparing a print job (in case of SD: selecting the file, setting file
position & finally starting the print). The comm layer treats as
nearly identically to the Printing state, the only difference is in the
treatment of received "not sd printing" messages which will be ignored
while still Starting.
Additionally this patch introduces a "two strikes rule" for "not sd
printing" messages (which can be configured to be another number of
strikes). Only if OctoPrint receives two consecutive "not sd printing"
messages from the printer will it actually cancel the printer. This is
to work around a potential (albeit very very unlikely) race condition
that still exists even with the starting state.
Fixes#3001
There was still some redundancy due to how SD upload so far was
implemented. Things are now better reusable from hooks.
Also fixed the problem that OctoPrint would *always* use the first hook,
whether it actually handled the upload or not.
Adds print job owner (= user who selected/started a job) and user who
started/paused/resumed/cancelled a job to the print job events as
applicable.
Also added logging of print job events to octoprint.log with this
information.
Plugins can use the event data for further logging or tracking.
Implements #2982
I would have preferred it to just depend on the default styling of
search type inputs in browsers, which at least on Webkit and IE will add
a clear button automatically, but Firefox doesn't add one and the
corresponding ticket [1] also doesn't look like that will change soon.
So a custom implementation it is. Hooray.
Implements #2983
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=558594
Currently write timeouts are not really implemented (as they are set to 10000 seconds). The current code also has the unwanted side effect of casuing the use of a select call (in the Linux PySerial library) even when a write does not need to block. This call to select can in some odd cases cause the write to block for the duration of the set timeout which in turn triggers a transmission error. See issue https://github.com/foosel/OctoPrint/issues/2996
This change addresses both issues by allowing the use of the existing write retry code to handle timeouts and by using non-blocking write mode to avoid the use of select.
Users get too confused by the warning the lack of it generates on plugin
installs/uninstalls and updates of any kind through pip. An FAQ entry
on that matter hasn't helped, so we are now pulling out the nuclear
option to reduce support overhead.
Implements #2988
with responsive plugins like TouchUI, all of the pages render on mobile just fine.. except the login page. I was tired of scrolling much wider than my phone's display to make it show up, so I did some investigation. Turns out it was just missing the meta viewport.
Even if a user doesn't have a uuid at startup, they might enable tracking later and .. then a uuid isn't created until the next startup. For this reason and others, we shouldn't pass None to sha.update. Also, by adding a 'uuid missing' string to the log post, we can now track how many instances are missing a uuid for some reason. (though these may show now as a uuid of 'None').
If you have an ancient setuptools, 4a36ddb3aa
won't successfully prevent installing. These changes will at least give a sane error,
rather then just barfing on random syntax errors due to the `unicode` type not
being present in py3k.
Cherry picked from 2f20f2d
That will give us an idea if the current hypothesis that quite a number
of people are shutting down their instance at night is correct or not,
which in turn will inform future startup optimizations.
Otherwise if tracking is disabled we still do the work and then throw
it away, which is kinda stupid.
Also fixes potential issues with using things like the unique_id when
it hasn't in fact been set due to disabled tracking.
Regardless how cold the temperature is, display it in the table. Some
people otherwise seem to think that OctoPrint "can't handle"
temperatures below 10°C and will blame it for MINTEMP errors triggered
in the firmware.
SyntaxError:Can't assign to function call
declared the dictionary using a diferent format that works in both py2 and py3
/src/octoprint/server/api/system.py", line 192
async=True,
^
SyntaxError: invalid syntax
Sadly the stupid file locking of windows makes it impossible to
hot swap the config directory. In order to support windows a two step
approach would be needed. Maybe at a later date, currently simply not
worth the effort tbh considering how seldomly windows is used as OS for
OctoPrint.
Making on_after_startup asynchronous unearths some odd issue that causes
subsequent callback calls to duplicate. It might just be PyCharm's
debugger (disabling it makes the problem go away and I so far couldn't
reproduce it without it), but just in the case that I introduced some
weird race condition with this _async approach I'm removing it. I'd
rather have badly implemented plugins break the startup then the startup
being inherently broken from the get go.
Added a couple more warnings in the docs though.
* spinners for the enable/disable buttons
* error handler for persisting the decision that unlocks the wizard
Might help to work around issues less than a hand full of people have
now observed where the wizard's buttons are non functional but the
wizard itself is active and blocking.
More data needed to reproduce and debug the core issue though.
To work around some ad blockers that might block this otherwise - which
is kinda funny since the js file doesn't do any tracking, it just
makes the setup wizard for the opt-in functional 🤦♀️
- add a way to get the raw value only from throttle state (glad I already plumbed it into the object!)
- add warning about not sending uuid, modify the log entry too
- weave the throttle_state through pi_support and tracking. This should come in handy to see how many throttled Pis are out there, as well as if it is correllated with canceled prints.
- upgraded disclosure of tracking information so it shows as INFO-level in the logs and all the information is dumped. If tracking.octoprint.org gets it, I should have it too :)
This reverts commit 4ed5f7e
The updates cause issues on very old python environments (distribute
instead of setuptools, e.g. OctoPi 0.12) due to new package formats.
We'll postpone them to 1.3.11, since OctoPrint 1.3.10 will then refuse
to upgrade in such environments anyhow.
Apparently socket.has_ipv6 doesn't actually do what it says in the docs
(state whether the underlying platform supports ipv6). It returns True
even when ipv6 has manually been disabled for whatever reason. So we
will no longer trust this but instead attempt to actually create a v6
socket and only if that succeeds assume that v6 is indeed supported on
the platform.
`octoprint_setuptools` is imported into the build before the dependencies are installed, hence we don't have `past.builtins` yet. Since the `basestring` type was only needed for some asserts here that *usually* shouldn't be needed we can just comment out that stuff for now.
We don't need to be able to identify the same file across multiple
instances, just repeated prints on the same instance.
Thanks to @scoder for the suggestion.
Werkzeug update required a flask monkey patch since we can't update
flask due to it depending on a newer jinja version which is backwards
incompatible and hence would cause issues with third party plugins.
Also added notes to the dependencies that are found to be hard to update
so that future release preparations don't require to figure out the
"why not" all over again.
Apparently some exports contain ?print_temperature? instead of
{print_temperature} style placeholders? At least that was observed in
the example in #2629.
This fixes such placeholders.
There are more updates, but they introduce backwards compatibility
issues that would hurt third party plugins, so we need to find
workarounds for these first - or trigger a grace period.
* oncancel: callback to call when cancel button is pressed
* noclose: don't allow dismissing/closing the dialog without having
chosen to proceed or cancel
Show warning to protect the innocent who don't know better than to
port forward.
Warning is ignorable (per browser) to allow users who know what they are
doing to easily get rid of it. If you don't know what you are doing and
also actively ignore THIS warning I really can't help you anymore.
Some prepwork for py3. Tossing these together:
- assertItemsEqual doesn't do what it says on the box. It only said "hey, these lists have the same number of items". Not content or anything. Changing that to SetEqual, which is much closer to what is wanted- ensuring that lists have the same content without caring about their order.
- use assertRaises instead of try/catch
- update some mocks, especially mock_open.
- include the refactored test_get_recovery_data sent to the maintenance branch in #2806.
* oncancel: callback to call when cancel button is pressed
* noclose: don't allow dismissing/closing the dialog without having
chosen to proceed or cancel
We will now demand minimum versions of Python, pip and setuptools to be
present before we enable updating through the plugin.
Current minimum versions are those shipped with stock OctoPi 0.14.0.
* changed model detection implementation to use device-tree
* now active if running on a Pi, regardless whether that runs OctoPi
or not
* detect undervoltage/overheat issues via vcgencmd and report back on
UI
Try python3 import & revert back to python2 if ImportError is raised
this include BaseHttpServer -> http.server, StringIO -> io, HTMLParser -> html.parser
* are not directly iterable
* doesn't work with len() function
* doesn't allow list concatenation
This commit wraps all relevant map/filter outputs into a list object type
Otherwise we might run into some weird infinite loop issues within
pip's cache handling under certain circumstances, and we really
don't want to risk that in the field.
See also #2543 for another issue worked around by this, and
pypa/pip#3532 for the core issue
Snapshot test threw a 500 Internal Error.
After some investigation (no exception got thrown, except in debug mode) I noticed that the test url function tried to access octoprint util which was not imported.
Because util was used in different locations of this function I decided to put it at the top of the function right after import requests.
With multiple octopis, the theme/header color is really nice for quickly distinguishing them. But it doesn't help with an ocean of open tabs. This does- simply carry the theme color onto the favicon.
I could do this as a plugin and/or make it a configurable setting, but it's very small change that doesn't need that much overhead, and generally I have opinions about having a plethora of setting flags for nonfunctional things. Thanks to @jneilliii for [helping me through the viewmodels](https://discourse.octoprint.org/t/where-can-i-get-the-theme-color/2354/5).
(cherry picked from commit e1089de)
The documentation says that the estimated print time should be given in minute. But in practice, when I give it in minutes, the GUI shows an error factor of 60. By supplying it in seconds, the correct value is shown.
So it should probably actually be "in seconds"
beforePrint* should always precede any commands from the print job.
Also make sure we only jump from "finishing" to "operational" after the
afterPrintDone script has been sent. Also wait for all moves to finish.
It's apparently completely broken and the fact that no one noticed
and reported that means it never really gets used either from the looks
of it.
So instead of allowing it to introduce broken resend handling, we'll
rather remove it for now.
The later allows us to distinguish between a file having been streamed
completely and the print job done script having streamed completely as
well.
Should fix#2547
Could be triggered if two resend requests without an ok were directly
following each other, causing a resend ok timer to be triggered for each
and a consequent attempt to process the same resend status again.
Should fix#2632
* Repetier firmware versions prior to 0.92 don't have thermal runaway/
decouple detection, so we always warn about those
* If the firmware supports the THERMAL_PROTECTION capability report
but it's reported as disabled, we also warn about that (see also
MarlinFirmware/Marlin#10465)
Using two new hooks, plugins may now provide alternative implementations
for the GCODE analysis and the live print time estimation.
Should allow people to get creative with regards to #1203, #1905, #2281,
#2445, #2514
Implements #1797, #1905
"date" and "size" might be undefined on both parameters (e.g. for
folders, SD files). We have no guarantee that "a" will always have
either defined, so make sure to test or a wrong sorting order might be
the consequence.
Fixes#2355
The Settings dialog also allows some "instant actions" (e.g. adding
users, changing specific plugin settings and so on). Having to click on
"Cancel" after actually doing something just feels wrong in such cases
so the Settings dialog now has a "Close" instead of a "Cancel" button.
Other sub dialogs will stay as is since that better reflects their
behaviour.
Support egg "PKG-INFO" and wheel "METADATA" files in metadata folder. Less
guess work throughout the include path this way.
Better solution for #2625 than c3eebdb
We now initialize the folders when initializing the settings, so the
test that the folder didn't yet exist before retrieving its path
naturally failed.
* On startup: Check they are writable, if not revert to defaults
* On settings save: Check they are writable, if not return an HTTP 400
* In the settings dialog: Allow quick check of writability via Test
buttons
Should hopefully prevent users from nuking their instance by configuring
some custom folder that isn't writable.
TODO:
Currently simply doesn't close the settings dialog, needs some message
or something (or client side folder validation on clicking the button).
We now support adding other permissions to Permissions on creation, so
there's no need for this anymore.
Adjusted plugin permission addition accordingly by merging "regular" and
"combined" types.
Migrated log download permission.
Fixed some stuff here and there that I can't remember right now.
Session protection mode "strong" is apparently incompatible to the
remember me function in general and on top of that I observed issues
with at least Windows happily switching between connecting to an
instance via IPv4 and IPv6, causing changes in the reported client IP
and hence the session protection killing the session as a result.
"Missing linenumber" is apparently also an option we want to recognize
as non critical error, and while we are at it let's make sure we also
capture "linenumber" without a space for resend request communication
errors, just in case firmware devs add some variance here.
As suggested by @CapnBry, that should give us a significant speed
boost considering that yaml serialization and deserialization is some
orders of magnitude slower than json.
We only do that for the file metadata for now - it has the biggest gain
to expect from a speed boost, and having the configuration as yaml
actually has its readability advantages.
Workaround for firmware which doesn't provide a proper M114 report that might
be unparseable. We don't want to get stuck in such cases (which appear to be more
common than should be the case - this whole comm situation is just FUBAR).
For issue @485
Added progress bar to the Timelapse tab between the settings and files
Added code to process the output of ffmpeg and compute a percentage
Added code to communicate the percentage from the server to the client
Added myself to the authors
Changed tests to reflect new loglevel
Looks like Nagle's algorithm was the cause. Adding
option http-no-delay
to haproxy.cfg solves the problem without modification of the timeout,
however that is not an option for the thousands of instances already
deployed in the field.
So instead we add 300ms to the roundtrip based connection timeout, that
should hopefully get around any Nagle-induced delays (usually between
40 and 200ms according to various sites on the net).
For some reason the websocket connection runs into a timeout, the xhr
transport doesn't properly take over, and then stuff takes ages to
realign again.
Only happens under Tornado 5, doesn't happen under Tornado 4.5
Increasing the timeout for now instead of pinning to Tornado 4.5 in the
hopes that might still be figured out.
Incredibly weird though.
Malyan M200 identified by firmware name "Malyan" and model "M200".
Printer also known as Monoprice Select Mini, see also ID strings in
#2271.
CR-10S identified by "Author: (CR-10Slanguage)".
It appears to be unmaintained at the moment, and the current version
is incompatible to Tornado 5.
Instead of monkey patching ad infinitum we instead bundle the dependency
in the new vendor sub package.
Defaults to :: if IPv6 is supported, 0.0.0.0 otherwise. Both
intermediary server and Tornado are instructed to bind their sockets to
both IP versions.
Positive IPv6 support detection relies on
* socket.has_ipv6 being True
* socket.IPPROTO_IPV6 and socket.IPV6_V6ONLY being available (or
redefined in case of Windows) in order to ensure dual stack binding
for the intermediary server
Implements #2351
So far it was only deep-diving into frozendicts, not dicts (which might
contain frozendicts).
In principle we probably should also dive into tuples and lists and
other containers, but in our current application we don't put
frozendicts into those so let's not overdo it.
Ran into issues due to session wrapping in order to support custom
Json encoding.
We now make sure to
* only wrap non-raw sessions (since only those have send_jsonified
defined which we overwrite)
* overwrite tornado.escape.json_encode to use our custom encoder as
fallback, since that is used for RawWebsocketTransport
Fixes an issue with the /sockjs/websocket endpoint hinted at in #2529
If the start of the SD print could only be verified after the blocking
heatup was through, the start time was reset to None and hence the
heatup flag was not cleared on receival of the first ok, causing no
commands to be sent out and things to run into a timeout.
Fixes#2536
That will give us more accurate client ips, with a one hop limitation
however, see http://www.tornadoweb.org/en/stable/httpserver.html. If
more than one hop/reverse proxy is used in front of OctoPrint, their IPs
should be configured as server.reverseProxy.trustedDownstream in
config.yaml so they don't get detected as client IPs.
Implements #2512
Fixes 4 kinds of errors found with https://validator.w3.org/nu/#textarea
Bad value javascript for attribute lang on element script
Bad character after < . Probable cause: Unescaped < . Try
escaping it as < .
The element label must not appear as a descendant of the label element.
Element legend not allowed as child of element form in this context.
Note: the change related to <legend> seems big because of the increased
indent of the existing code (use "git diff --ignore-all-space" or
"git log --patch --ignore-all-space" to see the lines actually added).
Apparently the "big yellow box" hinting the contribution guidelines
vanished some time ago and got replaced by a teeny tiny link to the
right under "Helpful resources". Ah well.
For now the following commands are supported:
* @pause: Pauses the print
* @resume: Resumes the print
* @cancel or @abort: Cancels the print
As discussed in #2414. Also implements #324.
We can't easily upgrade to 0.3.0 right now due to backwards incompatible
changes in that version (some methods became properties). So for now
we simply backport the fix in question through a monkey patch.
Fixes#2296
We always read everything from the serial that is currently available in
our rx buffer but only return the first line in that. While that
increases our memory consumption slightly, it should hopefully not cause
issues and should greatly reduce the risk of buffer overflows making us
lose or receive corrupt data.
Possible solution for #2370 and #2454
* next command could be queued even if job was already on hold due to
a check missing
* context manager was too limiting, could lead to race conditions
where the job_on_hold flag wasn't set in time when moved to a
handler thread, introducing a dedicated set_job_on_hold method
for that solves this (at the downside of requiring more care from
plugin developers utilizing this)
Fixes#2467
Strongly depends on the firmware:
* Firmware must send a "File opened: ..." message on start of the
print
* Firmware must respond to an immediately sent M27 with "SD printing
byte <current>/<total>"
* Firmware must stay responsive during ongoing print to allow for
regular M27 polls (or push those automatically) or M25 to pause/
cancel the print through OctoPrint.
As discussed in #2317 this option was confusing and frustrating too many
people. Instead of an actual capture we'll now just do the same as for
z-based timelapses and use the last image repeatedly.
No, using the live webstream and capturing real time image is NOT an
option and not going to happen here, see the discussion in #2317 on this
as well.
Attempt to narrow down on #1951.
To be on the safe side, the use of frozendict here can be disabled by
settings devel.useFrozenDictForPrinterState to False in the config.
If firmware doesn't send an ok immediately after a resend request, we
will now be able to detect this (if enabled to do so) by starting a
timer that will simulate an ok after .5s if none has been received.
This should help with issues like prusa3d/Prusa-Firmware#331 where an ok
is only missing sometimes and not always, making the existing workaround
of always simulating an ok after a resend cause additional problems.
We so far switched immediately to "Operational" state, even while the M400/M114
combo and/or any post switch scripts were still being executed. That was confusing
and as witnessed in #2321 and also #2449 also could cause issues.
By parsing the main plugin file into a Python AST we can still extract
the control property values (as long as they are simple string
assignments or calls to gettext with a string argument) without having
to execute them in any way.
We want to avoid disabled plugins interfering with our application
in any way at all.
Hence disabled plugins are now treated the same way as blacklisted ones.
The system will only create a dummy entry for them and not import them
at all. As a consequence, a restart of the platform will be necessary
for disabling plugins that were disabled.
The Plugin Manager has been adjusted accordingly.
Note that by no longer even importing the base file, plugin name,
version, description and other such metadata defined through control
properties won't be accessible.
Closes#2442
Can be used to do some stuff while printing while ensuring that the file
won't continue to be streamed. Should be used sparingly and only for
very limited reasons since it can severely affect print results.
Commands injected/extended/rewritten through one of the phase hooks or
sent by a plugin through self._printer.commands will also be tagged with
"plugin:<plugin identifier>", allowing other code to detect these tags
and handle such commands differently.
That will be interesting for plugins that need to differentiate between
commands originating from the printed file vs the user vs the system vs
other plugins.
* migrate several actually serial & protocol related settings from
feature settings to serial settings
* migrate terminal auto uppercase blacklist from serial settings to
feature settings
* restructure the serial settings dialog
* adjust docs accordingly
If a printer supports auto reporting the temperature but doesn't also
support sending "wait" if the command buffer runs dry, it can happen
that a lost "ok" never gets detected properly because no timeout is ever
triggered (the printer is in fact sending data after all), but we should
actually try to get comms running again.
Introducing a custom ok timeout solves this. We reset this every time we
see an "ok", "wait" or "busy", but if we run into it while printing we
perform the same steps as if we hadn't received any data at all from the
printer over the duration of the currently active communication timeout
value (whether to choose "communication" or "communicationBusy" here
depends on whether we also detected support of the busy protocol or
not).
If the printer supports the busy protocol (which we should automatically
notice by it using it on the first blocking heatup or otherwise blocking
operation), it's safe reduce the communication timeout to a way way
lower value since the busy protocol should guarantee a heartbeat from
the printer at known intervals and so timeouts really should only happen
if something gets lost on the way.
We also set the interval on the printer to our configured busy timeout
minus 1s so we can be sure that we should always see a busy line from
the printer before we run into our own timeout. We do this via M113.
Starting with pip 7.x pip runs into an issue if a software package
formerly installed as a Python egg (= zip file stored in site-packages,
referenced through easy-install.pth, e.g. through a stand alone "python
setup.py install") is to be updated to a newer version.
The issue arises since the egg is still on the python path after the
replacement has taken place, and pip tries to read from it without error
handling for the fact that this file is now not longer existing. The
source of the problem appears to be with both the bundled as well as the
stock versions of pkg_resources and pip's usage of them to perform its
management duties. It's currently unclear if the problem is a bug or a
feature, even though it strongly looks like the first one.
In any case, during tests it was found that this problem can be worked
around by simply performing a second "pip install" with same parameters
right after the failed first one.
This patch detects this scenario based on the logged error message and
performs the second install if deemed necessary.
This is a preparational step to allow upgrade of the pyserial dependency
(and other dependencies currently installed as eggs as part of
OctoPrint's former "python setup.py install" installation procedure)
with OctoPrint 1.3.8, to finalize the fix for #2333.
This is causing issues on update thanks to the PySerial installation
logging an error if the former version was installed through
dependency resolution during OctoPrint's python setup.py install run
(which is most likely the case for pretty much all live installations
out there).
Update (and hence activation of fix for #2333) postponed until a
solution for this issue is found.
This reverts commit 77989d2a76.
Only done if the methods needed for that exist and are callable though
(to prevent issues with custom serial port implementations provided
through hooks, or operating systems that don't have support for
cancel_read/cancel_write in PySerial.
Fixes#2333 (at least as far as we'll ever be able to fix it)
This allows pythonic API clients to pass boolean values in:
requests.get('/api/printer', params={'history': True})
Previously this didn't work, as Octoprint doesn't see True as a boolean, it gets a sting. So it never matches True, it only matches "True".
Easy to test:
curl -H "X-Api-Key: x" http://octopi.local/api/printer?history=true | grep history
curl -H "X-Api-Key: x" http://octopi.local/api/printer?history=True | grep history
This is my suggestion on how to handle basic authentication for users
mananaged by OctoPrint's UserManager.
In my opinion OctoPrint should not be doing Basic Authentication on its
own. The commen case is that it runs on some slow hardware which its not
able to handle stupid bots trying out thousands of passwords in short
time. Also you want to protect it as much as possible from the outside
to ensure that the basd internet can't break your 72h print after 71
hours by brute-forcing passwords.
So I'm introducing an
accessControl: trustBasicAuthentication
config option. If enabled, it will take the user name from the
Authorization header, check if the user exists and is enabled - and if
so, just login the user.
If we set method to pip in 1.3.6 and then roll back to 1.3.5 we will
need to a manual config.yaml update otherwise or we will no longer be
able to update.
Be removing the force parameter and using the actual default settings
instead of current ones, we don't do that anymore.
Make sure to set the actual effective offsets as provided by the comm
layer (which merges incoming single offset adjustments) instead of only
setting the input, effectively nuking return of offsets set prior.
Closes#2268
Didn't match Marlin's "checksum mismatch", only Repetier's "checksum
error". Since the error handler checks against
recoverable_communication_errors before
resend_request_communication_errors, we can just switch back to the more
broader check against "checksum" for the latter.
We could also have added an explicit check for "checksum mismatch"
instead but since we used to check for "checksum" and we don't know what
other varieties for this specific error might be out there in the
thousands of firmware variants (who needs consistency when they can
have a free for all?), we'll err on the side of caution instead.
Fixes#2262
It's no longer reliable since the Github archive export we'll now
usually use for upgrading does weird things when a tag is available on
more than one branch and we don't want our current stable version to
be reported as "rc/devel" just because that tag is available there too.
A full blown version number should be definitive enough considering that
if it's not a tag it will also contain the commit hash.
We don't need to define them in the firmware AND in OctoPrint. If they
are already set in firmware we'll otherwise get wonky issues in the
GCODE viewer or when slicing.
Closes#2229
As discussed in #2200.
For this to work we've introduced sub-bundles per plugin for the JS
assets. CSS and LESS on the other hand are basically handled as before.
We use a custom bundle class here since it's apparently not possible to
keep a sub bundle from inheriting the parent's filters, thus not
allowing us something like
packed_plugins [js_plugin_delimiter_bundler]
packed_plugin_a [js_delimiter_bundler]
packed_plugin_b [js_delimiter_bundler]
...
The individiual bundles per plugin would inherit
js_plugin_delimiter_bundler and we'd get a double wrapper - not helpful.
Instead we now have a modified JsPluginBundle that overwrites
Bundle._merge_and_apply to further wrap the returned hunk.
Since we only ever handle one requirement here, the parse_requirements
generator (which btw needs a next m() is not the best choice.
Also extracted install command cleanup into class method and added tests
for that.
cc @markwal
No guarantees however that transporting anything BUT gcode via the usual
M28/M29 interface will even remotely work. Note that it most likely
won't work if the transferred file contains an M29 (= end transfer),
just like with transferred GCODE files.
Also note that stuff like config files or some such that might be
transferred might contain lines that are too large to fit into the
buffer of the printer. This is really just to enable plugins to maybe do
some nifty stuff, no official support of streaming arbitrary files to
the printer's SD (for that we'd need WAY more firmware support first).
See jneilliii/OctoPrint-SmoothiewareConfig#1
* permissions and groups are now optional fields on users - if not
provided, will be set to empty permissions and default groups
* description is now an optional field on groups - if not provided
will be set to an empty string
* Made the group manager a bit leaner
* Removed code duplication for group and user editor
* OctoPrint.access.groups.update now takes an object just like the add
method - this enables to do partial updates and also is way easier
to remember
* Some bugs fixed
* Added wrappers for the old add/remove/changeRolesForUser methods -
just a simple rename is not correct since those took roles, not
permissions. Needs some tests, haven't been able to do that yet.
The socket client will now authenticate with the socket after login,
using the session id from the login response. This will associate the
session with the socket server side. Any messages to the client apart
from "connected" and "reauthRequired", will be checked against the
STATUS permission and not be sent if that is missing from the current
user (which might also be the anonymous/guest user).
A logout of the session and any changes of the user or their permissions
will trigger trigger a reauthRequired message to be sent over the
socket, instructing the client to either perform a new passive login to
update the user's permissions, or to logout altogether (server side
logout or user removal).
Known bugs:
* Changing group permissions sometimes doesn't propagate through -
seems to be caused by the code not properly finding the login
sessions of affected users based on the changed group. Not yet sure
what's up there.
Open points:
* Deactivation of a user's account also needs to invalidate the
session
* Session timeout needs to be evaluated (currently 30min, unclear if
that suffices)
* possibly more I can't think of right now
We so far assumed that a resend request would follow that. Alas, it
won't and we'll simply get stuck due to a missing ack from the printer.
So let's simulate that here to keep things flowing.
Fixes#2226
* we now don't send the triggered resend/comm errors out of band but
instead as a response to the next received actual line - that
prevents us from getting out of sync
* new trigger_missing_lineno debug function to trigger a missing line
number error _without_ a resend request for testing fix for #2226
Old behaviour of insisting on API key presence for each and every
request can however still be enforced.
Making this part of the granular permission system epic since only then
will people be able to more finely tune what data will be available for
anonymous users.
Solves #1681
We only want to initialize it when the graph is actually visible. For
this we hook into tab changes, user changes and StartupComplete. That
will hopefully ensure that once it DOES become visible it will get
initialized, but not before.
If we have logged out or passive login failed, that way we'll still get
the needs of the anonymous user. One less GET request to make from the
frontend which also means one less potential race condition during
initialization.
Instead of hardcoding a list of supported mixins, we now instead define
a base class (or a list thereof) from which mixins might inherit and use
inspection to determine the set of mixins each plugin implementation
implements. Not only will that reduce the risk of forgetting to add a
new mixin to the whitelist, but it will also allow mixins defined by
plugins.
As seen in https://groups.google.com/forum/#!msg/octoprint/DyXdqhR0U7c/kKMUsMmIBgAJ
a broken entry_points.txt in some arbitrary Python package installed in
the same python envrionment as OctoPrint can make our whole plugin
detection fail and hence interrupt regular server startup.
This adds better protection against such cases.
* We now use a set key (derived from name used for setting the
attribute on Permissions or provided in permission definition from
plugins)
* We do a multipass resolution of combined plugin permissions (the
former approach was limited to two passes)
We also do logging on the permissions added through plugins. Also did
some code deduplication while at it.
* Removed PermissionsManager and merged functionality of that into
Permissions class
* Decoupled GroupManager from UserManager
* Renamed some things for less redundancy
* Removed unused YAML conversion methods
* Stricter differentiation between Manager parent class and concrete
implementations
* Marked broken tests as skipped and broken, separated them further
and added some
Also includes not throwing that data away in users.yaml - we don't want
to prevent people from switching back and forth between 1.3.x and 1.4.0
during the RC period (or ourselves during development ;)), so we need to
stay backwards compatible here at least until 1.5.0.
If snapshot url and/or ffmpeg path are not set, the timelapse cannot
work regardless of what type has been configured.
So if the current configuration still contains a timelapse type other
than "off" but snapshot url or ffmpeg path are unset, force a disabled
timelapse.
Fixes#2206
* Add comment with source file to JsDelimiterBundler and
JsPluginDelimiterBundler
* Include source file name in JsPluginDelimiterBundler catch
block and use log.error instead of console.error
At least unless we've selected git based tracking over release tracking.
This should greatly reduce the likelihood of not being able to update
due to some git repository corruption issues, as has happened to some
people in the past.
If either the full code or just the main code are blacklisted, only
upper case the code. Otherwise also upper case the parameter list.
In any case push originally entered command to history, not the
modified one.
Added new config setting: auto uppercase blacklist that is configurable
in the advanced option of the serial tab, with M117 included in the
default settings of the blacklist. Changed the sendCommand method in the
TerminalViewModel to auto uppercase the entire gcode command except when
gcode is in the blacklist. Updated documentation to include the default
auto uppercase blacklist command M117.
Resolves: #1026
(cherry picked from commit dbf7af1)
We didn't reset the capability flag and also didn't resend M155. Now we
do at least the latter if we detected that the printer supports
temperature auto reporting earlier.
A centralized plugin blacklist read from plugins.octoprint.org on server
start now allows us to stop plugins from being loaded that are known to
cause severe issues with OctoPrint's regular operation.
Blacklist entries can be restricted for specific plugin versions &
OctoPrint versions, allowing for very granular control of any kind of
blocking.
Additionally users may disable blacklist processing in general (an
opt-in wizard and a new section in the settings have been added) and
at server start via the new --ignore-blacklist parameter available for
"octoprint serve" and "octoprint daemon".
If a plugin is blacklisted, OctoPrint will not even import the
plugin module in question (if only a plugin key is specified OR a key
and a version and the plugin's version is already known during import
time, which is the case for plugins loaded from entry points) or at the
very least stop the plugin from being enabled (if a plugin key and a
version is specified and the plugin's version is only known after
loading, which is the case for plugins loaded from directories).
Sets server.startOnceInSafeMode flag to true. Probably easier for a lot
of people than editing a config file or running OctoPrint manually from
command line, in case the built-in "Restart in safe mode" system command
is not an option.
We so far only protected the binding process itself against errors
triggered inside view models. Now we are also more resilient against
issues arising in view model callbacks like onBeforeBinding,
onBoundTo and onAfterBinding as well as exceptions during plugin
instantiation itself.
Triggered by jneilliii/OctoPrint-TPLinkSmartplug#19 which was also
reported on OctoPrint's tracker as #2168, #2170 and #2171 and on OctoPi
as guysoft/OctoPi#427.
There are too many printers out there with crappy electronics that are
just waiting to go up in smoke, and people keep leaving those alone
because "they are monitoring them via OctoPrint, so nothing can happen".
So let's add a safety warning, in the hopes that will bring at least
some people to their senses or at the very least force them into making
the conscious decision to blow all warnings into the wind.
Firefox doesn't trigger dragleave if the mouse leaves the browser
window to another window on top during an active drag. That leaves
OctoPrint stuck with the drag-n-drop overlay.
Adding a timeout for dragover for only Firefox that clears the overlay
solves this issue.
Solves #2166
We also reflect that in the Cura profile import dialog by checking and
disabling modification of the corresponding checkbox if no profiles are
yet available.
Plot area was wrongly sized due to (invisible) X axis tick labels.
We now initialize an empty plot to min/max timestamps of "now" to
circumvent this. Additionally plot was not properly initialized on
initial load of page due to onAfterTabChange not firing for the first
tab.
Also added a bit for tick labels.
Wasn't properly revalidating when an already registered slicer switched
between unconfigured and configured.
Also adjusted data format version tracking on files and slicing API to
match.
We might add fields to things like file entries (e.g. "display") and in
such cases want to refetch the list even if the files itself didn't
change, to make sure those new fields are available to the clients.
See https://github.com/foosel/OctoPrint/issues/2111#issuecomment-337164940
Increased scrollbar width of file list and plugin repository list to
10px (from 5px). Fixed scroll bar hiding itself on initialization due to
alwaysVisible not properly persisting the initial binding.
Enhance knockout binding syntax for slimScrolledForeach: slimscroll
initialization parameters may now be provided during data binding via
the additional slimscroll property accepted as part of the extended
foreach syntax, e.g.
slimScrolledForEach: {data: ..., slimscroll: {alwaysVisible: true, ...}}
Implements #2111
Files (and folders) are still slugified to ASCII for storage on disk,
but now the original filename is stored alongside in metadata.yaml
and used for display in the file list and print status.
The slicing dialog also inherits that display name for use as base
for the suggested GCODE name.
Internally, everything still depends completely on the slugified
ASCII version.
This implements #2094
This would normally not fly at all but we give it a pass here since we
only use that module for auto detection anyhow (and probably not for
much longer since that approach is simply too error prone).
Adapted from
https://github.com/foosel/OctoPrint/issues/2138#issuecomment-334117910
by @dtynan.
Solves #2138 until I come up with something better
If the filename contained a [] pair, the file would not match the glob
pattern used for selecting for deletion.
Backporting the glob.escape function from Python 3.4 and using it here
should fix that. We only use our own ported version if glob.escape
doesn't exist - that should reduce redundant code once we become Python
3 compatible.
If the temperature graph was not on the first tab, the plot would be
initialized without being visible, causing some sizing issues and
alignment issues with the Y axis ticks.
Forcing the plot to only get initialized once visible solves these
problems.
Fixes#2147
That way people clicking too fast on login before the view models are
bound won't be able to make the form submit username and password as GET
parameter to the base URL.
Closes#2108
Otherwise we might run into trouble if we have an OctoPrint instance
running on / and /octoprint2 for example - the browser will send
cookies for both instances to the /octoprint2 instance and whatever
gets processed last will overwrite the value before in Tornado's cookie
processing. This of course will nuke the login session in case of the /
cookie being sent or processed last.
Appending the path/script root to the cookie name solves this, similar
to how we circumvented an identical problem caused by browsers not
distinguishing between ports for cookies.
Solves an issue reported by @mgrl in #2095
That should solve any weird import issues we have when
running gcodeInterpreter.py directly (and hence putting
octoprint.util as first entry into the python path,
causing potential issues with imported modules such as
yaml to catch the octoprint.util.platform module instead
of the actual python platform module).
See reported problem with that by @CapnBry in #2095
- Fixed a forgoten refactoring inside the first run wizard
- Added possibility to also throw a warning when deprecated JavaScript Variables are used
- Therefore made the whole deprecation logging a bit more generic, so it will be easy to reuse it in the future
- Reintroduces the "deprecated" USER_ARRAY as a non deprecated array, so we have a central place where we can adjust the permissions for users (only valid for first run and creating the user group on migration)
- User group will be created on first run now and when migrating from an older version
Using the win32 API it's possible to prevent the intermediary server
socket from inheriting itself to subprocesses. So let's use that here.
Another bit of the solution for #2090.
There's now a dedicated button for that.
This should get around issues like #2056. Also increased size
of API key display field (where possible). Fixes#2055
Allows preprocessing/sanitizing temperatures as received from the
printer.
Workaround for printers that occasionally report garbage temperature
data, e.g. #2050
Any processes inheriting the open port descriptor of that server will
cause the actual server startup to fail due to the port still being
claimed.
We can't fully prevent this under Windows thanks to fnctl not being
available and win32api being a PITA, and also close_fds on Popen not
being allowed if we also need to redirect stdout/stderr/stdin for a
process. So let's hope hardening against this problem when running
under *nix, adding a bit fat warning to never start a subprocess
during the intermediary's runtime and also moving the only actual
process we so far DID start (analysis backlog processing) to after
Tornado is running will suffice.
Fixes#2035
We were only adding one byte for "\n". That ignored that our regex
could also match "\r\n" or "\r\r" or something like that.
Our split regex now only matches one "\r" or "\n". Empty lines we'll
simply ignore anyhow so no real harm done.
Also, we no longer strip the comments in this step - leave that to
the worker running in its own thread. Not only should that speed
things up a bit, it will also allow us to better debug the worker in
the future.
We were just testing if z_heights[z] was truthy. If the layer index was
set but 0 that wasn't properly detected and let to overwriting our
layer information. Instead check explicitly against undefined.
Closes#2017
* remove some more "fa" classes where they didn't belong
* use "fa-toggle-(on|off)" instead of circles where they were used
to signify toggle actions
* fix SD card icon being too high
Another follow-up to #1915
So far we only supported \n and \r\n, leading to problems with MM
GCODE files generated by Slic3r Prusa Edition which apparently
produces \r line endings for some reason.
Closes#1996
Clicking terminal output (excluding highlighting) will set focus to terminal command
Change fancy functionality style from muted to warning so that it stands out more
We won't support this after all, it's too much of a headache with
regards to the sending queue. Pausing takes longer, cancelling takes
longer, resends get more complicated and so on.
Command expansion in the queuing phase needs to suffice.
E.g. in case of a disconnected thermistor, or when it is really
really cold. Make sure our parsing doesn't get confuse by this and
thinks that
ok T:150.0/210.0 T0:-55.7/0 T1:150.0/210.0
is actually only T and T1 being reported by the firmware, causing
stuff to be wrongly canonicalized thanks to T/T1 being Smoothie's way
of reporting dual extruder setups.
Fixes#2007
Introduced a custom send queue type that actually contains two queues,
one for resends, one for regular lines. A flag indicates whether
lines should be returned from both or only resends. That way we
ensure that as soon as we have an active resend request we ignore
what was already in the queue and only send the lines we need to resend.
Also: PrependQueue => PrependableQueue
Less tracking of offsets and also more similar to how
firmware does this.
We rewrite our current position on tool change to current position
plus tool offset instead of applying it for every single
position change.
We fetch settings once explicitly after passive login but before
completed startup. Without this patch we fetched them again after
onUserLoggedIn got fired (if it got fired by the passive login)
during startup. That's not necessary because we did the passive login
before our initial settings fetch, so IF that already logged us in,
our settings fetch already was done with us logged in as well and
the onUserLoggedIn later only tells us what we already knew.
We still had some concurrent requests triggered through onStartup that
managed to overtake the passive login (and hence nuke the session
data on the client). This should now really not be possible any longer.
Also created a sequence diagram of the new process and linked it from
a lengthy comment.
It caused issues with our line number tracking in the browser
developer tools and I don't see any way to avoid this considering
that we can't adjust the arguments supplied to console.log without in
fact wrapping it :/
Under specific circumstances it could happen that the passive login
response was overtaken by a response from an earlier still
unauthenticated request which would then effectively overwrite the
session cookie immediately and hence cause the browser to use its
login session against the server, but without displaying that to the
user. See #1881 for what is probably an issue caused by exactly this
kind of scenario.
Additionally a couple of requests needed to be done a second time
after login, just moments after having done them for an anonymous
user. See #1572 for a request to change this behaviour.
This patch changes the startup order of the web interface like this:
1. connect to the websocket, postpone any events triggered by
this (e.g. "fromHistoryData") until 3
2. perform a passive login, postpone any events triggered by this
(e.g. "onUserLoggedIn", "onUserLoggedOut") until 4
3. trigger postponed events from 1
4. trigger "onStartup" (triggers postponed events from 2)
5. fetch settings
6. bind view models etc
A connection close of the websocket will disable event processing on the
socket until it is marked as initialized again by the passive login
processing, which will also be triggered immediately on server connect.
That way under normal circumstances nothing should ever get triggered
in the registered view models that might generated requests to the
server API until a passive login has been done, a server session
initialized and if necessary a user properly authenticated.
They might be nozzle priming routines which are not actually part of
the model proper and hence it doesn't make sense trying to keep them
visible when zooming in on the model, or allowing them to offset the
model center.
Now also detects capabilities reported by (extended) M115 output and
if AUTOREPORT_TEMP is available enables it with the configured
autoreport interval and disables active polling.
Implements #1679
See #1942
This does NOT fix the root cause of `_default.profile` becoming an
empty file (apparently during migration from config.yaml?), however
since this particular situation was impossible to reproduce so far this
workaround for the consequences will have to suffice for now since we
want a hotfix as fast as possible for 1.3.3.
* fa-circle-blank does not exist, replaced with fa-circle-o (see also
report in #1928)
* fa-trash-o instead of fa-trash (same look and feel)
* fa-check instead of fa-check-circle (same look and feel)
* fixed toggleContent binding to also be able to toggle fa icons
* fix deletion spinner in file list (was still using old icon-
classes which of course weren't there anymore and hence not
toggleable)
* icons-ul => fa-ul
* remove superfluous fa class from some places
Follow-up to #1915.
Instead of disabling capturing of postroll by default (which we actually
don't want and doing so was a mistake thanks to misremembering the
meaning of the variable in question), we now properly reset the
default value for that check box (which wasn't properly set only due to
a very stupid typo).
That fixes up the relative URLs to the font files and should make updates down the line
a thing of a quick copy and paste (plus allow some more sophisticated dependency
management down the road as well).
Also renamed fonts folder for FontAwesome 3.2.1 from font to fonts, for more
consistency.
Otherwise we will block ourselves, waiting for the restart command to
complete which it only can when we are no longer there.
Should reduce restart times on update significantly.
Downside is that we no longer can wait for the return code of the
call. However, that should be caught by our UI handler timing out for
the restart and showing an error prompting the user to restart
manually.
By default G90/G91 define relativeMode, M82/M83 define relativeE. The
extruder coordinate will be viewed as relative when either
relativeMode or relativeE are set. This mirrors the implementation in
Marlin (current and legacy forks) as well as Repetier.
SmoothieWare's implementation resets the relative mode of the
extruder on a G90/G91. To still accomodate this different
implementation a new settings has been added under Settings >
Feature: "G90/G91 overrides relative extruder mode". Checking this
switches to the alternative interpretation for future gcode analysis
and visualization.
The only difference between the two of them is that the following
segment of GCODE:
M83
G90
will have the extruder still set to relative on Marlin and
Repetier but set to absolute on Smoothieware.
Please note that the setting in all likelihood will be moved to
the printer profile in the future, since it makes more sense to have
it on a per printer basis. It's not part of the set of features
available for auto detection since it's required for GCODE analysis
and hence needs to be known even outside of a connection to the
printer.
Implements #1818
Removed the Enabled stuff from Permissions and Groups, because both have an always on requirement
Fixed a wrong Permission
Moved the previously splitted javascript access client back into one file
An aspect ratio of 16:9 is assumed, with other ratios showing black
letterbox borders as required.
During loading a text "Webcam loading..." is displayed in the webcam
space. On loading error, the (broken) image is hidden and an error
text is displayed instead.
Solves #478
Otherwise we might run into a rare race condition where the M110 sent
on start of a SD card upload gets prepared for sending after the
source file is already opened. That would then lead to the M110 not
getting processed anymore by OctoPrint and hence the line number
counter not resetting accordingly, leading to one line number
mismatch after the next from the firmware.
Testing if our "isPrinting" flag is ALSO set to true here ensures
that we'll only stop processing commands internally once the state
has actually switched to printing, which only happens after the
firmware responds to the M28 sent after the M110.
Fixes#1882 and probably also the issue encountered by @amd989 in
#1762 (which looks like exactly the same problem)
Combined users, permissions and groups as access.users, access.permissions and access.groups
Many refactorings inside the javascript part
Added general javascript deprecated function, logs a message to the javascript console
Adjusted the user add and edit modals to recenter themself when uncollapsing the groups and/or permissions sections
Disable button when a test is already active. Also have spinner
defined centrally and only made visible on active test.
Should hopefully give better feedback to impatient users ;)
Solves #1897
* Use click data-bind for submit button instead of manual click
binding
* Keep metadata synchronized (otherwise changing identifier, name,
description, overwrite or default flag after adding a file does
absolutely nothing)
* Disable submit button and fields when no file is selected.
* Disable submit button (and show spinned) when request is in
progress.
Related to #1893
This fixes#1893.
Also, only bind click to the "Confirm" button once instead of binding
and unbinding it for each file. Binding it just once seems cleaner.
(cherry picked from commit 83d1921)
If double the speed needed for output during print/fancy terminal
functionality is detected, re-enable that after a timeout of 5s.
Decrease of speed cancels the timeout again. That should prevent wild
toggling.
Should solve #1862
Some users get confused by having to use the blue "Print" button in
the state panel for consecutive prints of the same model, let's solve
this once and for all.
Move the AutoScroll function to an animation frame to prevent layout thrashing and to keep it in sync with fastForEach
Remove the <br> tag from the terminal and use display: block; on span tags to prevent increasing DOM nodes and faster processing of the terminal
On call of the lazyload plugin, all matched img elements will be
checked if they have a data-src attribute. If so, their src attribute
will be replaced with the contents of the data-src attribute
(effectively loading the image) and the data-src attribute will be
removed (so that multiple calls don't call multiple processing).
* Don't restrict the list of compatibility values to check against
to only those we have mapped, also support unmapped more exotic
ones.
* Allow 1:1 check against sys.platform values (with startswith).
Combined with the above that allows very granular compatibility
modelling ("freebsd11", "freebsd12") if required.
* Instead of only whitelisting ("linux", "freebsd") now also black
listing is possible ("!windows").
A detected os must match all provided whitelist elements (if the
whitelist is empty that is considered always the case) and none of
the backlist elements (if the blacklist is empty that is also
considered always the case).
See the included unit tests for examples of how this works.
Apparently python setup.py develop tries to re-install all scripts
provided by plugins (maybe only under Windows?). Since that includes
OctoPrint's own executable, things will explode with an access denied
error there. Switching over to pip install -e . fixes that, and also
is more conform with the install approach the plugin will take in
production anyhow.
So far using the "... from URL" or "... from an uploaded archive"
mechanism for installing a plugin would fail without further
information if the plugin to be installed was already installed.
The plugin manager will now detect this situation by parsing the
corresponding message from the pip output and trigger a reinstall
instantly.
A message about this will be logged to octoprint.log and the install
output.
Additionally the error handling for installation errors has been
slightly improved (install output no longer says "Done!" but "Error!"
with the reason as provided by the server) and the "could not install
plugin from URL unknown" issue should also be solved.
Evaluates json data file as e.g. published on
plugins.octoprint.org/notices.json and displays notices for plugins
installed and matching (optional) version lists.
* Extended plugin metadata by new property, only evaluated for bundled
plugins.
* Adjusted plugin manager to evaluate new metadata and add
confirmation dialog with details when attempting to disable such
a plugin.
* Added combined OctoBlog feed, replacing news + spotlight (+
octoprintonair), added corresponding config migration
* Subscribe to all registered feeds by default
* Added config button to announcement reader
* Added note how to edit announcement subscriptions to notifications
* Auto-hide announcements on logout
* Order channels server-side based on new order config setting
Old default behaviour of showing logged in users the update
notification stays default, but can now be disabled via the software
update plugin settings.
Additionally added the ignore button to the notification for users as
well (and made ignore entry in local storage user specific to still
show notification to other logged in users), plus a small hint that
in order to apply updates an admin is needed. Additionally now hiding
the notification on log out.
Closes#1739
Also introduced a new helper, a progress modal that can be used for
providing feedback about things such as bulk delete operations in the
background.
See #748 and discussion in #1807
It now resides in a file on disk and can be deleted. If the profile
configured as default is not available (e.g. due to having been
manually deleted, or on first start), the default profile as defined
in the profile manager will be written as _default and that will be
used/set as default.
On first start after this change gets applied, OctoPrint will migrate
the old "default overlay" residing in config.yaml to a file on disk
and delete the old entries in config.yaml.
Solves core reason of #1734
Addition of a notification under the save button when there are unsaved
changes, and a notice under the save as default checkbox when unticked,
that changes are only temporary.
Also move the "interval" box up the top to position it underneath the
timelapse type dropdown list, and change the text to be a bit more
descriptive.
(cherry picked from commit 381a016)
System wide API key now offers a generate button like the user
API keys. Setting the API key directly to a value via the settings API
endpoint is now no longer possible, which should prevent setting it
accidentally thanks to the browser prefilling things where it shouldn't.
No delete button is offered for the system wide API key since it will
get automatically regenerated on server start if not set, so
regeneration is the only functionality here that makes sense.
If no API key is set in the user settings, the "delete" button is now
disabled. If a key is already set and a new one is to be generated, a
confirmation dialog makes sure this is really what the user wants. Same
for deleting an existing API key.
Both the system wide API key and the user specific API keys will now
only display a QRCode if there's actually a value for the key.
Might confuse users to see that marked up like an error when it's
perfectly normal for some kinds of installs simply because the
specific build folders never were created in the first place.
Force --all on stock clean command unless --orig is specified, in
which case "python setup.py clean" behaves like the stock clean
command. Additionally there are now --noeggs to skip egg deletion and
--nopyc to skip pyc deletion.
Might have been an external reset of the printer we didn't otherwise
detect, and unless we reset the line numbers we'll now be off and run
into resend requests.
Solves #1676
* UserSettings: crashed if overwrite an existing key with primitive value by same key with complex value. Also reduced number of calls to user.get_setting()
* Updated tests
(cherry picked from commit b75b53d)
* UserSettings: crashed if overwrite an existing key with primitive value by same key with complex value. Also reduced number of calls to user.get_setting()
* Updated tests
On reload of the user settings a new user object was created but not
updated on the associated session user(s). That let to session user
(s) still referring to the old user instances with the only partially
updated user settings.
Behaviour changed such that on a reload of the users from file
(including user settings) all registered session users will now get
their reference updated as well.
Also made modelling of user id to session id a bit less redundant.
Former implementation tested for z-hop rising flank and anything that
is falling. That however causes issues with z-hop directly followed
by layer change (diff is not z-hop size but negative, image hence not
captured).
Instead of testing for positive flank == z-hop and any negative flank,
we now test for absolute value == z-hop.
Solves #1777
Cache was not invalidated on change of:
* snapshot URL presence
* system menu entry presence
* gcode viewer enabled/disabled
* changes in access control availability
Refactored cache setup to add enable_timelapse, enable_gcodeviewer
and enable_accesscontrol to ETag calculation, removed system menu
check. Template filtering will now be done based on the values of
these flags at render time, not before.
See also #1776 for a related ticket.
* Use only icons for settings and system entries
* Limit length of login entry to 100px
* Limit length of instance name to 250px
* Removed "OctoPrint" text if instance name is set
See discussion in #1741
We have our own cache, and that would get confused by not
allowing a reload of the templates at runtime, which Flask 0.11+
will not allow anymore unless this setting is set to True.
Logs a deprecation warning when any of the made-property fields is
accessed as a getter and return value. Implements __eq__, __ne__,
__bool__ and __nonzero__ to allow things like "user.is_anonymous ==
True" or "not user.is_anonymous" is used.
Careful with serialization to json, needs "bool(...)" wrapper to not
cause an exception (or inclusion in a custom serializer).
Affected fields:
* is_anonymous
* is_authenticated
* is_active
* is_user
* is_admin
To be removed again in OctoPrint 1.5.0
Logs a deprecation warning when anything from flask.ext is accessed,
imports flask_<name> instead and returns it.
To be removed again in OctoPrint 1.5.0
* leading and trailing null bytes will now be stripped
* while connecting, a "wait" will also trigger switch to connected
state - relevant when connecting without reset and initial "ok" for
M110 gets mangled
* extended virtual printer by new options to test the above:
* mangled "ok" can now be injected via "preparedOks" setting and
prepare_ok DEBUG command
* simulated reset lines on beginning ("start" etc) now only sent
if new setting "simulateReset" is true
Should fix#1770
Extracted methods to check if modification of a file is possible and
to determine if a specific file is currently select to take care of
denying upload and re-selecting file after upload.
Refactored watched folder handler to use the same methods and mirror
behaviour of file upload via API.
Should solve #1760
* Endless recursion on file delete as reported in #1738
* Broken implementation of .move
* Broken definition of .pathForEntry, .entryForPath,
.pathForElement and .elementByPath
API endpoints that were not decorated with restricted_access so far did
not properly create a user session for cookie-less requests with an API
key only.
That meant that flask.current_user stayed an anonymous user, even with
the global admin API key. In case of /api/settings that meant that even
with the global admin API key it was not possible to read settings that
are admin-only (like the API key for example) or user-only.
This has now been rectified by moving the session creation into a
different before_request handler that is registered globally on all API
endpoints, meaning that an API key will now always lead to a user
session to be created, regardless of the requirements of the API
endpoint in question. Additionally the CORS handling was extracted
as well as the API key presence enforcement.
BlueprintPlugins will now also get the CORS and session-from-API-Key
treatment if they do not declare their endpoints as restricted.
Might solve the API key "n/a" issue filed in #1751, but since the cause
of that isn't identified yet that's not sure.
Don't allow overwriting of "octoprint" config through plugins, don't
allow overwriting of already registered configs unless id to register
matches plugin identifier (in which case the already registered config
was probably a case of a copy-paste-error from another plugin).
We now have a global OctoPrintClient, which is the class from which
all clients are derived, and a global OctoPrint, which is a single
instance already setup and ready to use in case we only need one.
It would be cleaner to have clients create that singular instance
themselves, but we need to maintain backward compatibility for now
with how we established the client to work with the 1.3.0 release.
New clients can be create with
client = new OctoPrintClient({ /* options */ });
Alternatively the options can be left out and set at a later point:
client = new OctoPrintClient();
/* ... */
client.options = { /* options */ };
Individual client components register themselves with OctoPrintClient
via OctoPrintClient.registerComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.<name>",
e.g. "OctoPrint.files".
Plugin components register themselves with OctoPrintClient via
OctoPrintClient.registerPluginComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.plugins
.<name>", e.g. "OctoPrint.plugins.softwareupdate".
This should make it possible to create dashboard pages utilizing the
JS client that monitor the status of multiple OctoPrint instances,
without workarounds such as having to swap out the options globally
before each request.
See #1681 for the corresponding discussion.
Support multi-extruder setups that share a single nozzle and heater,
like the E3D Cyclops, Diamon hotend or probably the upcoming Prusa Mk2
multi-extruder upgrade.
The Control tab will still allow tool switching and extruding for
the configured extruders, the Temperature tab will only display
one hotend temperature though.
Printer profiles have been extended by a new option
extruder.sharedNozzle that defaults to False. Extruder offsets are
not displayed in the profile editor if that setting is checked and
reset to (0,0).
When the sending of the first line of a file to print is still taking
place while an "ok" from the firmware comes in, it's possible
that two threads will try to access the file handle in parallel. That
can lead to trouble within Python's codecs module.
Synchronizing all access to the handle should do the trick.
So far the plugin selected the gcode script corresponding to the number of
extruders configured in the printer profile. After a close look into the
implementation in Cura itself, prompted by #1708, it turns out that this is
in fact wrong.
Cura selects the gcode script to use based on the maximum of the number of
extruders needed for printing the models in the scene and the minimum number
of extruders needed for generating support (if support extruder is "both" or "first"
or there is only one extruder, that's 1, if it's "second" and there is more than one
extruder, it's 2).
This commit changes the plugin's implementation to mirror this implementation.
The difference to Cura is that we have the number of extruders needed for the
models in the scene hard coded to 1 since we only support STL right now which
can never contain more than one object. If we ever decide to support merging of
multiple STLs into one single multi-extruder print or other model files like AMF
or OBJ from OctoPrint's slicer support, we need to change this.
Affected print_temperature and filament_diameter placeholders.
E.g. `print_temperature2` was wrongly attempting to fetch `print_temperatures[2]`
instead of `print_temperatures[1]` (0-based-indexing!)
Partially fixes#1708
* Fix priority queue sorting (sorts ascending, not descending!)
* Abort low priority jobs when a high priority job comes in
* Utilize queue for tracking aborted jobs too
* Abort analysis for items that are to be deleted/moved (also
fixes issue under Windows where it was impossible to delete
a file for which the analysis was still running).
* move hidden login form to the left to hide overlayed
Lastpass context buttons
* do dropdown toggling for login form manually to
not only ignore clicks into form but also into overlayed
Lastpass context buttons for closing the dropdown again;
do close dropdown for included a and button elements
though
* Added/changed mappings of profile to engine settings to
match Cura Legacy mapping:
* perimeterBeforeInfill: taken from perimeter_before_infill (new,
fixes#1693)
* skinSpeed: taken from solidarea_speed (new)
* raftAirGapLayer0: sum of raft_airgap and raft_airgap_all
* raftAirGap: taken from raft_airgap_all (new)
* raftFanSpeed: changed to 0
* raftSurfaceThickness: taken from raft_surface_thickness (new)
* raftSurfaceLinewidth & raftSurfaceLineSpacing: taken from
raft_surface_linewidth (new)
* Mach3 Gcode Flavor replaces S parameter with P parameter in
temperature commands within generated GCODE, like in Cura
Legacy
If the slicer returns values for a tool we want it in our analysis
result, even if it's zero. That way the result will be the same as
if we have our own built in gcode analyser take a look at the
file.
(cherry picked from commit 818ae92)
This fixes the issue that there were no informations about filament
usage in metadata after slicing with cura plugin. Trying to call
profile.get_float("filament_diameter") ended in en exception with
message " 'module' object has no attribute 'get_float' ". So i defined
profile before using profile and now it works.
See issue #1685
Also inserted a check to determine if filament usage is > 0 to exclude
tools with no filament usage in metadata.
(cherry picked from commit c9b38bd)
* Properly handle G0/G1 with no X, Y, Z coordinates in relative mode
instead of duplicating coordinates - should fix#1675
* Only take move commands with X, Y, Z coordinates into account for
model size calculation - this makes our internal GCODE analysis behave
like the GCODE viewer's analysis and produce the same model size. The
downside is that extrusions on the origin are no longer taken into account
for checking if a model is within bounds of the print bed, but that should
hopefully not produce any issues in the real world.
Variables defined in an outer scope can no longer be set from an inner scope (see
pallets/jinja#641). Regardless of whether that is right or wrong, we can't control if
people are using such constructs in their plugins, which versions of Jinja >= 2.9 would
now break out of the blue, regardless of OctoPrint version. That is unacceptable sadly
and requires pinning for now, until plugin authors have had a chance to adapt
accordingly.
Also see #1697.
--basedir, --config, --verbose, --safe may now come before or after
subcommands and should still be evaluated.
For the server commands (legacy, "server" and "daemon"), the same
should now hold true for the related parameters --host, --port, --debug,
--logging, --iknowwhatimdoing and also --pid (for daemon command).
While having the parameters belong to the individual commands and only
there (which is click's basic approach) is way more cleaner, too many people
were running into issues with that strict approach after all.
I just hope the somewhat hackish approach with context injection needed to
get the less strict version to work won't backfire badly in the long run.
See also #1633 and #1657
--version is a flag, not an actual parameter (wouldn't really make sense
too). I'm not sure why that isn't the default behaviour of the built-in
version_option decorator tbh.
See #1647
Two problems solved:
* Make sure to only process temperature data once we
have printer profile information on hand to evaluate
the heater data. If we don't have that yet, create a client
side backlog and process that once we have the necessary
data on hand.
* Do not use uninitialized history cutoff values - if our cutoff
value hasn't yet synced (no settings response arrived yet),
just don't perform the cutoff.
That api endpoint really is a tough nut. ETag calculation now also
takes full settings dump from settings plugins into account, because
those might be providing custom keys through custom on_settings_load
implementations, for which we will not notice any changes if we are
only looking at the effective config.
Of course, the more we put into that ETag calculation, the slower it will
be and the less sense it will make. Somewhat annoying :/
Not testing if oldRoot was actually set and contained the
key in question could cause issues if a completely new data
structure was sent to the backend that was not mirrored by
the default settings. Things like e.g. complex configuration
items in a by default empty object.
sarge's "wait_events" is unreliable. If an asynchronous
job is started but stops immediately and raises a sarge
Exception (inside the async thread), the associated
command's event will never be set event though the
process finished. So we'd wait indefinitely here.
We circumvent this by first waiting until the commands
are parsed and processed (p.commands contains
elements), then until said commands are started and then
making sure the command's process is actually set. Only
then do we actually have a background process running
that we'll be able to monitor further down, otherwise
the command immediately failed.
Removed a potential deadlock, added logging for all
raised exceptions, made _to_error more solid and
removed another potential encoding issue when
creating diffs
">=4.0.2,<4.1" will pull in 4.1b and we don't want that due to issue with
that and websocket communication due to permessage-deflate.
While we desperately need to migrate to a newer tornado, due to some
voodoo needed to get large streamed uploads and downloads to work
that is probably not completely straightforward and therefore
something for post-1.3.0-stable release.
Having that output stay on stderr and hence in shiny red looks way
too alarming considering that it's only a pip update that is not THAT
critical usually (and we don't want to do it automatically anyhow
considering how often that appears to break stuff).
If the SettingsUpdated event for whatever reason got slightly delayed and arrived AFTER
the save request was already processed, in rare situations it could happen that the
"Settings Changed" popup was triggered even though the settings had already been
successfully saved.
Modified such that we now keep track of if we already saw the SettingsUpdated event
associated with our save request and if not we ignore the next one.
To ensure that we don't get out of sync due to that when a settings update request is
sent, but no settings are actually change, we also now always trigger the SettingsUpdated
event, even in such cases. Clients can use the hashs in the payload to test if something
actually changed - if necessary.
We used to track our webcam stream URL by the global variable
CONFIG_WEBCAMURL. That's still a left over from the architecture
about four years ago and completely obsolete these days.
Additionally it causes issues now that anything rendered into
the page (as this variable value is through initscript.jinja2)
will not be changed unless the page cache is refreshed.
Taking the stream URL from the settings view model instead
solves that problem and is way cleaner anyhow.
If there are custom system menu entries for restart, reboot and/or
shutdown, they are deleted. If the corresponding server command is
not yet configured, the command from the system menu entry is
transfered.
Can be enabled either through new --safe command line
parameter or through server.startOnceInSafeMode in
config.yaml
When running in safe mode the plugin manager will
only allow to disable or uninstall third party plugins. Enabling
third party plugins or installing new plugins is disabled.
That will hopefully allow for more straightforward recovery
in case of a misbehaving plugin.
If enabled (which it is by default), OctoPrint will now send
an M115 to the printer on initial connection in order to try
to figure out what kind of firmware it is. For FIRMWARE_NAME
values containing "repetier" (case insensitive), all Repetier-
specific flags will be set on the comm layer. For FIRMWARE_NAME
values containing "reprapfirmware", all RepRapFirmware-
specific flags will be set on the comm layer.
For now no other handling will be performed.
Timing issue, "OctoPrint.job.start()" would be called at a time
when the file had not yet been selected on the server. Hence
a different approach, calculating printerAfterLoading parameter
based on existing information at the time of clicking the
load button and using the print parameter on the select
file API again, as previously.
That bounding box may have larger dimensions than the print volume
(but not smaller ones). That allows to define safe areas for which no
"exceeds print volume" messages need to be triggered.
Solves #1551
Implicit match on \n appears to be causing issues when
generating the sdist tarball under Windows. Matching against
\s+ instead works reliably. Simply including the newline in the
matched JSON string would also work fine.
Otherwise the cache of /api/settings would not be properly invalidated
on a change in either the user login state or the set of active plugins.
See also #1576
The way it was before, the function would also return itself. This isn't really a problem here, but if someone takes this function as a guide (like me) they can run into problems when iterating over the returned array, as it contains an element representing "values()" itself.
Another approach would be make use of the inspect package and replace name="values" with inspect.ismethod(name)
When setting the tracked target temperature from a sent temperature
command, the changes in tracked temperature were not propagated
from the comm layer to registered callbacks.
But since the standard printer also didn't make a copy of the mutable
dict of tool temperatures, those were in fact updated even without
propagation in the printer implementation when the values in the
comm layer got updated, whereas the bed temperature - an immutable
tupel - was not.
Two wrongs sometimes do in fact make a right. In this case that led
to target temperature changes on the tools immediately reflecting
in printer.get_current_temperatures after the command was sent,
but changes to the bed target taking until the next M105 response
to propagate.
Decoupling the data structures and adding propagation commands
to the comm layer solves this issue.
Fixes#1543
-r only allows a limited set of target framerates according to the mpeg2
standard, but -framerate allows to specify how long each frame should
be shown, giving us full control over "virtual" fps without causing errors
when the user selects a non-standard frame rate
Long lines (longer than rx buffer) could not be processed at all, leading
to a serial timeout exception thrown by the virtual printer. Adjusted
to allow for partial processing like on maintenance
That way a JS error in an external plugin won't nuke the whole UI, which IMHO
is worth the additional requests needed to load the split up files.
See #1544 for an example of such a situation.
The bug only manifests if a user had installed 1.2.16 earlier and never once hit "Save" in the
settings before attempting to update to 1.2.17. With 1.2.16 the updater script and settings for
OctoPrint's own update mechanism were changed to prefer "checkout_folder" instead of
"update_folder". In earlier versions however "update_folder" was still used. Saving settings
even once (even without any changes!) will migrate the data. But if that's not done a
KeyError will be raised when trying to retrieve "update_folder" from the check config, with
"checkout_folder" as its fallback.
Rather stupid error really.
* show special error if timelapse can't be rendered due to no frames having
been captured
* inform user during print about repeated capture errors
* do not start post roll recording if after a print no frames were captured at all
* also interpret non-ok-ish return codes from snapshot url as capture error
* documentation for CaptureFailed event
Filter toggling didn't remove the specific filter but always the last item
in the filter list. No, I don't know either why I didn't notice this earlier m(
If a content type header was present on a multipart form data part it would turn
the rewritten body into a unicode instead of a byte array, causing a later conversion
to a byte stream to not capture.
Fixed both the fact that the rewritten body would turn into unicode by making
sure the content type header was provided as byte array and fixed the byte stream
conversion to also trigger on unicode instances.
Solves #1531
To answer https://github.com/foosel/OctoPrint/issues/1048 I changed L357 to "output += gettext("Last Print Time") + ": " + formatDuration(data["prints"]["last"]["printTime"]);" as proposed by @ntoff
Only keep the cache keys, but that way we know when
we were going to cache something and then didn't
due to environmental factors, e.g. headers on request
or response.
Necessary to be able to track if the preliminary caching
has been done during startup to properly reflect that
on cached.gif
They are still useful for other clients than the core application. Renamed them to fit the
general naming on the API however:
* pathForElement is now called pathForEntry
* elementByPath is now called entryForPath
Was marking the config as dirty just when printerParameters entry existed,
which always exists - various sub entries of that are what needs to be checked
instead.
Example:
* both "session" and "session_P5000" cookies available: "session" value from "session_P5000"
* only "session" cookie available: "session" value from "session"
* only "session_P5000" cookie available: "session" value from "session_P5000"
Also added API docs regarding header encoding, incl support for RFC 5987
for filename fields in Content-Disposition headers in multipart/form-data
parts, incl. an example of an upload request with a utf-8 encoded filename.
Solves an issue with clients encoding filenames in multipart
headers in ISO-8859-1, causing an HTTP 500 response code.
This change makes ISO-8859-1 encoded headers work, sends
a 400 Bad Request instead of 500 Internal Server Error if the
request multipart headers cannot be decoded as either UTF-8
or ISO-8859-1, defines UTF-8 content type for multipart text
fields in rebuilt body and also adds support for RFC 5987 for the
multipart file upload "filename" header component.
* make sure server_port headers are properly set in reverse proxied scenarios
* overwrite request and response classes to
* always apply reverse proxy environment changes (so far missing for tornado
context)
* strip cookie name suffixes from cookie names on requests and
* be sure to set cookie name suffixes for cookie names on responses
* include script root in path used for cookies
* some minor refactoring in octoprint.server setup routines
* removed ReverseProxied class (didn't work for tornado context)
* add unit tests for the whole reverse proxy, request and response customization
(Let's be realistic here)
Introduced new "additionalNames" property on viewmodel declaration
to allow for registering alternative lookup names for a view model.
The freshly renamed FileViewModel now resolves as both "filesViewModel"
and "gcodeFilesViewModel", making the renaming backwards compatible
Documented all that stuff (and some more)
Removed unnecessary (and broken) call to event.preventDefault,
moved styles to less/css and also made sure to disable the buttons
not currently usable.
Most caching is left to the client, by utilizing ETag and Last-Modified headers.
Where it was easily achievable, an additional server side miniature cache of intermediary
results was introduced (e.g. for the files). The regular cached decorator was not used
since it targets caching full responses, and the responses in question already contained
client request specific data. Caching "one step earlier" allows better usage of the cache here.
Also introduced a dependency on the scandir module, to get a bit of a performance boost
on os.walk and os.listdir (which have been replaced with scandir.walk and scandir.listdir
respectively). See https://github.com/benhoyt/scandir#background on why that made
sense.
We can't rely on the publication date anymore with the introduction of prerelease
channels, since e.g. a current devel prerelease might have been published
earlier than the latest stable but should still be considered the latest release for
this release channel
We'll need to turn that into a separate plugin and while at it also
move away from the generalized slicing profile format.
That's more a topic for after 1.3.0 however, so for now, just
clean this up.
We might just have "eaten" a line used for triggering a pause (e.g. an M0)
and thus might not be eligible to send the next line from the streamed file
anymore.
Solves #1448
Should make sure stuff doesn't break when people perform manual
file operations on the uploads folder (e.g. uploading files
that don't match the sanitization scheme).
Should solve #1434
Probably solves the core reason that caused #1428 to be
reported in the first place, totally inaccurate early linear
approximations (when nothing better is available) making
it to the user.
It should now display "Calcuting..." until the approximation
stabilizes OR the configured max percentage or max time without
an estimate are reached.
* print progress shows percentage
* upload progress shows what it always showed, but fully centered
* GCODE viewer progress shows what it always showed, but fully centered
Seriously though, this topic is driving me nuts...
* track origin of print time left estimate
* less draconian threshold for estimation helper for all prints, not just
sd prints
* sanity check estimated/statistical total print time, if not sane force "dumb"
estimate
* force "dumb" estimate if no other estimate is available after set percentage or
print time
iteritems got removed items is to be used for python 2 and 3
compatibility , it returns a view in python 3 and must be casted to a
list if the list is needed.
bytes form builtins
using builtin function next is the compatible way between python 2 and 3
Set read timeout on serial port to a much shorter value (default 2.0s)
during a heatup. Firmware should usually send the current temperature
back every second, so if that stops we can consider the heatup to be finished
even if we don't see an ok.
That is important in cases such as SD printing, where we might see a
heatup sequence we didn't trigger ourselves, during which we shouldn't spam
the printer with commands it potentially can't process but after which we
still should take up normal communication again. In case of a heatup sequence
triggered by an SD print we won't see an ok and hence only can now through a
timeout that things are now done printer side. In such a case the user should not
get thrown a scary timeout message in their general direction either.
Solves #1409
So far the sending routine did not track the amount of bytes that were
actually sent. This is now fixed such that if the number of sent bytes
is less then the number of bytes of the whole message, the sending
rountine will continue to send the unsent parts of the message until
it succeeds (or a timeout occurs).
Also adjusted the virtual printer to imitate a real serial interface with
regards to having it return the written bytes and allowing a partial
sending (returning the number of bytes that actually were sent).
Added name and path various event print job events and
the upload event, deprecated the file property.
Had to move event triggering of the print job events to
the printer implementation, since the file manager
is not available in the comm layer. Added new callbacks
to the PrinterInterface to allow for that to be possible.
In some situations an error could be displayed otherwise since
online.gif was available, intermediary.gif wasn't anymore, but pinging
the latter timed out before the next ping of the former.
(cherry picked from commit 7809ba8)
Also user window.location.reload if URL to reload is the same as the current one,
otherwise reloading will be a no-op if a fragment is provided.
(cherry picked from commit a367902)
RepRapFirmware enumerates the gcode files starting at /gcode, it will
also interpret any relative path as being relative to that folder.
However a full absolute path will actually interpret as from the real
root of the SD card :-(
(cherry-picked from ac68570)
* Introduce Vector3D type to help with coordinate back and
forth calculations
* Fix typo in movement calculation (Y twice instead of Y and Z)
* Removed some code duplication
* UiPlugins may now disable preemptive caching
* Preemptive cache recording will also be disabled when preemptive caching
is disabled according to settings (so far only execution on startup was prevented
then)
* Preemptive cache forces configured view. E.g. if plugin "someplugin" was recorded
in the preemptive cache, a custom context now makes sure that only that this view
will be cached even if request parameters are hard to define to get routing to work
correctly for an alternative UI
"only_local" was not properly evaluated
when retrieving full settings tree for
config diffing and minimal persistance
in SettingsPlugin.
That lead to overlay settings making their
way into config.yaml.
RepRapFirmware enumerates the gcode files starting at /gcode, it will
also interpret any relative path as being relative to that folder.
However a full absolute path will actually interpret as from the real
root of the SD card :-(
Another update of the CHANGELOG after fixing a bug. Shifted release date
to tomorrow to leave more time for final tests that was now eaten up by the
last minute bug fix.
Also updated CONTRIBUTING file to explain new prerelease branch.
Events SlicingProfile(Added|Modified|Deleted). Initially thought to be necessary
to properly refresh available profiles in slicing dialog, not needed for that after
all but still left in and documented, might be useful for someone.
UI removes action buttons for them and displays a spinner
indicating that the timelapse in question is either being
recorded or being rendered at the moment.
Should prevent users from accidentally trying to render an
incomplete timelapse.
Could trigger lots of errors if an unrendered timelapse currently
being collected was deleted from a separate thread from right
under the collection thread.
Also only log errors while processing already deleted files
if debug logging is enabled.
Finally trigger MovieDone event AFTER deleting unrendered
files (otherwise just rendered timelapse might still be present
when list of timelapses is queried right after).
Should solve #1326
This should never have been a PriorityQueue, or at the very least it should
never have the data itself in a sortable structure.
Thanks to processing speed of the event queue that seldomly showed,
only in cases where two events entered the queue almost simultanously,
e.g. when starting to render a timelapse movie and immediately failing.
Should solve #1343
This fixes a simple typo in the API doc for fetching slicing profiles. The previous example had /profiles appended to it, whereas it should just be /api/slicing to fetch a list of all slicers and profiles.
* Do not trigger notifications within additional data generation,
that would trigger a LOT of notifications just on page load. Instead
adjusted to only display notification if a problematic file gets
selected for printing (and select & print gets downgraded to just
select in such a case too)
* Made some left-over english-only strings translatable
* Added Model Size display to additional data in file list (if we have
it, why not show it :))
* Slight rewording of notification.
* Fixed a merge error.
Should actually not have been limited to admins-only, that was an accident
during switching to 1.2.0 implementation.
Once #1110 is tackled, this should be something configurable based on the role
as well.
* Sponsors => Supporters
* Links to individual About dialog tabs from start page
* Slight rewording here and there
* rel="noopener noreferrer" for external links
When SD card support is disabled on the server, remove any client side
filtering to just SD files since there aren't any and there won't be UI
turn remove the filter either. Should address #1300
There could be some odd circumstances in development environments
leading to an older Click version being installed during an update restart,
so since it doesn't hurt as much to stay backwards compatible here, just
be it.
On win32 systems, Click 6.x uses win32 library functions to retrieve
the command line arguments in order to not have their encoding
destroyed. That clashes with rewriting of sys.argv like e.g. the PyCharm
debugger is doing it, causing the debugger parameters to be passed
on to the click parser.
Added a workaround that detects if sys.argv and the os specific
argument list don't have the same length and truncates the os specific
list if that is the case, in order to not pass on arguments from the os
that where already cut off from sys.argv by something else.
* was still only reading one line per 500ms, now reads
all available lines from stdout and stderr
* patch was written with too many newlines
* git reset was missing --hard parameter for forced versions
* proper unicode handling
* added git clean for code base reset
* make sure path to python executable doesn't have left-over
quotes on windows
Add more comments
Fine tweak code:
- Remove vanilla Object check with jQuery (lodash gives invalid result on arrays with isObject)
- Add function check on constructor
- Generate function name on anonymous functions
2. Add optional viewmodel(s) by pushing an extra array or by using object.optional
3. Add format option and return dependencies as object, by default it will return an array
We don't need user-definable pip command paths here,
that will only lead to tears when the pip command belongs
to a wrong Python environment and nothing installs as
expected.
pip 8 doesn't output ANY of the generated stdout output from
setup.py anymore. So instead of transfering the info we need about
a pip environment on stdout, we now need a temporary folder.
Yay.
Added custom bindings files in the flask.py js list
Removed inline onclick with sliderToggle and made a custom binding
'toggleContent'
Add padding and line-height to intermediary heading for better readability
While at it also adjusted highlighting so that the folder containing
the currently selected file will be highlighted if the selected file is
not within the current folder but in one of its sub folders.
This might help with #1065 if indeed is related to background tab suspending behaviours in
browsers, but is a completely blind guess at this point since I still have not been able to
reproduce that issue myself.
Having the plugin commands on the first level of --help proved to be
a bad idea since it basically kills every chance of lazy loading the (expensive)
plugin context. Using a sub command for anything plugin related allows us
to only fire up the plugin context if a plugin command is expected, saving us
some precious seconds of operation in all other cases.
For conformity reasons the dev sub commands were now restructured
similarly.
We don't actually need the pip caller, which necessitates version
detection and hence increases waiting times tremendously - a simple
command line call with the auto detected pip command for
uninstalling stuff is enough and cuts off a lot of the CLI response times.
If the python version is < 2.7.9, we try to patch urllib3 with pyopenssl
to get rid of any InsecurePlatform issues.
That only works if pyopenssl plus dependencies are installed however,
hence we also log that.
Now that the plugin manager gets initialized before the server gets even constructed, we need
to log that entry right after we've set up logging in order to post any plugin manager related
log entries after.
This change should make sure that only those settings actually make it into config.yaml
per plugin that do differ from the default settings. Up until now the full dictionary as received
e.g. from the REST API was saved, regardless whether it contained (only) default values or not.
That led to a lot of "null" entries in the config.yaml file, which for one looked horrible and also
led to problems when a plugin actually wanted to change its default values.
With this commit, two things are done. One, upon saving a configuration the default
implementation of the save routine in the settings plugin now first diffs the new data against
the defaults and only saves what is different. Two, upon server startup a cleanup method is
now called on settings plugins whose default implementation fetches the current data stored
in config.yaml, diffs that against the defaults and only writes back the diff result. If that is empty
the entry is completely deleted from config.yaml.
We now wait until the settings have been saved before we close the dialog.
That should hopefully reduce chances of an asynchronous "Oh no, the settings
were updated" message showing up just when finishing the dialog.
Bit of a debate with some gcode purists. RepRapPro demands an S
parameter. Adding S255 should be backward compatible with the firmwares
that recognize M106 as full on. As with other issues, it'd be nice to
have something more to go on here than the reprap wiki and firmware
source code.
This will directly offer a "Restart Now" button on the "a restart is required" notification
for plugins which cannot be directly enabled/disabled without a restart, but only if
the restart command is configured on the server.
On click a confirmation dialog will be shown.
PNotify always merges the default buttons and the ones provided. Just settings the default
to containing no buttons was no option since plugins might already depend on the so far
obligatory Cancel button being present. The helper allows to create one buttoned
notifications without touching the defaults.
In case the user site packages are not yet part of the used
working set OR the sys path and ENABLE_USER_SITE is true, the
manager will now make sure that the folder is searched for plugins
as well upon plugin reload.
This is necessary since Python will not automatically include the
user site directory upon firing up the program in case there's
nothing installed to it/it doesn't exist. If a plugin is installed
during run time with --user that will lead to it not being found,
which is undesirable. Hence run time manipulation of sys.path and
the workingset becomes necessary.
Managable currently pretty much only means "uninstallable".
Plugins are managable if their installation location is writable
and - if they are installed from an entry point and OctoPrint is
running in a virtual environment - within the bounds of the virtual
environment (because otherwise pip will not allow to uninstall).
There was a problem with software update checks configurations stored in
config.yaml for which the providing plugin was then removed, since those
check definitions then lacked their default values to be merged on whatever
was stored in config.yaml, causing incomplete check configurations as a
consequence over which the plugin tripped.
This patch fixes that in that it tracks which check config keys are provided
by plugins and only returns those as the active check configurations that
belong to plugins that are still in the system.
TODO: This is only half of the solution. Check configurations of plugins
that are being uninstalled should be removed from the config if the
user decides to remove any settings by the plugin too. We need some
adjustments in the lifecycle tracking in order to make this possible
however, so for now this must suffice to at least prevent any errors from
occuring when incomplete configs are encountered.
Sessions could get duplicated, wrongly saved etc. The reason was not
persisting the actual user object to the internal session map (but the
LocalProxy instead). That could lead to multiple sessions being
created for one login, or the session user being set to an
anonymous user, or various other odd effects depending on timing.
Moving from the button to the username field probably makes even more
sense and while we are at it we can also extract the element access into
proper variables.
When doing 'git checkout <rev>' or 'git checkout <tag>' there will be no
branch info:
$ git branch
* (detached from 96fc70b)
After whitelisting '\(detached.*' we get:
$ python setup.py version
running version
got version from git {'version': '1.2.5-1-gfd73e02', 'branch': 'HEAD',
'full': 'fd73e02f4fa9f286407ad688feeeee3ebaffea60'}
Version is currently: 1.2.5-1-gfd73e02
The '-1-gfd73e02' is this commit on top of the 1.2.5 tag.
While detached checkouts should be discouraged some buildsystems (e.g.
OpenEmbedded) have no real way to avoid it, which is what this patch
fixes. Actual people doing a checkout should use a branch.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Use new synchronized sending method and also make sure that heaters
will get disabled in case M112 is NOT understood by the firmware
before disconnecting. That's about all we can do for now.
* Added "total" space to "free" in file list
* Added configurable space thresholds. If free space is below "warning"
threshold, exclamation sign will be added to report. If free space is below
"critical" threshold, report will be styled bold and red.
Within the settings/features there is now a block of radio buttons
where the user can select whether to send checksums only when printing,
always or never.
In order to maintain backward compatibility in the settings, this is stored
in two variables, alwaysSendChecksum and neverSendChecksum. If both are False,
it is assumed that checksums are sent only when printing, being this the default value.
* Allow configuration of checkout folder and version tracking type
via Plugin Configuration
* Display message to use if checkout folder is not configured or a
non-release version is running and version tracking against releases
is enabled
* Clear version cache when a change in the check configuration is
detected
* Mark check configurations for which an update is not possible with
a little exclamation mark
That's where all other protocol specific settings are currently located.
Will be migrated at a later date into the printer profile instead (that
makes way more sense).
If a new config setting is set, the virtual printer will now
resend the same resend request twice to allow testing the
comm layer behaviour in OctoPrint for being able to cope with
these possible repetitions like they can happen with Repetier.
Repetier might resend the same resend request to make sure it arrives.
This commit makes OctoPrint not react to such a repeated request and
instead ignore up to a configurable amount of repeated requests for
the same (current) line.
Closing the printer connection and then reopening (when the users clicks
connect) will create a new fresh MachineCom object so the queues will
start out empty. Plus ClearableQueue was even more tied to the Queue
implementation that the current _get/_put overrides.
This will only style them in a special way and influence sorting. Plugins still need
to ensure that a step is not skipped through the use of the onWizardTabChange callback
in the view model.
T-only lines were not properly parsed. Should now be fixed to
be associated to currently selected extruder. Also added unit
tests for the temperature parsing.
While at it also extracted regexes and added unit tests for command
parsing (gcode & parameters)
Even if the webcam URLs and the FFMPEG path is not yet configured. Otherwise
setting those URLs and the path will require a restart of OctoPrint to enable properly -
that's overkill.
Also introduced wizard finish backend method and remove old
firstrun dialog remnants.
TODO: bound check won't work this way, needs to be redone
differently. Goal is to only call onWizardFinish for wizards which
are actually involved...
No need to have templates here, we do it directly from the helper methods.
That also leaves us more options regarding callbacks, classes etc.
Helper methods now take an options dictionary (but still can fallback to the
old signature) containing messages, titles, callbacks etc instead of using
positional arguments for that. Switched code over to utilize that new
calling approach.
The user will now be offered a dialog with two choices if a server side update
of the settings is detected while the user has the settings dialog opened and made
local changes: Either reload all changes, effectively overwriting any local changes,
or only set those settings changed on the server that are not also changed locally.
If after a reconnect the server side configuration has changed, we want to reload.
Using the SettingsUpdated event the clients can track the current config hash during
runtime so that no unnecessary reloads during runtime should be demanded.
Readline could still be stuck in a read loop, leading to an exception on Mac
when closing the connection from another thread. This should now be captured
correctly.
Fixes#1021
"Hello" command sent to printer to trigger initial handshake can now be
configured. Commands that _always_ necessitate to be sent with checksum/
line number (e.g. M110 on Marlin) can be configured as such too.
Also fixed an issue causing the "Hello" command to not be actually enqueued
first thing on opening a connection. Seems to not have caused harm in the
wild, but was unintentional.
The GCODE viewer settings callback was not properly called, hence the
viewer was not initialized properly.
Changed prevention of concurrent settings requests to properly handle
the situation where the registered settings callbacks might be extended
through another callback.
If re-creation of the folder fails due to an access error, perform three retries. It might
be caused by the folder being open in the file explorer. Waiting a bit before retrying
seems to do the trick.
See also #1019
Introduced three new events:
* CONNECTING - fired just before starting the connection process
* DISCONNECTING - fired just before starting the (active) disconnection
process
* PRINTER_STATE_CHANGED - fired every time the printer state changes
Also introduced new GCODE script beforePrinterDisconnected, which will
get sent just before the printer gets (actively) disconnected. Also enabled
communication object to wait for the send queue to be emptied before
closing it, in order to allow sending all lines from the disconnect script.
That should fix user settings across multiple SessionUser wrappers. User settings were
previously only copied upon initialization of the SessionUser, with no update later on,
leading to them becoming out of sync with the underlying User instance.
This commit changes SessionUser to delegate method and attribute access for anything
but its own members to delegate to the wrapped User instance instead.
On MacOS, `tempfile.mkdtemp()` doesn't necessarily return a canonical
path (it uses `/private/var` instead of `/var`, but they are the same
thing). Since the `filemanager.storage` module canonicalizes paths,
tests were erroneously failing due to prefix match failures.
Finally found a replacement for the word "responsive", which these
days is almost inclusively understood as "viewport adjusting"
instead of its original meaning "reacting quickly".
Thanks to the javascript world, even "reactive" isn't an option
anymore, this term has now been hijacked as well.
* Show when settings are saving
* Show when settings are being retrieved
* Disable Send/Cancel buttons while settings are saving
* Prevent concurrent retrieval
The class knows about which pip versions support --process-dependency-links, which
need --no-use-wheel and which are broken altogether and adds/removes these parameters
accordingly or outright reports the broken pip version.
Also migrate for any config version < 4 (incl. None) and make sure
the other migrations may happen on top of that if necessary. Added
some comments to explain necessary migrations.
Capturing is now queue based, rendering will not start until all images have been captured,
and timed postroll does not depend on system time anymore.
Also refactored some of the names to be python naming compliant while at it.
Added profile is now set as default and UI is a bit more visually pleasing.
Next step is to find some way to mark wizard completion as "please ignore"...
In case a wizard plugin needs to communicate more info with its frontend,
such as which kind of information is missing, this is now possible through
a new API endpoint that will collect such information from the plugins
and provide it to callees.
daemon flag was missing, leading to the timer staying active even when a shutdown
was triggered. Added new daemon flag to timer constructor, defaulting to true, that
fixes that behaviour.
Absolute positioning caused panes to sometimes not render when being
selected. Switching to static positioning again makes the dialog look a bit
weird, but that's probably still preferable to no content showing. It seems
to be a browser bug that not's present with Safari 7, more tests to pinpoint
what exactly is causing this are probably necessary, but this at least is a
functional workaround for now.
Two changes:
* Asset existence will now be checked before they get included
in the assets to bundle by webassets, logging a warning if a
file isn't present.
* Monkey-patched webassets filter chain to not die when a file
doesn't exist, but to log an error instead and just return
an empty file instead.
- Convert query term to lower case so that it is case insensitive both ways
- Knockout submit binding takes the form element as parameter and return
value determines whether the form submit occurs. See http://knockoutjs.com/documentation/submit-binding.html
Server startup could fail if for whatever reason the timelapse settings
had lost their type value, since the dict was not merged with the
default values upon retrieval.
Some underlying file systems might not trigger change events (e.g.
mounted remote file systems). Added a feature flag to allow for
switching to a (less performant) polling method.
Wraps sarge and allows asynchronous execution of commands incl. logging
to provided logging methods for stdout, stderr and command calls.
Refactored PipCaller to utilized that.
Old versions of setuptools return a tuple for their
pkg_resources.parse_version method instead of a Version object with
a base_version attribute that we can use to retrieve the base version.
So some manually parsing is needed instead.
OctoPrint's version might be a prerelease version ("...dev<n>"), we
want that to still be able to pass plugin compatibility checks like the
final release version would, so always use the base version of
OctoPrint's current version for comparison during compatibility checks.
When using the version cache only use the version cache if the OctoPrint
version stored within it matches the one of the currently running
instance. Otherwise we might report false positives with regards to
available updates under some circumstances.
Should be valid zip archives/tarballs. Also use only the extension
of an uploaded plugin archive as suffix for the temporary file that's
used for installing it.
Plugin Manager now internally uses pkg_resources.parse_version and
pkg_resources.parse_requirements to check for version compatibility
with plugins from the repository. That will allow to directly use
the OctoPrint version string once it's PEP440 compatible.
Local file storage implementation will now "touch" added files to set
modification date to current date, ensuring that files that are just
moved through a custom implementation of file object (e.g. through the
watched folder mechanism) will show with "now" as the upload date.
If compatibility information is provided only as a version number it's
prefixed with >= for the check (so stating a compatibility of only
1.2.0 will now make the plugin compatible to all versions that follow
too).
Alternatively the compatibility information may now contain stuff like
">=1.2,<1.3" in which case the plugin will only be shown as compatible
to OctoPrint versions 1.2 and up but not 1.3 or anything above that.
Custom exception should be derived from Exception, not BaseException.
Not only is this specified in the python documentation, but also
tornado will be able to handle Exceptions in requests perfectly fine
and return an HTTP 500 for them, but crash hard (as in, server shut
down follows) for BaseExceptions.
This changes the semantics of setup.py slightly. '--all' needs to be
passed in order to delete everything that is deleted by previous
versions. Some additional build files may also be deleted.
2015-01-16 16:22:34 -08:00
730 changed files with 148321 additions and 66415 deletions
args:'☑️ Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ steps.latest.outputs.release }}` was successful'
- name:📧 Discord failure notification
if:failure()
env:
DISCORD_WEBHOOK:${{ secrets.discord_webhook }}
uses:Ilshidur/action-discord@master
with:
args:'🚫 Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ steps.latest.outputs.release }}` failed'
* [#318](https://github.com/foosel/OctoPrint/issues/318) - Snapshots for timelapses are now named in a non-colliding, job-based way, allowing a new timelapse to start while the other is still being rendered (although printing with an active timelapse rendering job is not recommended and will be solved with a proper render job queue in a later version). Timelapses that were not successfully rendered are kept for 7 days (configurable, although not via the UI so far) and can be manually rendered or deleted through a new UI component within the timelapse tab that shows up if unrendered timelapses are detected.
* [#485](https://github.com/foosel/OctoPrint/issues/485) - "Timelapse rendering" notification is now persistent, even across reloads/client switches. That should make it easier to see that a rendering job is currently in progress.
* [#939](https://github.com/foosel/OctoPrint/issues/939) - Updated to Knockout 3.4.0
* [#1204](https://github.com/foosel/OctoPrint/issues/1204) - Display total print time as estimated by GCODE viewer on GCODE viewer tab. That will allow access to an estimate even if the server hadn't yet calculated that when a print started. Note that due to slightly different implementation server and client side the resulting estimate might differ.
* OctoPrint now serves an intermediary page upon start that informs the user about the server still starting up. Once the server is detected as running, the page automatically switches to the standard interface.
* OctoPrint now displays a link to the release notes of an updated component in the update notification, the update confirmation and the version overview in the settings dialog. Please always make sure to at least skim over the release notes for new OctoPrint releases, they might contain important information that you need to know before updating.
* Improved initial page loading speeds by introducing a preemptive cache. OctoPrint will now record how you access it and on server start pre-render the page so it's ideally available in the server-side cache when you try to access it.
* Initialize login user name and password with an empty string and clear both on successful login (see [#1175](https://github.com/foosel/OctoPrint/pull/1175)).
* Added a "Refresh" button to the file list for people who modify the stored files externally (doing this is not encouraged however due to reasons of book keeping, e.g. metadata tracking etc).
* "Save" button on settings dialog is now disabled while background tasks (getting or receiving config data from the backend) are in progress.
* Improved performance of terminal tab on lower powered clients. Adaptive rate limiting now ensures the server backs off with log updates if the client can't process them fast enough. If the client is really slow, log updates get disabled automatically during printing. This behaviour can be disabled with override buttons in the terminal tab's advanced options if necessary.
* Added option to ignore any unhandled errors reported by the firmware and another option to only cancel ongoing prints on unhandled errors from the firmware (instead of instant disconnect that so far was the default).
* Made version compatibility check PEP440 compliant (important for plugin authors).
* Do not hiccup on manually sent `M28` commands.
* Persist print recovery data on print failures (origin and name of printed file, position in file when print was aborted, time and date of print failure). Currently this data isn't used anywhere, but it [can be accessed from plugins in order to add recovery functionality](https://github.com/foosel/OctoPrint-PrintRecoveryPoc) to OctoPrint.
* Small performance improvements in update checks.
* The file upload dialog will now only display files having an extension that's supported for upload (if the browser supports it, also see [#1196](https://github.com/foosel/OctoPrint/issues/1196)).
### Bug Fixes
* [#1007](https://github.com/foosel/OctoPrint/issues/1007) - Don't enable the "Print" button if no print job is selected.
* [#1181](https://github.com/foosel/OctoPrint/issues/1181) - Properly slugify UTF-8 only file names.
* [#1196](https://github.com/foosel/OctoPrint/issues/1196) - Do not show drag-n-drop overlay if server is offline.
* [#1208](https://github.com/foosel/OctoPrint/issues/1208) - Fixed `retraction_combing` profile setting being incorrectly used by bundled Cura plugin (see [#1209](https://github.com/foosel/OctoPrint/pull/1209))
* Fixed OctoPrint compatibility check in the plugin manager, could report `False` for development versions against certain versions of Python's `setuptools` (thanks to @ignaworm who stumbled over this).
* Fixed a missing parameter in `PluginSettings.remove` call (see [#1177](https://github.com/foosel/OctoPrint/pull/1177)).
* Docs: Fixed the example for a custom `M114` control to also match negative coordinates.
* Reset scroll position in settings dialog properly when re-opening it or switching tabs.
* Fixed an issue that prevented system menu entries that were added to a so far empty system menu make the menu show up.
* Fixed an issue that made requests to restricted resources fail even though the first run wizard had been completed successfully.
* Fixed an issue where an unknown command or the suppression of a command could cause the communication to stall until a communication timeout was triggered.
* Strip [unwanted ANSI characters](https://github.com/pypa/pip/issues/3418) from output produced by pip versions 8.0.0, 8.0.1 and 8.0.3 that prevents our plugin installation detection from working correctly.
For more information please refer to the [Important information for people updating from version 1.2.7](#important-information-for-people-updating-from-version-127)
above.
* Fix: Current filename in job data should never be prefixed with `/`
* Only persist plugin settings that differ from the defaults. This way the
`config.yaml` won't be filled with lots of redundant data. It's the
responsibility of the plugin authors to responsibly handle changes in default
settings of their plugins and add data migration where necessary.
* Fixed a documentation bug ([#1067](https://github.com/foosel/OctoPrint/pull/1067))
* Fixed a conflict with bootstrap-responsive, e.g. when using the
* New option to actively poll the watched folder. This should make it work also
if it is mounted on a filesystem that doesn't allow getting notifications
about added files through notification by the operating system (e.g.
network shares).
* Better resilience against senseless temperature/SD-status-polling intervals
(such as 0).
* Log exceptions during writing to the serial port to `octoprint.log`.
### Bug Fixes
* [#961](https://github.com/foosel/OctoPrint/pull/961) - Fixed a JavaScript error that caused an error to be logged when "enter" was pressed in file or plugin search.
* [#962](https://github.com/foosel/OctoPrint/pull/962) - ``url(...)``s in packed CSS and LESS files should now be rewritten properly too to refer to correct paths
* Update notifications were not vanishing properly after updating:
* Only use version cache for update notifications if the OctoPrint version still is the same to make sure the cache gets invalidated after an external update of OctoPrint.
* Do not persist version information when saving settings of the Software Update plugin
* Always delete files from the ``watched`` folder after importing then. Using file preprocessor plugins could lead to the files staying there.
* Fixed an encoding problem causing OctoPrint's Plugin Manager and Software Update plugins to choke on UTF-8 characters in the update output.
* Fixed sorting by file size in file list
* More resilience against missing plugin assets:
* Asset existence will now be checked before they get included
in the assets to bundle by webassets, logging a warning if a
file isn't present.
* Monkey-patched webassets filter chain to not die when a file
doesn't exist, but to log an error instead and just return
* More flexibility when interpreting compatibility data from plugin repository. If compatibility information is provided
only as a version number it's prefixed with `>=` for the check (so stating a compatibility of only
`1.2.0` will now make the plugin compatible to OctoPrint 1.2.0+, not only 1.2.0). Alternatively the compatibility
information may now contain stuff like `>=1.2,<1.3` in which case the plugin will only be shown as compatible
to OctoPrint versions 1.2.0 and up but not 1.3.0 or anything above that. See also
[the requirement specification format of the `pkg_resources` package](https://pythonhosted.org/setuptools/pkg_resources.html#requirements-parsing).
* Only print the commands of configured event handlers to the log when a new `debug` flag is present in the config
(see [the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html#events)). Reduces risk of disclosing sensitive data when sharing log files.
### Bug Fixes
* [#956](https://github.com/foosel/OctoPrint/issues/956) - Fixed server crash when trying to configure a default
slicing profile for a still unconfigured slicer.
* [#957](https://github.com/foosel/OctoPrint/issues/957) - Increased maximum allowed body size for plugin archive uploads.
* Bugs without tickets:
* Clean exit on `SIGTERM`, calling the shutdown functions provided by plugins.
* Don't disconnect on `volume.init` errors from the firmware.
*`touch` uploaded files on local file storage to ensure proper "uploaded date" even for files that are just moved
from other locations of the file system (e.g. when being added from the `watched` folder).
* The [Cura integration](https://github.com/daid/Cura) has changed in such a way that OctoPrint now calls the
[CuraEngine](https://github.com/Ultimaker/CuraEngine) directly instead of depending on the full Cura installation. See
[the wiki](https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura) for instructions on how to change your setup to
accommodate the new integration.
### New Features
* OctoPrint now has a [plugin system](http://docs.octoprint.org/en/master/plugins/index.html) which allows extending its
core functionality.
* Plugins may be installed through the new and bundled [Plugin Manager Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager)
available in OctoPrint's settings. This Plugin Manager also allows browsing and easy installation of plugins
registered on the official [OctoPrint Plugin Repository](http://plugins.octoprint.org).
* For interested developers there is a [tutorial available in the documentation](http://docs.octoprint.org/en/master/plugins/gettingstarted.html)
and also a [cookiecutter template](https://github.com/OctoPrint/cookiecutter-octoprint-plugin) to quickly bootstrap
new plugins.
* Added internationalization of UI. Translations of OctoPrint are being crowd sourced via [Transifex](https://www.transifex.com/projects/p/octoprint/).
Language Packs for both the core application as well as installed plugins can be uploaded through a new management
dialog in Settings > Appearance > Language Packs. A translation into German is included, further language packs
will soon be made available.
* Printer Profiles: Printer properties like print volume, extruder offsets etc are now managed via Printer Profiles. A
connection to a printer will always have a printer profile associated.
* File management now supports STL files as first class citizens (including UI adjustments to allow management of
uploaded STL files including removal and reslicing) and also allows folders (not yet supported by UI). STL files
can be downloaded like GCODE files.
* Slicing has been greatly improved:
* It now allows for a definition of slicing profiles to use for slicing plus overrides which can be defined per slicing
job (defining overrides is not yet part of the UI but it's on the roadmap).
* A new slicing dialog has been added which allows (re-)slicing uploaded STL files (which are now displayed in the file list
as well). The slicing profile and printer profile to use can be specified here as well as the file name to which to
slice to and the action to take after slicing has been completed (none, selecting the sliced GCODE for printing or
starting to print it directly)
* The slicing API allows positioning the model to slice on the print bed (Note: this is not yet available in the UI).
* Slicers themselves are integrated into the system via ``SlicingPlugins``.
* Bundled [Cura Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura) allows slicing through CuraEngine up
to and including 15.04. Existing Cura slicing profiles can be imported through the web interface.
* New file list: Pagination is gone, no more (mobile incompatible) pop overs, instead scrollable and with instant
search
* You can now define a folder (default: `~/.octoprint/watched`) to be watched for newly added GCODE (or -- if slicing
support is enabled -- STL) files to automatically add.
* New type of API key: [App Session Keys](http://docs.octoprint.org/en/master/api/apps.html) for trusted applications
* OctoPrint now supports `action:...` commands received via debug messages (`// action:...`) from the printer. Currently supported are
-`action:pause`: Pauses the current job in OctoPrint
-`action:resume`: Resumes the current job in OctoPrint
-`action:disconnect`: Disconnects OctoPrint from the printer
Plugins can add supported commands by [hooking](http://docs.octoprint.org/en/master/plugins/hooks.html) into the
``octoprint.comm.protocol.action`` hook
* Mousing over the webcam image in the control tab enables key control mode, allowing you to quickly move the axis of your
printer with your computer's keyboard ([#610](https://github.com/foosel/OctoPrint/pull/610)):
* Bundled [Discovery Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery) allows discovery of OctoPrint
instances via SSDP/UPNP and optionally also via ZeroConf/Bonjour/Avahi.
* Bundled [Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update) takes care of notifying
about new OctoPrint releases and also allows updating if configured as such. Plugins may register themselves with the
update notification and application process through a new hook ["octoprint.plugin.softwareupdate.check_config"](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#octoprintpluginsoftwareupdatecheck_config).
### Improvements
* Logging is now configurable via config file
* Added last print time to additional GCODE file information
* Better error handling for capture issues during timelapse creation & more robust handling of missing images during
timelapse creation
* Start counting the layers at 1 instead of 0 in the GCODE viewer
* Upgraded [Font Awesome](https://fortawesome.github.io/Font-Awesome/) to version 3.2.1
* Better error reporting for timelapse rendering and system commands
* Custom control can now be defined so that they show a Confirm dialog with configurable text before executing
([#532](https://github.com/foosel/OctoPrint/issues/532) and [#590](https://github.com/foosel/OctoPrint/pull/590))
* Serial communication: Also interpret lines starting with "!!" as errors
* Added deletion of pyc files to the `python setup.py clean` command
* Settings now show a QRCode for the API Key ([#637](https://github.com/foosel/OctoPrint/pull/637))
* Username in UI is no longer enclosed in scare quotes ([#595](https://github.com/foosel/OctoPrint/pull/595))
* Username in login dialog is not automatically capitalized on mobile devices anymore ([#639](https://github.com/foosel/OctoPrint/pull/639))
* "Slicing Done" and "Streaming Done" notifications now have a green background ([#558](https://github.com/foosel/OctoPrint/issues/558))
* Files that are currently in use, be it for slicing, printing or whatever, are now tracked and can not be deleted as
long as they are in use
* Settings in UI get refreshed when opening settings dialog
* New event "SettingsUpdated"
* "Print time left" is now not displayed until it becomes somewhat stable. Display in web interface now also happens
in a fuzzy way instead of the format hh:mm:ss, to not suggest a high accuracy anymore where the can't be one. Additionally
OctoPrint will use data from prior prints to enhance the initial print time estimation.
* Added handler for uncaught exceptions to make sure those get logged, should make the logs even more useful for analysing
bug reports
* The server now tracks the modification date of the configuration file and reloads it prior to saving the config if
it has been changed during runtime by external editing, hence no config settings added manually while the server
was running should be overwritten anymore.
* Display a "Please Reload" overlay when a new server version or a change in installed plugins is detected after a
reconnect to the server.
* Better handling of errors on the websocket - no more logging of the full stack trace to the log, only a warning
message for now.
* Daemonized OctoPrint now cleans up its pidfile when receiving a TERM signal ([#711](https://github.com/foosel/OctoPrint/issues/711))
* Added serial types for OpenBSD ([#551](https://github.com/foosel/OctoPrint/pull/551))
* Improved behaviour of terminal:
* Disabling autoscrolling now also stops cutting off the log while it's enabled, effectively preventing log lines from
being modified at all ([#735](https://github.com/foosel/OctoPrint/issues/735))
* Applying filters displays ``[...]`` where lines where removed and doesn't cause scrolling on filtered lines
* System commands now be set to a) run asynchronized by setting their `async` property to `true` and b) to ignore their
result by setting their `ignore` property to `true`.
* Various improvements of newly introduced features over the course of development:
* File management: The new implementation will migrate metadata from the old one upon first startup after upgrade from
version 1.1.x to 1.2.x. That should speed up initial startup.
* File management: GCODE Analysis backlog processing has been throttled to not take up too many resources on system
startup. Freshly uploaded files should still be analyzed at full speed.
* Plugins: SettingsPlugins may track versions of configuration format stored in `config.yaml`, including a custom
migration method getting called when a mismatch between the currently stored configuration format version and the one
reported by the plugin as current is detected.
* Plugins: Plugins may now have a folder for plugin related data whose path can be retrieved from the plugin itself
via its new method [`get_plugin_data_folder`](http://docs.octoprint.org/en/master/modules/plugin.html#octoprint.plugin.types.OctoPrintPlugin.get_plugin_data_folder).
* Plugin Manager: Don't allow plugin management actions (like installing/uninstalling or enabling/disabling) while the
printer is printing (see also unreproduced issue [#936](https://github.com/foosel/OctoPrint/issues/936)).
* Plugin Manager: More options to try to match up installed plugin packages with discovered plugins.
* Plugin Manager: Display a more friendly message if after the installation of a plugin it could not be correctly
identifier.
* Software Update: Enforce refreshing of available updates after any changes in enabled plugins.
### Bug Fixes
* [#435](https://github.com/foosel/OctoPrint/issues/435) - Always interpret negative duration (e.g. for print time left)
as 0
* [#516](https://github.com/foosel/OctoPrint/issues/516) - Also require API key even if ACL is disabled.
* [#556](https://github.com/foosel/OctoPrint/issues/556) - Allow login of the same user from multiple browsers without
side effects
* [#612](https://github.com/foosel/OctoPrint/issues/612) - Fixed GCODE viewer in zoomed out browsers
* [#633](https://github.com/foosel/OctoPrint/issues/633) - Correctly interpret temperature lines from multi extruder
setups under Smoothieware
* [#680](https://github.com/foosel/OctoPrint/issues/680) - Don't accidentally include a newline from the MIME headers
in the parsed multipart data from file uploads
* [#709](https://github.com/foosel/OctoPrint/issues/709) - Properly initialize time estimation for SD card transfers too
* [#715](https://github.com/foosel/OctoPrint/issues/715) - Fixed an error where Event Triggers of type command caused
and exception to be raised due to a misnamed attribute in the code
* [#717](https://github.com/foosel/OctoPrint/issues/717) - Use ``shutil.move`` instead of ``os.rename`` to avoid cross
* Added deletion of `*.pyc` files to `python setup.py clean` command, should help tremendously when switching branches (backported
from [9e014eb](https://github.com/foosel/OctoPrint/commit/9e014eba1feffde11ed0601d9c911b8cac9f3fb0))
* Increased default communication and connection timeouts
* [#706](https://github.com/foosel/OctoPrint/issues/706) - Do not truncate error reported from printer
### Bug Fixes
* [#539](https://github.com/foosel/OctoPrint/issues/539) - Limit maximum number of tools, sanity check tool numbers in
GCODE files against upper limit and refuse to create 10000 tools due to weird slicers. (backported from `devel`)
* [#634](https://github.com/foosel/OctoPrint/pull/634) - Fixed missing `branch` fields in version dicts generated
by versioneer
* [#679](https://github.com/foosel/OctoPrint/issues/679) - Fix error where API state is requested and printer is offline
(backport of [619fe9a](https://github.com/foosel/OctoPrint/commit/619fe9a0e78826bd1524b235a910156439bcb6d7)).
* [#719](https://github.com/foosel/OctoPrint/issues/719) - Properly center print bed in GCODE viewer
* [#780](https://github.com/foosel/OctoPrint/issues/780) - Always (re)set file position in SD files to 0 so that reprints
work correctly (backported from ``devel``)
* [#801](https://github.com/foosel/OctoPrint/issues/801) - Fixed setting of bed temperature offset
* [IRC] - Don't hiccup on slic3r ``filament_diameter`` comments generated for multi extruder setups
* [ML] - Fixed relative URL to SockJS endpoint, wasn't yet using the proper base url
* [unreported] & [#698](https://github.com/foosel/OctoPrint/issues/698) - Generated URLs now take X-Forwarded-Host header
sent by proxies into account for included host and port, also fixed [#698](https://github.com/foosel/OctoPrint/issues/698)
introduced by this
* [unreported] Fixed a bug causing gcodeInterpreter to hiccup on GCODES containing invalid coordinates such as Xnan or
Yinf (backported from `devel`)
* Small fixes for timelapse creation:
- [#344](https://github.com/foosel/OctoPrint/issues/344) - Made timelapses capable of coping with missing captures in between by decrementing the image counter again if there
was an error fetching the latest image from the snapshot URL (backport of [1a7a468](https://github.com/foosel/OctoPrint/commit/1a7a468eb65fdf2a13b4c7a7723280e822c9c34b)
and [bf9d5ef](https://github.com/foosel/OctoPrint/commit/bf9d5efe43a1e57aacd8512125082ddca06b4efc))
- [#693](https://github.com/foosel/OctoPrint/issues/693) - Try not to capture an image if image counter is still unset
- [unreported] Synchronize image counter decrementing as well as incrementing to prevent rare race conditions when generating the
* New Event structure allows more flexibility regarding payload data, configuration files will be migrated automatically.
You can find the documentation of the new event format and its usage at [docs.octoprint.org](http://docs.octoprint.org/en/1.1.0/events/index.html).
* Support for multi extruder setups. With this OctoPrint now in theory supports an unlimited amount of extruders, however
for now it's artificially limited to 9.
* Log files can be accessed from within the browser via the Settings dialog ([#361](https://github.com/foosel/OctoPrint/pull/361))
* Timelapses can now have a post-roll duration configured which will be rendered into the video too to not let it
end so abruptly ([#384](https://github.com/foosel/OctoPrint/issues/384))
* The terminal tab now has a command history ([#388](https://github.com/foosel/OctoPrint/pull/388))
### Improvements
* Stopping the application via Ctrl-C produces a less scary message ([#277](https://github.com/foosel/OctoPrint/pull/277))
* Webcam stream is disabled when control tab is not in focus, reduces bandwidth ([#316](https://github.com/foosel/OctoPrint/issues/316))
* M and G commands entered in Terminal tab are automatically converted to uppercase
* GCODE viewer now only loads automatically if GCODE file size is beneath certain threshold (different ones for desktop
and mobile devices), only actually loads file if user acknowledges that this might be too much for his browser
* Added time needed for printing file to PrintDone event's payload ([#333](https://github.com/foosel/OctoPrint/issues/333))
* Also provide the filename (basename without the path) in print events
* Support for circular beds in the GCODE viewer ([#407](https://github.com/foosel/OctoPrint/pull/407))
* The dimensions of the print bed can now be configured via the Settings ([#396](https://github.com/foosel/OctoPrint/pull/396))
* Target temperature reporting format of Repetier Firmware is now supported as well ([360](https://github.com/foosel/OctoPrint/issues/360))
* Version tracking now based on git tagging and [versioneer](https://github.com/warner/python-versioneer/). Version number,
git commit and branch get reported in the format `<version tag>-<commits since then>-g<commit hash> (<branch> branch)`,
e.g. `1.2.0-dev-172-ga48b5de (devel branch)`.
* Made "Center viewport on model" and "Zoom in on model" in the GCODE viewer automatically deselect and de-apply if
viewport gets manipulated by the user ([#398](https://github.com/foosel/OctoPrint/issues/398))
* GCODE viewer now interprets inverted axes for printer control and mirrors print bed accordingly ([#431](https://github.com/foosel/OctoPrint/issues/431))
* Added `clean` command to `setup.py`, removes old build artifacts (mostly interesting for developers)
* Added version resource on API which reports application and API version
* Made the navbar static instead of fixed to improve usability on mobile devices ([#257](https://github.com/foosel/OctoPrint/issues/257))
* Switch to password field upon enter in username field, submit login form upon enter in password field
* Changed default path to OctoPrint executable in included init-script to `/usr/local/bin/octoprint` (the default when
installing via `python setup.py install`)
### Bug Fixes
* Properly calculate time deltas (forgot to factor in days)
* [#35](https://github.com/foosel/OctoPrint/issues/35) - GCODE viewer has been modularized, options are now functional
* [#337](https://github.com/foosel/OctoPrint/issues/337) - Also recognize `--iknowwhatimdoing` when running as daemon
* [#357](https://github.com/foosel/OctoPrint/issues/357) - Do not run GCODE analyzer when a print is ongoing
* [#381](https://github.com/foosel/OctoPrint/issues/381) - Only list those SD files that have an ASCII filename
* Fixed a race condition that could occur when pressing "Print" (File not opened yet, but attempt to read from it)
* [#398](https://github.com/foosel/OctoPrint/issues/398) - Fixed interfering options in GCODE viewer
Please refer to [this FAQ entry](https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299/1).
### Where can I find my browser's error console?
See [How to open the Javascript Console in different browsers](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)
## Setting up a development environment
See [the corresponding chapter in the documentation](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment).
This also includes information on how to run the test suite and how to build
the documentation.
## Pull requests
1. If you want to add a new feature to OctoPrint, **please always first
@@ -233,7 +301,8 @@ See [How to open the Javascript Console in different browsers](https://webmaster
the discussion going on how best to solve *this* in OctoPrint's plugin
system - maybe that's the actual PR you have been waiting for to contribute :)
2. If you plan to make **any large or otherwise disruptive changes to the
code or appearance, please open a "Brainstorming" ticket first** so
code or appearance, please get intouch on the
[forums](https://community.octoprint.org/c/development)** first so
that we can determine if it's a good time for your specific pull
request. It might be that we're currently in the process of making
heavy changes to the code locations you'd target as well, or your
@@ -241,17 +310,19 @@ See [How to open the Javascript Console in different browsers](https://webmaster
just cause unnecessary work and frustration for everyone or
possibly get the PR rejected.
3. Create your pull request **from a custom branch** on your end (e.g.
`dev/myNewFeature`)[1]**against the `devel` branch**. Create **one pull request
per feature/bug fix**. If your PR contains an important bug fix, we will
make sure to backport it to the `maintenance` branch to also include it in
the next release.
4. Make sure there are **only relevant changes** included in your PR. No
`dev/myNewFeature`)[1].
4. Create your pull request **only against the `maintenance` or `devel` branch**:
* if it's a bug fix for a bug in the current stable version, an improvement of existing functionality or a
*small* new feature (e.g. a new hook, a new config flag, ...): `maintenance` branch
* otherwise: `devel` branch
5. Create **one pull request per feature/bug fix**.
6. Make sure there are **only relevant changes** included in your PR. No
changes to unrelated files, no additional files that don't belong (e.g.
commits of your full virtual environment). Make sure your PR consists
**ideally of only one commit** (use git's rebase and squash functionality).
5. Make sure you **follow the current coding style**. This means:
7. Make sure you **follow the current coding style**. This means:
* Tabs instead of spaces in the Python files[2]
* Spaces instead of tabs in the Javascript sources
* Spaces instead of tabs in the JavaScript sources
* English language (code, variables, comments, ...)
* Comments where necessary: Tell *why* the code does something like it does
it, structure your code
@@ -260,22 +331,32 @@ See [How to open the Javascript Console in different browsers](https://webmaster
``.less`` files from which the CSS is compiled.
* Make sure you do not add dead code (e.g. commented out left-overs
from experiments).
6. Ensure your changes **pass the existing unit tests**. PRs that break
those cannot be accepted.
7. **Test your changes thoroughly**. That also means testing with usage
8. Ensure your changes **pass the existing unit tests**. PRs that break
those cannot be accepted. You can run the unit tests locally (after
[initial development environment setup with "develop" dependencies](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment))
by running
```
nosetests --with-doctest
```
in the OctoPrint checkout folder. A [travis build](https://travis-ci.org/foosel/OctoPrint)
is also setup so that if the tests should fail, your PR will be marked
accordingly.
9. **Test your changes thoroughly**. That also means testing with usage
scenarios you don't normally use, e.g. if you only use access control, test
without and vice versa. If you only test with your printer, test with the
virtual printer and vice versa. State in your pull request how your tested
your changes. Ideally **add unit tests** - OctoPrint severly lacks in that
virtual printer and vice versa. State in your pull request how you tested
your changes. Ideally **add unit tests** - OctoPrint severely lacks in that
department, but we are trying to change that, so any new code already covered
with a test suite helps a lot!
8. In your pull request's description, **state what your pull request does**,
as in, what feature does it implement, what bug does it fix. The more
thoroughly you explain your intent behind the PR here, the higher the
chances it will get merged fast. There is a template provided below
that can help you here.
9. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
file** :)
10. In your pull request's description, **state what your pull request does**,
as in, what feature does it implement, what bug does it fix. The more
thoroughly you explain your intent behind the PR here, the higher the
chances it will get merged fast. There is a template provided below
that can help you here.
11. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
file** :)
Template to use for Pull Request descriptions:
@@ -299,17 +380,17 @@ There are three main branches in OctoPrint:
* `master`: The master branch always contains the current stable release. It
is *only* updated on new releases. Will have a version number following
the scheme `x.y.z` (e.g. `1.2.9`) or - if it's absolutely necessary to
add a commit after release to this branch - `x.y.z.post<commits since x.y.z>`
the scheme `<x>.<y>.<z>` (e.g. `1.2.9`) or - if it's absolutely necessary to
add a commit after release to this branch - `<x>.<y>.<z>.post<commits since x.y.z>`
(e.g. `1.2.9.post1`).
* `maintenance`: Improvements and fixes of the current release that make up
the next release go here. More or less continously updated. You can consider
the next release go here. More or less continuously updated. You can consider
this a preview of the next release version. It should be very stable at all
times. Anything you spot in here helps tremendously with getting a rock solid
next stable release, so if you want to help out development, running the
`maintenance` branch and reporting back anything you find is a very good way
to do that. Will usually have a version number following the scheme
`x.y.z+1.dev.<commits since increase of z>` for an OctoPrint version of `x.y.z`
`<x>.<y>.<z+1>.dev<commits since increase of z>` for an OctoPrint version of `<x>.<y>.<z>`
(e.g. `1.2.10.dev12`).
* `devel`: Ongoing development of new features that will go into the next bigger
release (MINOR version number increases) will happen on this branch. Usually
@@ -317,8 +398,22 @@ There are three main branches in OctoPrint:
temporarily. Can be considered the "bleeding edge". All PRs should target
*this* branch. Important improvements and fixes from PRs here are backported to
`maintenance` as needed. Will usually have a version number following the
scheme `x.y+1.0.dev<commits since increase of y>` for an OctoPrint version
of `x.y.z` (e.g. `1.3.0.dev123`).
scheme `<x>.<y+1>.0.dev<commits since increase of y>` for a current OctoPrint version
of `<x>.<y>.<z>` (e.g. `1.3.0.dev123`).
* `rc/maintenance`: This branch is reserved for future releases that have graduated from
the `maintenance` branch and are now being pushed on the "Maintenance"
pre release channel for further testing. Version number follows the scheme
`<x>.<y>.<z>rc<n>` (e.g. `1.2.9rc1`).
* `staging/maintenance`: Any preparation for potential follow-up RCs takes place here.
Version number follows the scheme `<x>.<y>.<z>rc<n+1>.dev<commits since increase of n>` (e.g.
`1.2.9rc1.dev3`) for a current Maintenance RC of `<x>.<y>.<z>rc<n>`.
* `rc/devel`: This branch is reserved for future releases that have graduated from
the `devel` branch and are now being pushed on the "Devel" pre release channel
for further testing. Version number follows the scheme `<x>.<y+1>.0rc<n>` (e.g. `1.3.0rc1`)
for a current stable OctoPrint version of `<x>.<y>.<z>`.
* `staging/devel`: Any preparation for potential follow-up Devel RCs takes place
here. Version number follows the scheme `<x>.<y>.0rc<n+1>.dev<commits since increase of n>` (e.g.
`1.3.0rc1.dev12`) for a current Devel RC of `<x>.<y>.0rc<n>`.
Additionally, from time to time you might see other branches pop up in the repository.
Those usually have one of the following prefixes:
@@ -330,7 +425,7 @@ Those usually have one of the following prefixes:
* `dev/...` or `feature/...`: New functionality under development that is to be merged
into the `devel` branch.
There is also the `gh-pages` branch, which holds OctoPrint's web page, and a couple of
There is also the `gh-pages` branch, which holds OctoPrint's web page, and a few
older development branches that are slowly being migrated or deleted.
## How OctoPrint is versioned
@@ -367,6 +462,21 @@ the local version identifier to allow for an exact determination of the active c
* 2016-02-16: Added requirement to add information from template to existing
tickets as well, explained issue with "me too" red herrings.
* 2016-03-14: Some more requirements for PRs, and a PR template.
* 2016-06-08: New `prerelease` and `rc` branches explained.
* 2016-09-09: New `rc/*` branches explained.
* 2016-09-23: Some more work on "How to file a bug report" based on recent
experiences
* 2017-01-25: Fixed a typo
* 2017-03-09: Allow PRs against `maintenance` branch for bugs in stable.
* 2017-03-10: Reproduce bugs in safe mode to make sure they are really caused
by OctoPrint itself and not a misbehaving plugin.
* 2017-03-27: Added safe mode section to ticket template.
* 2017-11-22: Added note on how to run the unit tests
* 2018-03-15: Link to new community forum and some clarifications re bug
reporting
* 2018-03-29: "Where to find version numbers" is now located on the FAQ
* 2018-10-18: Allow PRs against `maintenance` branch for improvements and small
new features, suggest getting in touch on the forum for larger changes
## Footnotes
* [1] - If you are wondering why, the problem is that anything that you add
OctoPrint provides a snappy web interface for controlling consumer 3D printers. It is Free Software
and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html).
Its website can be found at [octoprint.org](http://octoprint.org).
Its website can be found at [octoprint.org](https://octoprint.org/?utm_source=github&utm_medium=readme).
The community forum is available at [community.octoprint.org](https://community.octoprint.org/?utm_source=github&utm_medium=readme). It also serves as central knowledge base.
An invite to the Discord server can be found at [discord.octoprint.org](https://discord.octoprint.org).
The FAQ can be accessed by following [faq.octoprint.org](https://faq.octoprint.org/?utm_source=github&utm_medium=readme).
The documentation is located at [docs.octoprint.org](http://docs.octoprint.org).
The official plugin repository can be reached at [plugins.octoprint.org](http://plugins.octoprint.org).
The official plugin repository can be reached at [plugins.octoprint.org](https://plugins.octoprint.org/?utm_source=github&utm_medium=readme).
**OctoPrint's development wouldn't be possible without the [financial support by its community](https://octoprint.org/support-octoprint/?utm_source=github&utm_medium=readme).
If you enjoy OctoPrint, please consider becoming a regular supporter!**

You are currently looking at the source code repository of OctoPrint. If you already installed it
(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only
want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki)
might be of more interest for you. You might also want to subscribe to [the mailing list](https://groups.google.com/group/octoprint)
or the [G+ Community](https://plus.google.com/communities/102771308349328485741) where there are other active users who might be
want to find out how to use it, [the documentation](http://docs.octoprint.org/) might be of more interest for you. You might also want to subscribe to join
[the community forum at community.octoprint.org](https://community.octoprint.org) where there are other active users who might be
able to help you with any questions you might have.
Contributing
------------
## Contributing
Contributions of all kinds are welcome, not only in the form of code but also with regards to the
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), support
of other users in the [bug tracker](https://github.com/foosel/OctoPrint/issues),
[the Mailinglist](https://groups.google.com/group/octoprint) or
2. Change into the OctoPrint folder: `cd OctoPrint`
3. Create a user-owned virtual environment therein: `virtualenv venv`
4. Install OctoPrint *into that virtual environment*: `./venv/bin/python setup.py install`
4. Install OctoPrint *into that virtual environment*: `./venv/bin/pip install .`
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
for details.
After installation, please make sure you follow the first-run wizard and set up
access control as necessary. If you want to not only be notified about new
releases but also be able to automatically upgrade to them from within
OctoPrint, take a look [at the documentation of the Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#making-octoprint-updateable-on-existing-installations)
and at its settings.
access control as necessary.
Dependencies
------------
## Dependencies
OctoPrint depends on a couple of python modules to do its job. Those are automatically installed when installing
OctoPrint via `setup.py`:
OctoPrint depends on a few python modules to do its job. Those are automatically installed when installing
OctoPrint via `pip`.
python setup.py install
OctoPrint currently supports Python 2.7, 3.6 and 3.7.
You should also do this every time after pulling from the repository, since the dependencies might have changed.
## Usage
OctoPrint currently only supports Python 2.7.
Running the pip install via
Usage
-----
Running the `setup.py` script via
python setup.py install
pip install OctoPrint
installs the `octoprint` script in your Python installation's scripts folder
(which depending on whether you installed OctoPrint globally or into a virtual env will be on your `PATH` or not). The
following usage examples assume that said`octoprint` script is on your `PATH`.
(which, depending on whether you installed OctoPrint globally or into a virtual env, will be in your `PATH` or not). The
following usage examples assume that the`octoprint` script is on your `PATH`.
You can start the server via
octoprint
octoprint serve
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 the server
to only listen on the local interface on port 8080, the command line would be
octoprint --host=127.0.0.1 --port=8080
octoprint serve --host=127.0.0.1 --port=8080
Alternatively, the host and port on which to bind can be defined via the configuration.
Alternatively, the host and port on which to bind can be defined via the config file.
If you want to run OctoPrint as a daemon (only supported on Linux), use
Development of this version of OctoPrint wouldn't have been possible without
[the financial support by the community](https://support.octoprint.org) -
thanks to everyone who contributed!
## Patrons & Sponsors
* Andrew Moorby
* Arnljot Arntsen
* Ash King
* BigTreeTech
* Boris Hussein
* Brad Jackson
* Christian Petropolis
* Christian Wolf
* D Brian Kimmel
* DeltaMaker 3D Printers
* Dennis Breining
* Eric Betts
* Ernesto Martinez
* Franziska Kunsmann
* GadgetAngel
* George Robles
* Greg Holloway
* Hog Duske
* Hugh Blemings
* jean-claude migneault
* Jeremy Cole
* Joe Pasqua
* John Robinson
* Joshua Wills
* Justin Kaufman
* Kaile Riser
* Kale Stedman
* Kazuhiro Ogura
* Kelly C McNiece
* Kenneth Jiang
* Kurt Wubbels
* Kyle Menigoz
* LA 3D Printer Repair
* Lee Dohm
* Makespace Madrid
* Mark Walker
* Marvin Nahmias
* Michael Aumock
* Miles Flavel
* Mosaic Manufacturing
* Neil R. Goldberg
* Patrick Glyré
* Patrick McGinnis
* Prof Yuh Wen Chen
* Raise3D
* Randy C. Will
* Ranjib Dey
* Richard Michaud
* Rigid3D
* Robert Gusek
* Ronald Griehsler
* Sacha Telgenhof
* Sebastien Andrivet
* Stefan Krister
* Steve Thompson
* Stewart Danos
* Sven Mueller
* Ulrich Kempken
and 1932 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
This part of the API is still heavily in development, especially anything that has to do with temperature control.
If you happen to want to develop against it, you should drop me an email to make sure I can give you a heads-up when
something changes.
..contents::
Printer control is mostly achieved through the use of commands, issued to resources reflecting components of the
@@ -28,6 +22,11 @@ Bed
corresponding resource returns temperature information including an optional history. Note that Bed commands
are only available if the currently selected printer profile has a heated bed.
See :ref:`sec-api-printer-bedcommand`.
Chamber
Chamber commands allow setting the temperature and temperature offset for the printer's heated chamber. Querying
the corresponding resource returns temperature information including an option history. Note that Chamber commands
are only available if the currently selected printer profile has a heated chamber.
See :ref:`sec-api-printer-chambercommand`.
SD card
SD commands allow initialization, refresh and release of the printer's SD card (if available). Querying the
corresponding resource returns the current SD card state.
@@ -35,6 +34,29 @@ SD card
Besides that, OctoPrint also provides a :ref:`full state report of the printer <sec-api-printer-state>`.
..note::
You might be wondering why all command responses below only return a ``204`` with an empty body instead of
the output of the just sent commands. There are two reasons for this.
OctoPrint's internal webserver is single threaded and can only handle one request at a time. This is
not a problem generally since asynchronous programming allows to just have one request which is waiting for
data from a long running backend operation to sleep while handling other requests. The internal framework
used for providing the REST API though, Flask, is based on WSGI, which is synchronous in nature. This means
that it is impossible to wait in a non blocking wait while handling a request on the REST API. So in order to
return the response of a command sent to the printer, the single thread of the webserver would have to be blocked
by the API while the response wasn't available yet. Which in turn would mean that the whole web server would
stop responding while waiting for the printer to reply, which, depending on the command in question (e.g. homing)
can take a long while. That would be a bad idea.
The second reason is that thanks to a large number of firmwares out there having a `particular bug <https://github.com/MarlinFirmware/Marlin/commit/acc0e7527914948656ccabba35f7faedc94ef885>`_
that makes it impossible to track the output of sent commands, identifying the correct response to a given
sent command is pretty much hit-and-miss. That situation gets even worse considering that it's next to impossible
to distinguish firmware versions which have that bug from firmware versions which don't have it.
Hence OctoPrint currently doesn't offer any synchronous way of retrieving the output of responses from the printer.
If you need the printer's serial communication, you'll need to subscribe to :ref:`push updates <sec-api-push>`.
.._sec-api-printer-state:
Retrieve the current printer state
@@ -58,6 +80,8 @@ Retrieve the current printer state
Returns a :http:statuscode:`200` with a :ref:`Full State Response <sec-api-printer-datamodel-fullstate>` in the
body upon success.
Requires the ``STATUS`` permission.
**Example 1**
Include temperature history data, but limit it to two entries.
@@ -132,6 +156,8 @@ Retrieve the current printer state
"operational": true,
"paused": false,
"printing": false,
"cancelling": false,
"pausing": false,
"sdReady": true,
"error": false,
"ready": true,
@@ -162,6 +188,8 @@ Retrieve the current printer state
"operational": true,
"paused": false,
"printing": false,
"cancelling": false,
"pausing": false,
"sdReady": true,
"error": false,
"ready": true,
@@ -191,9 +219,14 @@ Issue a print head command
jog
Jogs the print head (relatively) by a defined amount in one or more axes. Additional parameters are:
*``x``: Optional. Amount to jog print head on x axis, must be a valid number corresponding to the distance to travel in mm.
*``y``: Optional. Amount to jog print head on y axis, must be a valid number corresponding to the distance to travel in mm.
*``z``: Optional. Amount to jog print head on z axis, must be a valid number corresponding to the distance to travel in mm.
*``x``: Optional. Amount/coordinate to jog print head on x axis, must be a valid number corresponding to the distance to travel in mm.
*``y``: Optional. Amount/coordinate to jog print head on y axis, must be a valid number corresponding to the distance to travel in mm.
*``z``: Optional. Amount/coordinate to jog print head on z axis, must be a valid number corresponding to the distance to travel in mm.
*``absolute``: Optional. Boolean value specifying whether to move relative to current position (provided
axes values are relative amounts) or to absolute position (provided axes values are coordinates)
*``speed``: Optional. Speed at which to move. If not provided, minimum speed for all selected axes from printer
profile will be used. If provided but ``false``, no speed parameter will be appended to the command. Otherwise
interpreted as an integer signifying the speed in mm/min, to append to the command.
home
Homes the print head in all of the given axes. Additional parameters are:
@@ -201,15 +234,17 @@ Issue a print head command
*``axes``: A list of axes which to home, valid values are one or more of ``x``, ``y``, ``z``.
feedrate
Changes the feedrate factor to apply to the movement's of the axes.
Changes the feedrate factor to apply to the movements of the axes.
*``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 50 and 200%.
*``factor``: The new factor, percentage between 50 and 200% as integer (``50`` to ``200``) or float (``0.5`` to ``2.0``).
All of these commands except ``feedrate`` may only be sent if the printer is currently operational and not printing.
Otherwise a :http:statuscode:`409` is returned.
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
Requires the ``CONTROL`` permission.
**Example Jog Request**
Jog the print head by 10mm in X, -5mm in Y and 0.02mm in Z.
@@ -252,9 +287,9 @@ Issue a print head command
HTTP/1.1204No Content
**Example feed rate request**
**Example feed rate request (1/2)**
Set the feed rate factor to 105%.
Set the feed rate factor to 105% using an integer argument.
..sourcecode::http
@@ -272,6 +307,26 @@ Issue a print head command
HTTP/1.1204No Content
**Example feed rate request (2/2)**
Set the feed rate factor to 105% using a float argument.
..sourcecode::http
POST/api/printer/printheadHTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "feedrate",
"factor": 1.05
}
..sourcecode::http
HTTP/1.1204No Content
:json string command:The command to issue, either ``jog`` or ``home``.
:json number x:``jog`` command: The amount to travel on the X axis in mm.
:json number y:``jog`` command: The amount to travel on the Y axis in mm.
@@ -297,7 +352,7 @@ Issue a tool command
Sets the given target temperature on the printer's tools. Additional parameters:
*``targets``: Target temperature(s) to set, properties must match the format ``tool{n}`` with ``n`` being the
tool's index starting with 0.
tool's index starting with 0. A value of `0` will turn the heater off.
offset
Sets the given temperature offset on the printer's tools. Additional parameters:
@@ -314,17 +369,21 @@ Issue a tool command
Extrudes the given amount of filament from the currently selected tool. Additional parameters:
*``amount``: The amount of filament to extrude in mm. May be negative to retract.
*``speed``: Optional. Speed at which to extrude. If not provided, maximum speed for E axis from printer
profile will be used. Otherwise interpreted as an integer signifying the speed in mm/min, to append to the command.
flowrate
Changes the flow rate factor to apply to extrusion of the tool.
*``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 75 and 125%.
*``factor``: The new factor, percentage between 75 and 125% as integer (``75`` to ``125``) or float (``0.75`` to ``1.25``).
All of these commands may only be sent if the printer is currently operational and -- in case of ``select`` and
``extrude`` -- not printing. Otherwise a :http:statuscode:`409` is returned.
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
Requires the ``CONTROL`` permission.
**Example Target Temperature Request**
Set the target temperature for the printer's first hotend to 220°C and the printer's second extruder to 205°C.
@@ -431,9 +490,9 @@ Issue a tool command
HTTP/1.1204No Content
**Example flow rate request**
**Example flow rate request (1/2)**
Set the flow rate factor to 95%.
Set the flow rate factor to 95% using an integer attribute.
..sourcecode::http
@@ -451,6 +510,26 @@ Issue a tool command
HTTP/1.1204No Content
**Example flow rate request (2/2)**
Set the flow rate factor to 95% using a float attribute.
..sourcecode::http
POST/api/printer/toolHTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "flowrate",
"factor": 0.95
}
..sourcecode::http
HTTP/1.1204No Content
:json string command:The command to issue, either ``target``, ``offset``, ``select`` or ``extrude``.
:json object targets:``target`` command: The target temperatures to set. Valid properties have to match the format ``tool{n}``.
:json object offsets:``offset`` command: The offset temperature to set. Valid properties have to match the format ``tool{n}``.
@@ -478,6 +557,8 @@ Retrieve the current tool state
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
Requires the ``STATUS`` permission.
..note::
If you want both tool and bed temperature information at the same time, take a look at
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
@@ -551,12 +632,12 @@ Issue a bed command
are:
target
Sets the given target temperature on the printer's tools. Additional parameters:
Sets the given target temperature on the printer's bed. Additional parameters:
*``target``: Target temperature to set.
*``target``: Target temperature to set. A value of `0` will turn the heater off.
offset
Sets the given temperature offset on the printer's tools. Additional parameters:
Sets the given temperature offset on the printer's bed. Additional parameters:
*``offset``: Offset to set.
@@ -568,6 +649,8 @@ Issue a bed command
If no heated bed is configured for the currently selected printer profile, the resource will return
an :http:statuscode:`409`.
Requires the ``CONTROL`` permission.
**Example Target Temperature Request**
Set the target temperature for the printer's heated bed to 75°C.
@@ -635,8 +718,10 @@ Retrieve the current bed state
If no heated bed is configured for the currently selected printer profile, the resource will return
an :http:statuscode:`409`.
Requires the ``STATUS`` permission.
..note::
If you want both tool and bed temperature information at the same time, take a look at
If you want tool, bed and chamber temperature information at the same time, take a look at
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
**Example**
@@ -686,6 +771,156 @@ Retrieve the current bed state
:statuscode 409:If the printer is not operational or the selected printer profile
does not have a heated bed.
.._sec-api-printer-chambercommand:
Issue a chamber command
=======================
..http:post:: /api/printer/chamber
Chamber commands allow setting the temperature and temperature offsets for the printer's heated chamber. Available commands
are:
target
Sets the given target temperature on the printer's chamber. Additional parameters:
*``target``: Target temperature to set. A value of `0` will turn the heater off.
offset
Sets the given temperature offset on the printer's chamber. Additional parameters:
*``offset``: Offset to set.
All of these commands may only be sent if the printer is currently operational. Otherwise a :http:statuscode:`409`
is returned.
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
If no heated chamber is configured for the currently selected printer profile, the resource will return
an :http:statuscode:`409`.
Requires the ``CONTROL`` permission.
**Example Target Temperature Request**
Set the target temperature for the printer's heated chamber to 50°C.
..sourcecode::http
POST/api/printer/chamberHTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "target",
"target": 50
}
..sourcecode::http
HTTP/1.1204No Content
**Example Offset Temperature Request**
Set the temperature offset for the heated chamber to -5°C.
..sourcecode::http
POST/api/printer/chamberHTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "offset",
"offset": -5
}
..sourcecode::http
HTTP/1.1204No Content
:json string command:The command to issue, either ``target`` or ``offset``.
:json object target:``target`` command: The target temperature to set.
:json object offset:``offset`` command: The offset temperature to set.
:statuscode 204:No error
:statuscode 400:If ``target`` or ``offset`` is not a valid number or outside of the supported range, or if the
request is otherwise invalid.
:statuscode 409:If the printer is not operational or the selected printer profile
does not have a heated chamber.
.._sec-api-printer-chamberstate:
Retrieve the current chamber state
==================================
..http:get:: /api/printer/chamber
Retrieves the current temperature data (actual, target and offset) plus optionally a (limited) history (actual, target,
timestamp) for the printer's heated chamber.
It's also possible to retrieve the temperature history by supplying the ``history`` query parameter set to ``true``. The
amount of returned history data points can be limited using the ``limit`` query parameter.
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
If no heated chamber is configured for the currently selected printer profile, the resource will return
an :http:statuscode:`409`.
Requires the ``STATUS`` permission.
..note::
If you want tool, bed and chamber temperature information at the same time, take a look at
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
**Example**
Query the chamber temperature data and also include the temperature history but limit it to two entries.
All system operations require the ``SYSTEM`` permission.
.._sec-api-system-command-list:
List all registered system commands
===================================
..http:get:: /api/system/commands
Retrieves all configured system commands.
A :http:statuscode:`200` with a :ref:`List all response <sec-api-system-commands-listall>`
will be returned.
Requires the ``SYSTEM`` permission.
**Example**
..sourcecode::http
GET/api/system/commands/coreHTTP/1.1
Host: example.com
X-Api-Key: abcdef...
..sourcecode::http
HTTP/1.1200Ok
Content-Type: application/json
{
"core": [
{
"action": "shutdown",
"name": "Shutdown",
"confirm": "<strong>You are about to shutdown the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<strong>You are about to reboot the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<strong>You are about to restart the OctoPrint server.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
Retrieves the configured system commands for the specified source.
The response will contain a list of :ref:`command definitions <sec-api-system-commands-definiton>`.
**Example**
..sourcecode::http
GET/api/system/commands/coreHTTP/1.1
Host: example.com
X-Api-Key: abcdef...
..sourcecode::http
HTTP/1.1200Ok
Content-Type: application/json
[
{
"action": "shutdown",
"name": "Shutdown",
"confirm": "<strong>You are about to shutdown the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<strong>You are about to reboot the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
"confirm": "<strong>You are about to restart the OctoPrint server.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
OctoPi versions 0.12.0 and later already come with pybonjour installed and ready to go,
you don't need to perform these steps there.
..note::
Currently there are no releases for pybonjour available on the Python Package Index PyPI. The latest pybonjour
release is still available in the `Google Code Archive <https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pybonjour/pybonjour-1.1.1.tar.gz>`_.
Since that URL is hilariously long though, a shortened version is provided with https://goo.gl/SxQZ06 and
used in the installation instructions below.
In order for the Zeroconf discovery to work, the
`pybonjour package <https://pypi.python.org/pypi/pybonjour>`_ needs to be available
to the Python installation running OctoPrint.
It can be installed via ``pip``. Let's assume you installed OctoPrint manually
into some folder ``~/OctoPrint``. You executed ``python setup.py install`` within a
virtualenv in the same folder called ``venv``. In order to install ``pybonjour``
so it will be available to OctoPrint you'll need to do the following::
venv/bin/pip install https://goo.gl/SxQZ06
**Linux users:** You'll need to install an additional dependency for this to work, the
libdnssd compatibility layer for libavahi. On Debian/Ubuntu that can be achieved with::
sudo apt-get install libavahi-compat-libdnssd-dev
.._sec-bundledplugins-discovery-configuration:
Configuring the plugin
----------------------
The plugin supports the following configuration keys:
*``publicPort``: Public port number OctoPrint is reachable under,
optional, if not set the port OctoPrint itself was started under will be used
*``pathPrefix``: Path prefix OctoPrint is running under, optional, if not
set ``/`` will be used
*``useSsl``: ``true`` if OctoPrint should be called via HTTPS, ``false`` otherwise
*``httpUsername``: HTTP Basic Auth username OctoPrint is reachable with, optional
*``httpPassword``: HTTP Basic Auth password OctoPrint is reachable with, optional
*``upnpUuid``: uPNP UUID used for SSDP service announcements, usually you will
not have to touch this, will be autogenerated if not set
*``zeroConf``: A list of additional services to announce via ZeroConf, optional,
see below.
*``model``:
*``name``: Name of the device model OctoPrint is running on, optional
*``description``: Description of the device model OctoPrint is running on,
optional, used only for SSDP
*``number``: Model number of the device OctoPrint is running on, optional,
used only for SSDP
*``url``: URL with further details about the device OctoPrint is running on,
optional, used only for SSDP
*``serial``: Serial number of the device OctoPrint is running on, optional,
used only for SSDP
*``vendor``: Vendor of the device OctoPrint is running on, optional
*``vendorUrl``: URL with further details about the vendor of the device
OctoPrint is running on, optional, used only for SSDP
***OctoPrint version tracking**: Whether you want to track OctoPrint *releases* or every *commit*. Usually you want to
select "Release" here which is also the default, unless you are a developer.
***OctoPrint Release Channel** (if tracking releases): The release channel of OctoPrint to track for updates. If you only want stable versions,
select "Stable" here which is also the default. "Maintenance RCs" will also allow you to update to maintenance release
candidates, "Devel RCs" will also allow you to update to development release candidates. If in doubt, leave it at
"Stable". `Read more about Release Channels here <https://community.octoprint.org/t/how-to-use-the-release-channels-to-help-test-release-candidates/402>`_.
***OctoPrint checkout folder** (if tracking git commits): This must be the path to OctoPrint's git checkout folder
(``/home/pi/OctoPrint`` for OctoPi or `manual installs following the Raspberry Pi setup guide <https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspbian/2337/>`_).
Note that since OctoPrint 1.3.6 you will no longer need to set this to be able to update to releases, only if you
want to be able to update against some bleeding edge git branch.
***Version cache TTL**: The "time to live" of the cache OctoPrint will use to temporarily persist the version information
for the various components registered with the plugin, so that they don't have to be queried from the internet every time
you load the page. Defaults to 24h, you usually shouldn't need to change that value.
More settings are available by :ref:`editing the corresponding section in config.yaml <sec-bundledplugins-softwareupdate-configuration>`.
That restart commands for OctoPrint and the whole server can be configured under Settings > Server.
.._sec-bundledplugins-softwareupdate-cli:
Command line usage
------------------
The functionality of the Software Update Plugin is also available on OctoPrint's command line interface under the
``plugins`` sub command. It's possible to check for updates via ``octoprint plugins softwareupdate:check``
and to apply available updates via ``octoprint plugins softwareupdate:update``. Please see the corresponding
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's Community Forum <https://community.octoprint.org/t/setting-up-octoprint-on-macos/13425>`_.
Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks.
..todo::
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
location, please substitute accordingly.
You'll need a user account with administrator privileges.
* Install the latest version of Xcode suitable for your OS. For example, OS X 10.11 (El Capitan) requires Xcode 7.
* Install Xcode's command line tools:
*``xcode-select --install``
*``sudo xcodebuild`` (ensure the license was accepted)
* If you have more than one Xcode installed: ``sudo xcode-select -s /Applications/Xcode.app/Contents/Developer``
* Install Homebrew and use that to install Python:
OctoPrint includes, by default, a :ref:`virtual printer plugin <sec-bundledplugins-virtual_printer>`. This plugin allows you to debug OctoPrint's serial
communication without connecting to an actual printer. Furthermore, it is possible to create certain edge conditions
that may be hard to reproduce with a real printer.
.._sec-development-virtual-printer-enable:
Enabling the virtual printer
----------------------------
The virtual printer can be enabled through its Settings pane.
.._sec-development-virtual-printer-config:
Virtual printer configuration options
-------------------------------------
There many configuration options via ``config.yaml`` for the virtual printer that allow you to fine-tune its behavior:
..code-block::yaml
plugins:
# Settings for the virtual printer
virtual_printer:
# Whether to enable the virtual printer and include it in the list of available serial connections.
# Defaults to false.
enabled:true
# Whether to send an additional "ok" after a resend request (like Repetier)
okAfterResend:false
# Whether to force checksums and line number in the communication (like Repetier), if set to true
# printer will only accept commands that come with linenumber and checksum and throw an error for
# lines that don't. Defaults to false
forceChecksum:false
# Whether to send "ok" responses with the line number that gets acknowledged by the "ok". Defaults
# to false.
okWithLinenumber:false
# Number of extruders to simulate on the virtual printer. Map from tool id (0, 1, ...) to temperature
# in °C
numExtruders:1
# Allows pinning certain hotends to a fixed temperature
pinnedExtruders:null
# Whether to include the current tool temperature in the M105 output as separate T segment or not.
#
# True: > M105
# < ok T:23.5/0.0 T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
# False: > M105
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
includeCurrentToolInTemps:true
# Whether to include the selected filename in the M23 File opened response.
#
# True: > M23 filename.gcode
# < File opened: filename.gcode Size: 27
# False: > M23 filename.gcode
# > File opened
includeFilenameInOpened:true
# Whether the simulated printer should also simulate a heated bed or not
hasBed:true
# Whether the simulated printer should also simulate a heated chamber or not
hasChamber:false
# If enabled, reports the set target temperatures as separate messages from the firmware
#
# True: > M109 S220.0
# < TargetExtr0:220.0
# < ok
# > M105
# < ok T0:34.3 T1:23.5 B:43.2
# False: > M109 S220.0
# < ok
# > M105
# < ok T0:34.3/220.0 T1:23.5/0.0 B:43.2/0.0
repetierStyleTargetTemperature:false
# If enabled, uses repetier style resends, sending multiple resends for the same line
# to make sure nothing gets lost on the line
repetierStyleResends:false
# If enabled, ok will be sent before a commands output, otherwise after or inline (M105)
#
# True: > M20
# < ok
# < Begin file list
# < End file list
# False: > M20
# < Begin file list
# < End file list
# < ok
okBeforeCommandOutput:false
# If enabled, reports the first extruder in M105 responses as T instead of T0
#
# True: > M105
# < ok T:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
# False: > M105
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
smoothieTemperatureReporting:false
# Whether M20 responses will include filesize or not
#
# True: <filename> <filesize in bytes>
# False: <filename>
extendedSdFileList:false
# Forced pause for retrieving from the outgoing buffer
throttle:0.01
# Whether to send "wait" responses every "waitInterval" seconds when serial rx buffer is empty
sendWait:false
# Interval in which to send "wait" lines when rx buffer is empty
waitInterval:1
# Size of the simulated RX buffer in bytes, when it's full a send from OctoPrint's
# side will block
rxBuffer:64
# Size of simulated command buffer, number of commands. If full, buffered commands will block
# until a slot frees up
commandBuffer:4
# Whether to support the M112 command with simulated kill
supportM112:true
# Whether to send messages received via M117 back as "echo:" lines
echoOnM117:true
# Whether to simulate broken M29 behaviour (missing ok after response)
brokenM29:true
# Whether F is supported as individual command
supportF:false
# Firmware name to report (useful for testing firmware detection)
firmwareName:Virtual Marlin 1.0
# Simulate a shared nozzle
sharedNozzle:false
# Send "busy" messages if busy processing something
sendBusy:false
# Simulate a reset on connect
simulateReset:true
# Lines to send on simulated reset
resetLines:
- start
- "Marlin: Virtual Marlin!"
- "SD card ok"
# Initial set of prepared oks to use instead of regular ok (e.g. to simulate
# mis-sent oks). Can also be filled at runtime via the debug command prepare_ok
preparedOks:[]
# Format string for ok response.
#
# Placeholders:
# - lastN: last acknowledged line number
# - buffer: empty slots in internal command buffer
#
# Example format string for "extended" ok format:
# ok N{lastN} P{buffer}
okFormatString:ok
# Format string for M115 output.
#
# Placeholders:
# - firmare_name: The firmware name as defined in firmwareName
@@ -21,16 +21,35 @@ Action commands are a feature defined for the GCODE based RepRap communication p
OctoPrint out of the box supports handling of the above mentioned commands:
cancel
When this command is received from the printer, OctoPrint will cancel a current print job like if the
"Cancel" button had been clicked.
pause
When this command is received from the printer, OctoPrint will pause streaming of a current print job just like if the
When this command is received from the printer, OctoPrint will pause a current print job just like if the
"Pause" button had been clicked.
paused
When this command is received from the printer, OctoPrint will pause a current print job but *without* triggering
any GCODE scripts or sending SD print control commands to the printer. This might be interesting for firmware
that wants to signal to OctoPrint that a print should be paused but without any control interference from
OctoPrint, e.g. in case of a filament change fully managed by the firmware.
resume
When this command is received from the printer, OctoPrint will resume streaming of a current print job just like if
When this command is received from the printer, OctoPrint will resume a current print job just like if
the "Resume" button had been clicked.
resumed
When this command is received from the printer, OctoPrint will resume a current print job but *without* triggering
any GCODE scripts or sending SD print control commands to the printer. This might be interesting for firmware
that wants to signal to OctoPrint that a print should be resumed but without any control interference from
OctoPrint, e.g. in case of a filament change fully managed by the firmware.
disconnect
When this command is Received from the printer, OctoPrint will immediately disconnect from it.
When this command is received from the printer, OctoPrint will immediately disconnect from it.
If the bundled :ref:`Action Command Prompt Support Plugin <sec-bundledplugins-action_command_prompt>` is enabled (which
should be the case by default), OctoPrint will also interactive dialog creation through its :ref:`supported commands <sec-bundledplugins-action_command_prompt-action_commands>`.
Support for additional commands may be added by plugins by implementing a handler for the
Loaded 100 of 730 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.