player

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.

Important Notes

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.

Configuration

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, useful 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.

  • false (default): heaters turn OFF on suspend and back ON on resume.
  • true: heaters remain ON during suspend.

Set to true for short pauses to avoid waiting for heaters to reheat.

Commands

play

You 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
Pronterface Note: Pronterface will ignore commands it does not understand, unless you prefix them with @. Therefore, send your command as @play /sd/gcodefile.gcode and it will work. Repetier Warning: Repetier will act kind of mean, and ignore any command it doesn't understand. Unlike Pronterface it won't give you a method to pass commands anyway. You can possibly use the M24 G-code instead.

progress

When a file is playing, you can use the progress command to get a report of the current position in the file, and elapsed time.

abort

You can also use the abort command to stop the execution of the file.

suspend

Can be used for either sd card playing or when streaming from Pronterface or Octoprint.

Will suspend a print in progress. It does the following:

  1. Send pause to upstream host, or pause if printing from sd
  2. Wait for empty queue
  3. Save the current position, extruder position, temperatures - any state that would need to be restored
  4. –retract by specified amount either on command line or in config– - not implemented yet
  5. Turn off heaters (unless the config has true)
  6. Optionally run after_suspend gcode (set in config defines gcode to run eg. 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.

NOTE: Issuing a home after a suspend will cancel the suspend and you will not be able to resume. Performance Note: The queue must drain before it will suspend. If you need to have the system suspend quicker the only way to do it is to set the config variable to 1. This will mean it will stop within 32mm, but there is a performance penalty for segmenting when you do not need to.

Stopping Smoothie

There are several ways to stop a file being played :

  • M26 ( abort ) stops the print, heaters stay as they are, and the file must be restarted from the beginning
  • M600 ( suspend ) stops once the movement queue is empty and turns heaters off by default, you resume with resume or M601
  • M112 or the kill button is the emergency stop : heaters are turned off, the position is lost, and you need M999 then homing
Learn more: Stopping Smoothie

resume

Will resume a suspended print. It does the following:

  1. Restore the temperatures and wait for them to get up to temp
  2. Optionally run before_resume gcode if specified
  3. Restore the position it was at and E and any other saved state
  4. Resume sd print or send resume upstream

G-codes

The following G-codes are supported by the Player module:

  • M21 : Initialize the SD card. This does nothing in Smoothie but is kept for compatibility
  • M23 : Select a file, for example : M23 file.gcode
  • M24 : Start or resume SD card print
  • M25 : Pause SD card print
  • M26 : Abort a SD card print
  • M27 : Report print progress
  • M32 : Select a file, and start playing it, for example : M32 file.gcode
  • M600 : Suspend print in progress (use console command resume or M601 to continue)
  • M600.1 : Suspend print in progress, but leave heaters on
  • M601 : Resume print after suspend
This is a wiki! If you'd like to improve this page, you can edit it on GitHub.