-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spoolman integration: multiple extruders/spools #1269
Comments
Thanks for your feature request. The solution I'm thinking of looks like this:
refs: Donkie/Spoolman#277 Donkie/Spoolman#239 mainsail-crew/mainsail#1732 |
I'm not too familiar with toolchanger setups - for testing the linked implementation I've just created a bunch of shell
I've noticed that, instead of creating |
Hi Mathis
Sorry for my late reply, life interfered. To summarize:
* Storing the extruder-specific spool-id in a variable of the Txx macros (which
can be read/set by any UI), then using that variable in a call to the existing
SET_ACTIVE_SPOOL sounds absolutely workable to me - and very scalable.
* Having the filament color in a second, optional variable also sounds useful
(and trivial) ... e.g. for gcode visualization?
* I cannot imagine the user side being made much easier than that, even with
deeper changes to the code. I can, however, not offer any insights into the
weighing of other solutions' feasibility vs. coding risk.
* The prototype already looks very polished to me :-)
* The integration steps look downright easy ("but documentation" blablabla
*g*)
* Your testing macro is pretty much what my own macros do (see below), just
without the hardware specifics
* I'm sorry to say I had never heard of KTCC until you mentioned it.
Interesting project, though. Without diving into it: you're probably right.
All slicers I know of _will_ call the Tn macros, that cannot be disabled (...
of course, if there is no such macro ...). Whereas the KTCC_Tn macro would
need to be called either explicitly from a "standard" Tn macro *OR* more
likely from a slicer-specific "before filament/after filament" section. I'd guess
that the latter setup is more of a single-specific-printer thing that one
eventually grows out of?
With best regards,
and looking forward :-) ,
Florian Weber
…---------------
My extruder switch macro. I removed some superfluous stuff.
For me, the current extruder is not stored locally but in a variable of my own
CONFIGS macro. But that should work exactly the same as your test setup (I
think?).
Your proposed code is marked with "NEW" or "MATHIS"
[gcode_macro T0]
# NEW variable_spool_id: None
# NEW variable_spool_color: #ABCDEF
gcode:
# Catch the "change to same extruder" case
{% if printer["gcode_macro CONFIGS"].active_extruder != 0 %}
RETRACT_ACTIVE_FILAMENT_TO_PARKED
#------------------
# Switch movement (and movement only) to extruder 0
# Activate stepper in "extruder"
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=extruder
# Deactivate stepper in "secondary_extruder"
SYNC_EXTRUDER_MOTION EXTRUDER=secondary_extruder MOTION_QUEUE=
# Remember current extruder
SET_GCODE_VARIABLE MACRO=CONFIGS VARIABLE=active_extruder VALUE=0
#MATHIS SET_GCODE_VARIABLE MACRO=T0 VARIABLE=active VALUE=True
#MATHIS SET_GCODE_VARIABLE MACRO=T1 VARIABLE=active VALUE=False
#------------------
# NEW SET_ACTIVE_SPOOL ID={ printer['gcode_macro T0'].spool_id }
UNPARK_ACTIVE_FILAMENT_TO_PRINTING
RESPOND MSG="Current extruder now T0"
{% else %}
RESPOND MSG="Current extruder now T0 (nothing changed)"
{% endif %}
--
Mit besten Grüßen,
Florian Weber
PGP Key ID: 0x722D7E278C769B59
PGP Keyserver: hkp://keys.openpgp.net , hkp://keys.mailvelope.com
|
@fweber3 Hi Florian, thanks for your feedback. The current implementation is ready for a first test I think. For now, I'm not sure there's a point in having Fluidd update the macros Any chance you're able to test out my branch? Any feedback would be much appreciated. |
Hi Mathis
I'd be happy to do a test run!
However, my dev-tool skills have very much been rotting since pre-GitHub. My
install is with KIAUH and I totally failed at a working deployment of your
branch :-( , while official releases were not problem. If you can give me a hint
(or a drop-in zip/tar?) I'll be right at it.
The documentation looks fine to me.
I agree with you concerning the color variable - knowing what to do when it
actually is needed should probably be enough for now.
Am Samstag, 27. Januar 2024, 00:06:44 CET schrieb Mathis Mensing:
… @fweber3 Hi Florian, thanks for your feedback.
The current implementation is ready for a first test I think.
I've [updated the
docs](https://github.com/fluidd-core/fluidd/assets/25269274/dcf4784b-66b4-4
271-990e-240b934dbeac) to reflect those changes.
For now, I'm not sure there's a point in having Fluidd update the macros
`color` variable, so I have removed that functionality for now. I mentioned
it in
#1269 (comment)
as a way to display the toolhead's associated filament color in the UI, but
I think overriding the usual color icon with a colored spool icon (as shown
in the screenshot above) looks much cleaner.
Any chance you're able to test out my branch? Any feedback would be much
appreciated.
--
Mit besten Grüßen,
Florian Weber
PGP Key ID: 0x722D7E278C769B59
PGP Keyserver: hkp://keys.openpgp.net , hkp://keys.mailvelope.com
|
Hi Florian, no worries, I've built the latest commit for you: fluidd-spoolman-toolchange.zip To test this out, you'll need some sort of HTTP server. I personally use http-server for static files, but any alternative should be fine here. I've also gone ahead and added functionality that updates the actively tracked spool when a new spool is selected for an active macro, |
FWIW, builds from PRs have the code build ready to download and test! 🙂 https://github.com/fluidd-core/fluidd/actions/runs/7681482706?pr=1324 As for execution, as long as you have NodeJS installed, you can download the files, extract, and then run |
Thanks for the build, and thanks for the hint @pedrolamas ! Unfortunately, neither version seems to work for me: I triple-checked that neither server-side nor client-side caching were in place. I think my T0/T1 macros are OK (see below, excerpted from printer.cfg), as compared to the docs linked above. The webserver is nginx 1.14.2. File permissions are identical to the working, official version. Is there anything I missed or borked? [gcode_macro T0]
|
Hmm, not sure what happened there. The macro looks fine, and overwriting the files should work fine, too. The following worked for me:
I don't think GitHub lets you download the artifacts from the command line directly, so you'll have to download it onto your PC first and then re-upload it to your host computer. |
That's more or less what I had done before, except that this time I overwrote where I had replaced. Summarising (since I'm at wits' end): I now have replaced and/or overwritten my known-good installation with three not-very-different(?) builds and according to three differently-sourced instruction sets (which basically all say the same anyway). To verify that the correct directory was actually being served I identically modified the version number in files fluidd/release_info.json and fluidd/.version. Afterwards, I restarted the webserver nginx, moonraker (required to pick up changed version number) and klipper (for good measure). After a final F5 in the browser, the changed version number was visible in the "Settings" tab. I assume that at this point the update process itself was successful, from a file-download-and-webserver-reload perspective - moreso since the result was identical on all tries. I am then able to print as before, and I see no way but that I am doing so with the sent/downloaded improved code. Unfortunately, the Spoolman and Toolhead Widgets in the browser have not acquired their new capabilities. I see two avenues two continue: either the code I tried did not contain the changes (unlikely, but could I check somehow?), or for whatever reason the new features are not active in my setup (again, could I check?). From my experience, a difference between "development" and "production" systems seems like the most plausible culprit now? |
My "known-good" hash is 2056453, which is official v1.27.1 downloaded from GituHub. The file fluidd-c54578fd47ec58ff30b4bfdf818aaa28de06a292.zip (as downloaded from your newest link https://github.com/fluidd-core/fluidd/actions/runs/7686212959/artifacts/1200646311 ) has the hash c54578f. The download provided by pedrolamas (see above) has hash 266021b. All values as displayed on the main fluidd page after appropriate refreshing. I could not grep "a6a62738" in any of the above. As that looks significant (to me), I'm temporarily holding back on the logs. |
The https://github.com/fluidd-core/fluidd/files/14073992/fluidd-spoolman-toolchange.zip download should have hash If it's showing 2056453 as the hash, I assume something went wrong unpacking the ZIP or the old content was still cached. |
Indeed - your file was zipped with its toplevel directory (which I actually prefer), where the others all were not. That threw me off - of course on the one file where it counted eyeroll. I now can confirm the hash a6a6273 in-browser and in file index-KXf4VOCe.js. I'll be using this version from hereon. Still no multi-spool anywhere. See attached for both logfiles. I took the freedom of restarting both services and cutting the logs before the restart point. If you need more/longer, the full files are available. You will see the printer disappearing - I switched it off manually, it's loud. |
Thanks for the logs. The setup seems fine to me, I'll take a closer look and get back to you. |
I've tested both a6a6273 and the latest commit on the branch, and they both seem to work on my end with your configuration. Any chance there's any errors reported in the browser console (F12 -> |
Nothing at all in loglevels "Error" to "Debug", sorry. CSS yields ~20 of either "Error processing value for" (mostly geometry stuff?) or "Unknown pseudo class or element" |
PS: |
Honestly, I'm not sure what's happening here. I've tried reproducing the issue in multiple ways (my own config, your config adapted to work on my machine, on my physical setup and in a virtualized one) but I can't seem to reproduce it. If not even the "Change Spool" button changes to a dropdown, that makes me think something isn't reporting macros or macro variables properly. Can you share the output of |
That is what I see, yes. The browser response to
The answer uses a lowercase I tried moving the fluidd/ folder to a totally different machine (also Raspi 3B+) not previously connected to 3d printing at all and served it with a quickly installed lighttpd-1.4.59. The experience was mostly1 trivial. Multi-Spool-UI did not show up, though. Footnotes
|
Yeah, the output looks fine to me. I'm out of ideas here then. |
@fweber3 We've decided to ship the feature as-is for now, as we cannot reproduce the issues you're describing. We'll wait for other users feedback, until then I'm afraid there's not much we can do here. |
Frustrating as that obviously is right now: I do know the feeling from both sides, so thank you for the time you took trying to help me out. The things you showed definitely do justify closing my feature request, even if it doesn't work for me personally yet. I'll wait for the feature to become available through official channels. I see a certain chance that this might help me. I'll also keep trying "other things" on-and-off on my end to get it running ... I want that feature, and it obviously can work. If anything resolves my problem, I'll definitely report it back here to help out others. Public data dump, latest news of my trials:
|
@fweber3 Thanks, I think I figured out what's going on here. When a macro is edited via the UI it saves a copy of it in the database, which is then used to override some default settings. It looks like this also overrides the macros |
I can confirm that I usually edit my config files via the UI. |
@fweber3 FYI we just released v1.28.1 which should fix this issue |
I am extremely happy to report that 1.28.1 finally works for me, too! 🥳 I have not actually done a dual-color print so far, TBH. But since hardcoded "manual" spool changes already worked flawlessly, I presume that this part of the backend will be OK. |
Oh, one observation, don't know if that's a bug? (I'll gladly open one) After setting T0 and T1, I can in addition select a third spool for the "Active Spool". This seems a little inconsistent - but it doesn't seem to change anything. As soon as T0/T1 is selected, the previously hand-selected "Active Spool" is overwritten with the one from T0/T1. |
This is intentional, but I agree there isn't a huge use case for it. The idea is that you can still manually set an actively tracked spool, for example when there's no spools assigned to your toolheads. |
Is your feature request related to a problem? Please describe
The combination of Fluidd/Moonraker/Klipper/Spoolman works really fine for me (Thanks everybody!).
However they currently only work with printers with a single extruder. I would like to use multi-extruder printers with the same ease.
Describe the solution you'd like
2a. I already have gcode macros "T0"/"T1" for performing the extruder switch. These macros would be extended by a command "Now use filament A", "Now use filament B" .... referencing the previously /selected/ spools (and notably /not/ the backend's spool ID).
2b. For a test: a command to change spools is already available (at the Moonraker level, IIRC) but it requires an actual, hardcoded spool ID. It worked beautifully from an "envisioned" workflow perspective, but hardcoded spool-IDs in gcode will nevertheless not be my way forward ;-)
Describe alternatives you've considered
I had considered using the slicer (currently PrusaSlicer) for my spool management. However:
Therefore, the whole "Use the slicer" line of thinking seems a nogo for me due to matters of scale.
Additional information
I am not really sure how my request would integrate with QR-code scanning. Along with the spool presented, the system would suddenly need information about which extruder the spool should belong to - which is a per-print attribute, not a per-spool attribute. Perhaps showing an additional "extruder number" QR-code /before/ the spool is an option? On single-extruder machines, the whole complication is superfluous and must be suppressed.
The text was updated successfully, but these errors were encountered: