Fill out above information andin all cases attach yourklippy.logfile (use zip to compress it, if too big). Pasting yourprinter.cfgis not needed Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there
Describe your issue:
…
I try to establish the loop function with [sdcard_loop] for a filament spooler.
The SDCARD_LOOP_BEGIN command must be in a gcode file that one is actively printing, and being printed using Klipper’s “virtual_sdcard” system. That is, the command can not be sent from the command-line, nor from macros issued from the command-line, nor from gcode sent piecemeal from OctoPrint. The error you posted above indicates that the sdcard_loop.py code detected the command did not originate from an active virtual_sdcard gcode print.
If the command was in a gcode file being actively printed from virtual_sdcard, then it indicates an error somewhere in the code. In that case, you could try issuing an M112 immediately after the event to get additional information in the Klipper log. I suspect a developer would need to look through that info to track down the root cause.
I’m not sure what frontend you are using, but the gcode commands were definitely sent via the /tmp/printer pseudo-tty and not from a virtual_sdcard print. If this is OctoPrint, make sure you are telling it to print via sdcard and not via its normal streaming mode.
If you are using Octoprint, then my experience is that Octoprint uses the traditional way via /tmp/printer and effectively bypasses the virtual SD card.