Feedback after movement

I’m trying to use klipper to make a device that measures salinity in about 20 different tanks along a single axis… (so only use x for movement and z for lowering the sensors).
Because the distances will be rather long (up to 20m), is there a way to get feedback through the /tmp/printer port when a position is reached? Like if you home an axis, the ‘ok’ is given after the homing is done.

Now i just poll the position on an interval till it reaches the desired coordinates.
Current hardware is a printHAT2 but haven’t decided on the final sbc, current testing is with a nanopi air.

Is the M400 g-code useful to you? Maybe that followed by an M118 move done or RESPOND command?

1 Like

Thanks, if i follow the G0 command with a M400 the ok from the M400 is received when the G0 was finished so i can use that. Now i just need to alter the code to wait longer for a reply and it’s good to go.

Below is the script i can now use in my program instead of polling the position and checking that. No that this is any use to anyone, but wanted to share…

		<taskset id="doroutine" info="Home the axis and step through positions" run="step">
			<!-- Home axis -->
			<task output="stream:print" reply="ok" replywindow="2m">G28 Y</task>	
			<task output="log:info">Y endstop reached</task>
			<!-- Go to first position -->
			<task output="stream:print" reply="ok" replywindow="2m">G0 Y100;M400</task>
			<task output="log:info">First position reached</task>
			<!-- Do stuff in the first position, then go to second -->
			<task output="stream:print" reply="ok" replywindow="2m">G0 Y50;M400</task>
			<task output="log:info">Second position reached</task>
			<!-- Do stuff in the second  position, then go to third -->
			<task output="stream:print" reply="ok" replywindow="2m">G0 Y150;M400</task>
			<task output="log:info">Third position reached</task>
			<!-- Do stuff in the third position, then ? -->
			
			<!-- Go back home? -->
			<task output="stream:print" reply="ok" replywindow="2m">G28 Y</task>
		</taskset>