Skip to content

Commit

Permalink
Added setting to enable SmartABL on unknown firmwares
Browse files Browse the repository at this point in the history
  • Loading branch information
scmanjarrez committed May 4, 2023
1 parent 99853c6 commit dba0df8
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 21 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ for the idea.
- Prusa (P)
- Prusa-buddy (B)
- Klipper (K)
- Custom*

> *: You can customize the gcode triggering ABL and the gcode sent to the printer
> in settings. Check the setting "Enable SmartABL on unknown firmware" to use not
> detected firmwares.
> Want your firmware to be compatible? Open an Issue on github so we can add it 🙂
>
Expand Down Expand Up @@ -71,9 +76,15 @@ Default: enabled.
- If current print hotend temperature is different from last print.
Default: enabled.

**Prints counter**
- Take into account failed prints in the counter.
**Extras**
- Take into account failed/stopped jobs in prints counter.
Default: disabled (only successful prints increase the counter).
- Enable SmartABL on unknown firmwares.
Default: disabled.
> You have to enable and configure <code>Trigger custom gcode(s)</code> and
> <code>ABL custom gcode(s)</code>. If you don't configure these two settings,
> SmartABL assumes marlin firmware by default (i.e. G29 read from file and
> G29 send to printer when ABL is needed)
<div align="center">
<img alt="Screenshot of SmartABL settings panel" src="plugins.octoprint.org/assets/img/plugins/SmartABL/settings.png" width="80%">
Expand Down
40 changes: 25 additions & 15 deletions octoprint_SmartABL/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def get_settings_defaults(self):
failed=False,
bedtemp=False,
hetemp=False,
force_unknown=False,
)

# SimpleApiPlugin
Expand Down Expand Up @@ -317,20 +318,28 @@ def process_line(self, comm_instance, line, *args, **kwargs):
)
break
else:
self._smartabl_logger.debug(
"@process_line:detected_firmware >> Unknown"
)
self._plugin_manager.send_plugin_message(
self._identifier,
{
"abl_notify": (
"SmartABL: disabled",
"Unknown firmware. Open an Issue "
"on GitHub indicating your "
"firmware and logs.",
)
},
)
if self._get("force_unknown"):
self.firmware = "marlin"
self._smartabl_logger.debug(
f"@process_line:detected_firmware >> "
f"unknown* > {self._dbginternal()}"
)
else:
self._smartabl_logger.debug(
"@process_line:detected_firmware >> unknown"
)
self._plugin_manager.send_plugin_message(
self._identifier,
{
"abl_notify": (
"SmartABL: disabled",
"Unknown firmware. Open an Issue "
"on GitHub indicating your "
"firmware and logs. Or force SmartABL"
"on unknown firmware, check settings for more info.",
)
},
)
else:
if "EEPROM disabled" in line: # marlin eeprom disabled
self.save_allowed = False
Expand Down Expand Up @@ -470,7 +479,8 @@ def _dbgsettings(self):
f"prints={self._get('prints', 'i')}, "
f"failed={self._get('failed')}, "
f"bedtemp={self._get('bedtemp')}, "
f"hetemp={self._get('hetemp')}"
f"hetemp={self._get('hetemp')}, "
f"force_unknown={self._get('force_unknown')}"
f")"
)

Expand Down
15 changes: 13 additions & 2 deletions octoprint_SmartABL/templates/SmartABL_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,24 @@
</div>

<div class="control-group">
<h5>Prints counter</h5>
<h5>Extras</h5>

<label class="control-label"></label>
<div class="controls">
<label class="checkbox">
<input type="checkbox" style="margin-top: 3px;" data-bind="checked: settings.plugins.SmartABL.failed"/>
Take into account failed prints
Take into account failed/stopped jobs in prints counter
</label>
</div>

<label class="control-label"></label>
<div class="controls">
<label class="checkbox">
<input type="checkbox" style="margin-top: 3px;" data-bind="checked: settings.plugins.SmartABL.force_unknown"/>
Enable SmartABL on unknown firmwares
<br>
<small>You have to enable and configure <code>Trigger custom gcode(s)</code> and <code>ABL custom gcode(s)</code>. If you don't configure these two settings,
SmartABL assumes marlin firmware by default (i.e. G29 read from file and G29 send to printer when ABL is needed)</small>
</label>
</div>
</div>
Expand Down
15 changes: 13 additions & 2 deletions plugins.octoprint.org/SmartABL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ for the idea.
- Prusa (P)
- Prusa-buddy (B)
- Klipper (K)
- Custom*

> *: You can customize the gcode triggering ABL and the gcode sent to the printer
> in settings. Check the setting "Enable SmartABL on unknown firmware" to use not
> detected firmwares.
> Want your firmware to be compatible? Open an Issue on github so we can add it 🙂
>
Expand Down Expand Up @@ -109,9 +114,15 @@ Default: enabled.
- If current print hotend temperature is different from last print.
Default: enabled.

**Prints counter**
- Take into account failed prints in the counter.
**Extras**
- Take into account failed/stopped jobs in prints counter.
Default: disabled (only successful prints increase the counter).
- Enable SmartABL on unknown firmwares.
Default: disabled.
> You have to enable and configure <code>Trigger custom gcode(s)</code> and
> <code>ABL custom gcode(s)</code>. If you don't configure these two settings,
> SmartABL assumes marlin firmware by default (i.e. G29 read from file and
> G29 send to printer when ABL is needed)
<div align="center">
<img alt="Screenshot of SmartABL settings panel" src="/assets/img/plugins/SmartABL/settings.png" width="90%">
Expand Down
Binary file modified plugins.octoprint.org/assets/img/plugins/SmartABL/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dba0df8

Please sign in to comment.