Playing G-code files
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.
Here are all the available options for the Player module
Here are all the available commands for the Player module
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 :
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
PronterfacePronterface 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
RepetierRepetier 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.
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.
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 implemened yet
5. turn off heaters. (unless the config has leave_heaters_on_suspend 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.
Stopping SmoothieThese are the different ways of stopping Smoothie :
|abort||M26||Stops an SDCARD print immediately||Not affected||Aborts||Position maintained, but file must be restarted||Player||Stops the execution of a file being played from SDCARD, it will complete the current gcode, but stop immediately after that, the rest of the queued commands are discarded. It attempts to maintain the correct position after the abort.|
|suspend||M600||Stops once queue is empty||Turned off if option enabled (default)||Paused, can be resumed||Yes, with resume or M601, position maintained||Player||Suspends the execution of a file being played from SDCARD or being streamed from a host (upstream support required currently pronterface and octoprint support it, otherwise host needs to be manually paused), all state is saved and jogging and extruding is allowed. Mainly used for mid print filament change, or filament out detection. M601 resumes the print or the resume command|
|No command, but there is a configurable Â«killÂ» button||M112||Stops instantly if kill button pressed, if issued from host has to wait for the receive buffer to have room.||Turned off||aborted||No, position is lost, home will be required||supported-g-codes||Instantly stops all operations, printer fully halts until M999 is sent. Position is lost.|
|Sending Control-X to smoothie over the serial port or USB serial port||should work at any time even when streaming, does the same as the kill button||Turned off||aborted||No, position is lost, home will be required||Instantly stops all operations, printer fully halts until M999 is sent (or $X). Position is lost.|
If 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, in this state the play led flashes, and the state can be cleared by issuing M999 or holding the flashing kill button for 2 seconds (it can also be cleared from the LCD panel). While in the Halt state any command issued from the host will get a !! response (with a few exceptions). The PSU may be turned off when Halt is entered if there is a psu Switch defined.
All commands can be triggered by a button or a sensor if a Switch module is configured to do so.
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
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)
- M601 : Resume print after suspend