Klipper module that adds a G-code command so Klipper will pause until specified endstop is in selected state, triggered or not triggered. Alternativley it can query a specified amount of times.
I have been told it is misspelled as "Continuesly" instead of "Continuously" but it's a bit late for changing this unfortunatley... I have changed it in the text at least now.
Query an endstop and wait for it to be triggered or not triggered.
QUERY_ENDSTOP_CONTINUESLY ENDSTOP= TRIGGERED= ATEMPTS=
- ENDSTOP= The name of the endstop to query.
- TRIGGERED= The state the endstop should be in. 0 or 1.
Default is 1, Triggered.
- ATEMPTS= The number of atempts to query the endstop. Default is continuously.
QUERY_ENDSTOP_CONTINUESLY ENDSTOP=probe TRIGGERED=0 ATEMPTS=5
This will query the endstop 'probe' 5 times or until it is not triggered, with
a 0.1 second delay between each query. If the endstop is still triggered after 5
atempts or the endstop is untriggered before, the command will return and
last_endstop_query['probe']
will be set acordingly.
QUERY_ENDSTOP_CONTINUESLY ENDSTOP=probe TRIGGERED=0\
This will query the endstop 'probe' continuously until it is not triggered, with a 1 second delay between each query. The command will not return until the endstop is not triggered.
The result can be accessed in GCode macros and other modules under the
printer
object.
printer.query_endstop_continuesly.last_endstop_query['probe'] : False
Install by connecting to your klipper machine using SSH and run this one line command:
cd ~/ && git clone https://github.com/TypQxQ/Query-Endstop-Continuesly-in-Klipper.git && bash ~/Query-Endstop-Continuesly-in-Klipper/install.sh
- Download
query_endstop_continuesly.py
to yourklippy/extras
directory. - Add
[query_endstop_continuesly]
toprinter.cfg
No configuration needed. Only the section [query_endstop_continuesly]
is
needed in printer.cfg.
It can for example be used by a Jubilee style toolchanger to check if tool is locked and pause a print until it is. This is also usefull for other toolchangers that check if a tool is mounted or parked with endstops.