Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 3.58 KB

README.md

File metadata and controls

70 lines (48 loc) · 3.58 KB

Advanced Filament Swap for Mainsail WIP

Why to fork?

Cudos to original author making this kind of hard work all on his own trying to befriend gui and gcodes. But it's begging for some changes. Original macros were written in the way you couldn't change parameters midprint. Also I cann't understand why to use so much filament (150mm) for each change when you have possibility to purge more if necessary and to write in buggy gcode not utilizing (UN)LOAD_FILAMENT macros that work on any machine they were preconfigured (and/or changed by user to desired state). Also GUI is not working on fluidd (btw console messages are great and pretty sufficient for me, but it,s better to change it if i can).

Guided M600 filament changes and filament run-outs for Mainsail.

This is my advanced filament swap script for Mainsail (possibly also compatible with Fluids??). It allows for guided pop-up alerts on run-out and M600 events, with a fluid UI suitable for all screen sizes.

This script is inspired by Jay Lexx's MOM script for for OctoPrint.

Preview

YouTube

Screenshots

Changes

Some people had issues with replacing their index.html with the modified version I provided. It appears that from time to time Mainsail update the source for it and if it then gets replaced with a mismatched version, it causes a blank screen. The new method instead requires the user to edit their own index.html and paste in a few extra lines (see installation instructions below).

Installation

STEP 1: Connect to your printer via SFTP
STEP 2: Save adv_filament_swap.cfg in your config folder (i.e: home/pi/klipper_config/)
STEP 3: Save alert-handler.js in /home/pi/mainsail
STEP 4: Edit your index.html in /home/pi/mainsail and add the following before </head>

	<!-- MOD START -->
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/arrive/2.4.1/arrive.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css">
		<script src="./alert-handler.js"></script>
	<!-- MOD END -->

STEP 5: Include this script in your printer.cfg (i.e [include adv_filament_swap.cfg])
OPTIONAL: Tweak any of the default values in adv_filament_swap.cfg as required (from line #120)
OPTIONAL: Point your run-out pin to RUN_OUT in your printer.cfg

Usage (example given for Cura)

STEP 1) Extensions > Post Processing > Modify G-Code
STEP 2) Add a script -> Filament Change
STEP 3) Set "Layer" to the layer number you want the switch to occur
STEP 4) Repeat Step 3 for however many changes you require (:

N.B. You can also manaually send FILAMENT_SWAP in the console to trigger a filament swap.

Support

For support, join my Discord.

Screenshots

Run out:

Run out

Filament unloading:

Unloading

M600:

M600

Fluid UI for all screen sizes:

Mobile