The Player module allows you to play files from the SD card.
Files are read one line at a time, and each line is executed as if it had been received from a controlling host.
Mac users beware: it appears that the play function does not accept files that have a space in their name.
Files on sdcard MUST be line terminated by \n ONLY, not \r (Note for MAC users).
On the very latest version of smoothieware it will tolerate \r\n terminated lines.
Here are all the available options for the Player module:
| V1 Setting | V2 Setting | Description |
|---|---|---|
| If set to true, automatically plays the on_boot_gcode file when the board boots up. This allows for automated startup routines like homing or initial positioning. | ||
| Path to the G-code file to play when the board boots. Default is /sd/on_boot.gcode. Useful for automating startup tasks like homing the printer or setting initial temperatures. | ||
| G-code to execute automatically right after a suspend command is received. Use underscores (_) instead of spaces in G-code commands. Commonly used to retract filament and move the toolhead away from the print. Example: G91_G0_E-5_G0_Z10_G90_G0_X-50_Y-50 (retracts 5mm, raises Z by 10mm, moves to safe position). | ||
| G-code to execute automatically after a resume command but before resuming the print. Use underscores (_) instead of spaces. Generally not needed since resume restores the previous state automatically. Example: G91_G1_E1_G90 (extrudes 1mm to prime the nozzle). | ||
| Controls heater behavior during suspend. When false (default), heaters turn OFF on suspend and back ON on resume. When true, heaters remain ON during suspend. Set to true for short pauses to avoid waiting for heaters to reheat. |
playYou can use the play command to execute files stored on the SD card.
You must specify a file name and its path, for example:
play /sd/gcodefile.gcode
By default, the command will be quiet.
If you want the command to output every G-code in the file to the serial port ( the command was called from ), add the -v ( verbose ) parameter:
play /sd/gcodefile.gcode -v
@.
Therefore, send your command as @play /sd/gcodefile.gcode and it will work.
progressWhen a file is playing, you can use the progress command to get a report of the current position in the file, and elapsed time.
abortYou can also use the abort command to stop the execution of the file.
suspendCan be used for either sd card playing or when streaming from Pronterface or Octoprint.
Will suspend a print in progress. It does the following:
true)after_suspend G91G0E20G90)User may jog or remove and insert filament at this point, extruding or retracting as needed.
This could be triggered by a Switch module to setup a simple out of filament detector.
1. This will mean it will stop within 32mm, but there is a performance penalty for segmenting when you do not need to.
There are several different ways to stop Smoothie during operation, each with different behaviors and use cases.
Understanding these methods is important for safe operation and troubleshooting.
| Command | G-code | Movement | Heaters | File playing | Recoverable | Documentation |
|---|---|---|---|---|---|---|
| abort | Stops SDCARD print immediately | Not affected | Aborts | Position maintained, file must be restarted | Player | |
| suspend | Stops once queue is empty | Turned off (if option enabled) | Paused, can be resumed | Yes, with resume or |
Player | |
| Kill button | Stops instantly (if button), waits for buffer (if host) | Turned off | Aborted | No, position lost, home required | supported-g-codes | |
| Control-X | - | Stops instantly, works during streaming | Turned off | Aborted | No, position lost, home required | - |
M26)Stops the execution of a file being played from SDCARD.
Behavior:
Use Case: Quick stop of a print job while preserving position and keeping heaters on.
Recovery: Position is maintained, but the file must be restarted from the beginning.
Documentation: Player module
M600)Suspends the execution of a file being played from SDCARD or being streamed from a host.
Behavior:
M601Use Case: Mid-print filament change or filament out detection.
Host Support: Requires upstream support. Currently Pronterface and OctoPrint support it. Other hosts need to be manually paused.
Recovery: Yes, fully recoverable with position maintained.
Documentation: Player module
M112Emergency stop that instantly halts all operations.
Behavior:
M112 issued from host: Has to wait for the receive buffer to have roomM999 is sentUse Case: Emergency situations requiring immediate stop.
Recovery: No, position is lost. Homing will be required.
Documentation: Supported G-codes, Kill Button
Sends a control character to stop Smoothie instantly.
Behavior:
M999 or $X is sentUse Case: Emergency stop from terminal/console when streaming G-code.
Recovery: No, position is lost. Homing will be required.
When the kill button is pressed (or there is a temperature fault, M112 is issued, a limit switch is hit, or other error), the system enters the Halt state.
!! response (with a few exceptions)The Halt state can be cleared by:
M999 from the hostM600/M601) for planned interruptions like filament changesM999resumeWill resume a suspended print. It does the following:
The following G-codes are supported by the Player module: