A OctoPrint-Plugin that sends the current progress of a print via M117 command to the printer-display and also to the top navigation bar.
This plugin, as well as my other plugins were developed in my spare time. If you like it, I would be thankful about a cup of coffee :)
It shows:
Progress, M73Progress, EstimatedEndTime, PrintTimeLeft,
CurrentLayer, TotalLayerCount, last/average LayerDuration,
CurrentHeight, TotalHeight, Feedrate, Fanspeed,
ChangeFilamentTimeLeft, EstimatedChangeFilamentTime and ChangefilamentCount (based on M600 command location in file)
Printer State
Currently printed filename
Some output examples:
- Printer Display:
50% L=60/120 H=23mm/47mm
- NavBar: Layer:
60 / 120 Height: 23mm of 47mm
- Browser TabTitle:
12% 19:32 o'clock
Output pattern is adjustable!
ATTENTION:
- The layer information works only when the slicer adds "layer-indicator" as comments to the G-Code (CURA-Example as comments like
;LAYER:10
). Then these indicators are parsed via a regular-expression. - The G-Code is modified during upload (could be disabled since V1.19.0)! The "layer-indicators" from the slicer were replaced with a "neutral" M117 G-Code (
M117 INDICATOR-Layer
). This is necessary, because during printing OctoPrint removes all comments from g-code. - Out of the box supported slicers:
- CURA, Simplify3D, ideaMaker, KISSlicer, Slic3r
- You can add your own layer-expressions in Plugin-Settings
- If you are not able find a layer-expression, try to add a "post processiong script in your slicer" E.g. for "slic3r", see Enhancement #8
- Sometimes there is a "post processing script" that deletes all comments (e.g. see Issue #33)
- The total height "calculation" can be done in three ways:
1)the max Z-Value in the G-Code, 2) max Z-Value with extrusion in this height, 3) define a expression like this
;MAXZ:([0-9]+[.]*[0-9]*).*
to evaluate the max height Issue #82 - The height/layer information is sometimes not matching with G-Code Viewer, because the viewer did a lot of "magic" (e.g. add extrusion diameter to height)
Comment Format Examples:
CURA: ;LAYER:10
Simplify3D: ; layer 10, Z = 1.640
The implementation is based on four steps:
- PreProcessing the selected G-Code during upload (replace layer-comment with M117 indicator G-Code)
- Read total layer and height count from G-Code before start (used last layer-comment)
- G-Code-hook to collect the current layer information (M117-command from step 1)
- Progress-Hook to send all information to the printer/navbar/browserTitle
A more detailed technical description could be found in this wiki-page: How-does-the-plugin-works
If you receive a popup message: "Layer indicator not found in file!", then check Layer-Indicator comments in the layer-settings section against your g-code. If you adjust the layer expression, then you need to reupload your g-code file again.
Install via the bundled Plugin Manager or manually using this URL:
https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip
It is possible to change the Output. See Plugin-Settings:
see Release-Overview
You can receive the layer/height and other values via a GET-Call.
curl -H "X-Api-Key:57FECA453FE94D46851EFC94BC9B5265" http://localhost:5000/plugin/DisplayLayerProgress/values
{
"currentFilename": "AE10_xyzCalibration_cube.gcode",
"fanSpeed": "69%",
"feedrate": "3000",
"feedrateG0": "3000",
"feedrateG1": "953.8",
"height": {
"current": "8.00",
"currentFormatted": "8"
"total": "15.00",
"totalFormatted": "15",
"totalWithExtrusion": "10.0", //DEPRECATED don't use it will be removed in version 1.19.0
"totalWithExtrusionFormatted": "10" //DEPRECATED don't use it will be removed in version 1.19.0
},
"layer": {
"averageLayerDuration": "0h:01m:03s",
"averageLayerDurationInSeconds": 63,
"current": "39",
"lastLayerDuration": "0h:00m:58s",
"lastLayerDurationInSeconds": 58,
"total": "49"
},
"print": {
"printerState": "printing",
"progress": "73",
"m73progress": "86",
"timeLeft": "40s",
"timeLeftInSeconds": 40,
"estimatedEndTime": "20:24",
"changeFilamentCount": 3,
"changeFilamentTimeLeft": "32s",
"changeFilamentTimeLeftInSeconds": 32,
"estimatedChangedFilamentTime": "22:36",
}
}
Plugin sends the following custom events to the eventbus like this:
eventManager().fire(eventKey, eventPayload)
EventKey |
---|
DisplayLayerProgress_progressChanged |
DisplayLayerProgress_layerChanged |
DisplayLayerProgress_heightChanged |
DisplayLayerProgress_feedrateChanged |
DisplayLayerProgress_fanspeedChanged |
Payload
{
'updateReason', // values: frontEndCall, heightChanged, progressChanged, m73ProgressChanged, layerChanged, feedrateChanged, fanspeedChanged, printerStateChanged
'totalLayer':'66',
'currentLayer':'22',
'currentHeight':'6.80',
'currentHeightFormatted':'6',
'totalHeight':15
'totalHeightFormatted':'15',
'totalHeightWithExtrusion':'20.0', //DEPRECATED don't use it will be removed in version 1.19.0
'totalHeightWithExtrusionFormatted':'20', //DEPRECATED don't use it will be removed in next version 1.19.0
'feedrate':'2700',
'feedrateG0':'7200',
'feedrateG1':'2700',
'fanspeed':'100%',
'progress':'28',
'm73progress':'33',
'printerState':'printing',
'lastLayerDuration':'0h:00m:03s',
'lastLayerDurationInSeconds':3,
'averageLayerDuration':'0h:00m:02s',
'averageLayerDurationInSeconds':2,
'printTimeLeft':'2m3s',
'printTimeLeftInSeconds':123,
'estimatedEndTime':'20:24',
'estimatedChangedFilamentTime': '20:22',
'changeFilamentTimeLeft': '1m12s,
'changeFilamentTimeLeftInSeconds': 72,
'changeFilamentCount': 2,
'currentFilename': 'AE10_xyzCalibration_cube.gcode'
}
Other Plugins could listen to this events in there python-code like this:
eventmanager.subscribe("DisplayLayerProgress_layerChanged", self._myEventListener)
or use octoprint.plugin.EventHandlerPlugin
with something like this:
def on_event(self, event, payload):
if event == "DisplayLayerProgress_layerChanged":
## do something usefull
If enabled in the plugin-settings the above event-payload is also send via websocket to the client.
Other Plugins could listen to this events in there javascript-code like this:
self.onDataUpdaterPluginMessage = function (plugin, data) {
if (plugin == "DisplayLayerProgress-websocket-payload") {
// .. do somethig useful with the data
return;
}