Rylan-Meilutis / OctoPrint-Nozzle-Filament-Validator

Validate filament type and nozzle diameter before starting a print
GNU Affero General Public License v3.0
1 stars 0 forks source link

Verify the right filament spool and auto-change #7

Closed dcorbin closed 4 weeks ago

dcorbin commented 1 month ago

According to the documentation, you verify the filament type. I would like to see the plugin verify the filament spool. How? Each filament type in the slicer can use custom GCode to generate a comment with a pattern that matches the SpoolManager display name (or some other SM property). The plugin can confirm that that this is currently selected.

With another bit of code, you could automatically select the spool in the SpoolManager. If you did this, SpoolManager's usage tracking would always be applied to the correct spool.

Rylan-Meilutis commented 1 month ago

I will definitely look into the first part, as for the second part, could you maybe clarify why you would want the spool to be automatically selected? The purpose of the plugin is to verify that the gcode was sliced for your current printer setup (nozzle, build plate, filament) so switching the spool in spool manager wouldn't effect the filament loaded in the printer and could lead to the condition where the printer tries to print the wrong material (petg on pla settings... etc) because the loaded spool was changed in SM without actually being changed on the printer.

dcorbin commented 1 month ago

Personally, I'm far more likely to forget to change the select spool in the Spool Manager than I am to forget to change the actual spool. When this happens, I end up with inaccurate usage data/inventory that there's no good way to fix.

Rylan-Meilutis commented 1 month ago

changes have been implemented in the latest beta release, you should be able to switch to it in the release channel section in octoprint. Documentation can be found here. Let me know if you have any issues. If you are running version 3.0.0 or lower check here for how to update. Happy error free printing :)

Rylan-Meilutis commented 1 month ago

I am working on a postprocessing script to make the gcode edits easier instead of needing a separate filament profile for each filament, it will allow you to use the same profile and change the needed db id's in the background.

dcorbin commented 1 month ago

I'm guessing people do things a lot of different ways. I have separate profiles for each filament. That's how the slicer I use is designed to be sued.

Actually, using the Spool Id (as you implemented) is actually a bit of a problem If I have multiple spools of the same filament I would have to re-slice the model to make it work with what should be equivalent spools. Using Display Name does required the user to be consistent in how I name such spools, but that's way less onerous.

Rylan-Meilutis commented 1 month ago

Beta 2 should address this, it switches to using names instead of db id's. It required a bunch of changes such as finding the database id's in the frontend since there is no nice way to do it in python. It also required many changes in the structuring of the backend and the parsing of the gcode. The readme has been updated and the beta is live. Documentation is here. The post-processor is still in progress for the setups where the filament profiles are used for a material and not a spool. (one profile per material not per spool).

Rylan-Meilutis commented 1 month ago

The first RC as just been released. It should have addressed all previous issues. Let me know how it goes! Happy error free printing :)

Rylan-Meilutis commented 4 weeks ago

added in current release

dcorbin commented 3 weeks ago

If I understand correctly, I should see this in 3.1.0, right? I thought I would see an option to enable this feature in the config for the plugin, but I don't see it.

Rylan-Meilutis commented 3 weeks ago

the checkbox is in the general tab at the bottom.

image
dcorbin commented 3 weeks ago

Ah. I did not realize I had to scroll to see it.

Rylan-Meilutis commented 3 weeks ago

no worries, let me know how it works for you

dcorbin commented 3 weeks ago

I'm see not sign of validation in the UI when printing with the wrong spool.

I did see this in the log: 2024-04-24 00:55:41,757 - octoprint.plugin - ERROR - Error while calling plugin Nozzle_Filament_Validator Traceback (most recent call last): File "/home/dcorbin/OctoPrint/venv/lib/python3.9/site-packages/octoprint/plugin/__init__.py", line 275, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/home/dcorbin/OctoPrint/venv/lib/python3.9/site-packages/octoprint/util/__init__.py", line 1686, in wrapper return f(*args, **kwargs) File "/home/dcorbin/OctoPrint/venv/lib/python3.9/site-packages/octoprint_nfv/__init__.py", line 336, in on_event self.validator.check_print(selected_file) File "/home/dcorbin/OctoPrint/venv/lib/python3.9/site-packages/octoprint_nfv/validate.py", line 214, in check_print if not self.check_printer_model(printer_model): File "/home/dcorbin/OctoPrint/venv/lib/python3.9/site-packages/octoprint_nfv/validate.py", line 310, in check_printer_model if remove_mmu_from_end(self.get_printer_model().lower()).endswith("is"): AttributeError: 'NoneType' object has no attribute 'endswith'

Rylan-Meilutis commented 3 weeks ago

Your issue is probably that you don't have the printer model set for your printer profile. That error is a bug and will be fixed in the next release. for now make sure the printer model is set correctly.

image
Rylan-Meilutis commented 3 weeks ago

fixed in the latest rc

dcorbin commented 3 weeks ago

Actually, my printer model is set. What is the correct way to access the RC?

Rylan-Meilutis commented 3 weeks ago

In the software updater settings select the release candidate channel.

image