Console commands

Console

In Smoothie, when connected to your board via Serial, in the same way that you can send Gcodes, you can also send some commands to manipulate the firmware’s behavior and get information.

Here are the different commands, grouped by module.

Not all of the console commands are documented here, feel free to add any that have been missed. Commands are meant as shortcuts/easier to use alternatives to G/M-codes when users are interacting directly with the machine via one of the serial ports.

If you are developing a host, you should use G/M-codes to interface programmatically with the machine, as they are more consistent in their format and answers and easier to parse.

Commands on the other hand have no guarantee to have any of that, they are meant for manual use.
Pronterface requires that you prefix your commands with the @ character.

So for example if you want to use the help command, send:

@help

On other hosts you can use M1000 command

SimpleShell

SimpleShell is a small unix-like shell module that allows you to browse the file system (SD card or other) and act on files.

This provides a powerful command-line interface for managing files and executing commands.

help

help - Give a list of commands

Here is an example output (as of March 2019):

commands:
version
mem [-v]
ls [-s]|folder
cd folder
pwd
cat file limit|[-d|10]
rm file
mv file newfile
remount
play file [-v]
progress - shows progress of current play
abort - abort currently playing file
reset - reset smoothie
dfu - enter dfu boot loader
break - break into debugger
config-get <configuration_source> <configuration_setting>
config-set <configuration_source> <configuration_setting> <value>
get pos|wcs|state|status|fk|ik
get temp bed|hotend
set_temp bed|hotend 185
switch name value
net
load file - loads a configuration override file from specified name or config-override
save file - saves a configuration override file as specified filename or as config-override
upload filename - saves a stream of text to the named file
calc_thermistor -s0 T1,R1,T2,R2,T3,R3 - calculate the Steinhart Hart coefficients for a thermistor
thermistors - print out the predefined thermistors
md5sum file - prints md5 sum of the given file

Note: Smoothie now also supports GRBL-like commands like ? and ! (when in grbl mode): Configuring Grbl v0.8

ls

ls

ls [-s] folder

List the files in the current folder (if no folder parameter is passed) or list them in the folder passed as a parameter (can be absolute or relative).

The -s parameter will also return the file sizes.

Examples:

ls
ls relative/path
ls /sd/absolute/path
ls -s /sd/

Example output of a ls -s /sd/ command:

config 21080
firmware.cur 284520
tt.nc 7500020
webif/
linearballbearingmount.nc 20140

cd

cd

cd folder

Change the current folder to the folder passed as a parameter (can be absolute or relative).

Examples:

cd relative/path
cd /sd/absolute/path

cat

cat

cat file limit

Outputs the content of the file given as a parameter to the standard output (limited to number of limit lines if that parameter is passed).

Examples:

cat filename
cat filename 10

play

play

play file [-v]

Executes a file line by line as if each line were received on the serial console, and sends any output to the standard output. Appending -v will print the commands executed to the console.

Examples:

play /sd/gcode_file -v
play list_of_configuration_changes

See the specific documentation at the Player page.

progress

progress

Displays the current status of execution of the play command

Example:

progress

Example output:

0 % complete, elapsed time: 31 s, est time: 326055 s

abort

abort

abort

Stops an execution of play


layout: default title: Stopping Smoothie —

Stopping Smoothie

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.


Stop Methods Comparison

Command G-code Movement Heaters File playing Recoverable Documentation
abort M26 Stops SDCARD print immediately Not affected Aborts Position maintained, file must be restarted Player
suspend M600 Stops once queue is empty Turned off (if option enabled) Paused, can be resumed Yes, with resume or M601 Player
Kill button M112 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 -

Detailed Method Descriptions

Abort Command (abort / M26)

Stops the execution of a file being played from SDCARD.

Behavior:

  • Completes the current G-code
  • Stops immediately after that
  • Discards the rest of the queued commands
  • Attempts to maintain the correct position after the abort
  • Heaters remain at their current state

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


Suspend Command (suspend / M600)

Suspends the execution of a file being played from SDCARD or being streamed from a host.

Behavior:

  • Stops once the movement queue is empty
  • All state is saved
  • Heaters turned off by default (configurable)
  • Jogging and extruding are allowed during suspension
  • Can be resumed with resume or M601

Use 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


Kill Button / M112

Emergency stop that instantly halts all operations.

Behavior:

  • If kill button pressed: Stops instantly
  • If M112 issued from host: Has to wait for the receive buffer to have room
  • All heaters turned off
  • File playing aborted
  • Position is lost
  • System enters Halt state until M999 is sent

Use Case: Emergency situations requiring immediate stop.

Recovery: No, position is lost. Homing will be required.

Documentation: Supported G-codes, Kill Button

Warning: Using the kill button or M112 will cause position loss. You must home all axes before continuing normal operation.

Control-X

Sends a control character to stop Smoothie instantly.

Behavior:

  • Works at any time, even when streaming
  • Same effect as the kill button
  • All heaters turned off
  • File playing aborted
  • Position is lost
  • System enters Halt state until M999 or $X is sent

Use Case: Emergency stop from terminal/console when streaming G-code.

Recovery: No, position is lost. Homing will be required.


Halt State

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.

Halt State Behavior

Halt State Indicators:
  • Play LED flashes
  • Any command issued from host gets a !! response (with a few exceptions)
  • PSU may be turned off if a PSU Switch is defined

Clearing Halt State

The Halt state can be cleared by:

  1. Issuing M999 from the host
  2. Holding the flashing kill button for 2 seconds
  3. Using the LCD panel (if equipped)

Using Buttons and Sensors

Tip: All stop commands can be triggered by a button or a sensor if a Switch module is configured to do so. This allows for physical emergency stop buttons or automatic stopping based on sensor conditions.

Best Practices

For Normal Operation

  • Use suspend/resume (M600/M601) for planned interruptions like filament changes
  • Use abort when you need to stop quickly but keep heaters on

For Emergencies

  • Use the kill button or Control-X for immediate emergency stops
  • Remember that position will be lost and homing will be required

Recovery After Emergency Stop

  1. Clear the Halt state with M999
  2. Home all axes before attempting further movement
  3. Check that heaters are at safe temperatures before proceeding
  4. Verify machine state before resuming work

Further Reading

mem

mem

mem -v
mem

Returns information about RAM usage

Example output of a mem command:

Unused Heap: 8396 bytes
Used Heap Size: 18252
Allocated: 12156, Free: 4744
Total Free RAM: 13140 bytes
Free AHB0: 13152, AHB1: 10440

break

break

break

Breaks into MRI debugging mode

net

net

Displays network information (like your IP address)

Example:

net

Example output of a net command:

IP Addr: 192.168.0.13
IP GW: 192.168.0.1
IP mask: 255.255.255.0
MAC Address: 00:1F:11:02:04:20

rm

rm

Removes a file

rm filename

Example:

rm /sd/file.gcode

pwd

pwd

Shows the current folder

pwd

suspend

suspend

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

resume

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

thermistors

thermistors

Prints a list of thermistor presets known to Smoothie with their numerical IDs.


Config

The config module is in charge of storing and retrieving configuration values (in/from the config file, see Configuring Smoothie).

It also provides a few commands to manipulate those values.

config-get

config-get

config-get <configuration_source> <configuration_setting>

Outputs the value of this configuration setting to the standard output. The value is taken from the config file.

WARNING it is HIGHLY recommended to NOT use this command as it uses a huge amount of memory to reload the config file and may CRASH.

Use cat /sd/config instead.

<configuration_source>: This optional parameter selects where to read the value from. Valid sources are ‘local’ and ‘sd’. Leaving this parameter out will read the current live settings in use.

<configuration_setting>: This parameter selects which value should be read.

Examples:

config-get acceleration
config-get sd alpha_steps_per_mm

config-set

config-set

config-set <configuration_source> <configuration_setting> <value>

Changes the value of this configuration setting to the value passed as a parameter.

Note: This command cannot currently “insert” characters, and just replaces ones that are already present.

So if the new value has a length that would require inserting characters not to go over the end of the line, it will be refused.

This is why all the lines in your config file must have extra whitespace (which are very useful to get nicely formatted comment columns, see Configuring Smoothie).

<configuration_source>: This parameter selects where to write the value to. Valid sources are ‘firm’ and ‘sd’.

<configuration_setting>: This parameter selects which value should be set.

<value>: The value to write.

Note you need to then reset your board, either by cycling the power, or by issuing the reset command.

Configuration changes are not taken into account until the config file is read again, which happens when the board starts.

Example:

config-set sd acceleration 1000

config-load

config-load

config-load load|unload|dump|checksum

load: will load the config cache - used for testing unload: will free the config cache - used for testing dump: will dump the config cache showing the checksums - used for testing checksum: will calculate and display the checksum for the given key

config-load dump

fire

fire

The following commands are available for testing lasers (prepend @ in pronterface or M1000 in other hosts):

  • fire nnn where nnn is 0-100 percentage of power (example fire 10 will turn on laser at 10%)
  • fire off turn off the test fire and return to automatic mode.

See the Laser module for more information.

And be very careful as this command will leave your laser on indefinitely, it is the only thing that can do that, and it is dangerous.

Host commands

These are commands designed to return information to a Host program like Smoopi. Some are instant and reply regardless of the state of the buffers.

$G return gcode state eg GC:G0 G54 G17 G21 G90 G94 M0 M5 M9 T0 F15000.0 S0.8000

$I same as $G but sends no ok and is instant

$H Home

$J Xnnn Ynnn Znnn Snnn issue jog command, axis can be XYZABC optional S is scale of max_rate

$S switches return switch state(s) for the named switches

$X release ALARM state

$# returns the WCS states and values

? instantly returns the current running state, axis positions, feedrates and temperatures eg <Idle|MPos:0.0000,0.0000,470.7656,85.1522|WPos:0.0000,0.0000,470.5656|F:15000.0,279.0|T:22.2,0.0|B:22.2,0.0>

Stopping Smoothie


layout: default title: Stopping Smoothie —

Stopping Smoothie

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.


Stop Methods Comparison

Command G-code Movement Heaters File playing Recoverable Documentation
abort M26 Stops SDCARD print immediately Not affected Aborts Position maintained, file must be restarted Player
suspend M600 Stops once queue is empty Turned off (if option enabled) Paused, can be resumed Yes, with resume or M601 Player
Kill button M112 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 -

Detailed Method Descriptions

Abort Command (abort / M26)

Stops the execution of a file being played from SDCARD.

Behavior:

  • Completes the current G-code
  • Stops immediately after that
  • Discards the rest of the queued commands
  • Attempts to maintain the correct position after the abort
  • Heaters remain at their current state

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


Suspend Command (suspend / M600)

Suspends the execution of a file being played from SDCARD or being streamed from a host.

Behavior:

  • Stops once the movement queue is empty
  • All state is saved
  • Heaters turned off by default (configurable)
  • Jogging and extruding are allowed during suspension
  • Can be resumed with resume or M601

Use 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


Kill Button / M112

Emergency stop that instantly halts all operations.

Behavior:

  • If kill button pressed: Stops instantly
  • If M112 issued from host: Has to wait for the receive buffer to have room
  • All heaters turned off
  • File playing aborted
  • Position is lost
  • System enters Halt state until M999 is sent

Use Case: Emergency situations requiring immediate stop.

Recovery: No, position is lost. Homing will be required.

Documentation: Supported G-codes, Kill Button

Warning: Using the kill button or M112 will cause position loss. You must home all axes before continuing normal operation.

Control-X

Sends a control character to stop Smoothie instantly.

Behavior:

  • Works at any time, even when streaming
  • Same effect as the kill button
  • All heaters turned off
  • File playing aborted
  • Position is lost
  • System enters Halt state until M999 or $X is sent

Use Case: Emergency stop from terminal/console when streaming G-code.

Recovery: No, position is lost. Homing will be required.


Halt State

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.

Halt State Behavior

Halt State Indicators:
  • Play LED flashes
  • Any command issued from host gets a !! response (with a few exceptions)
  • PSU may be turned off if a PSU Switch is defined

Clearing Halt State

The Halt state can be cleared by:

  1. Issuing M999 from the host
  2. Holding the flashing kill button for 2 seconds
  3. Using the LCD panel (if equipped)

Using Buttons and Sensors

Tip: All stop commands can be triggered by a button or a sensor if a Switch module is configured to do so. This allows for physical emergency stop buttons or automatic stopping based on sensor conditions.

Best Practices

For Normal Operation

  • Use suspend/resume (M600/M601) for planned interruptions like filament changes
  • Use abort when you need to stop quickly but keep heaters on

For Emergencies

  • Use the kill button or Control-X for immediate emergency stops
  • Remember that position will be lost and homing will be required

Recovery After Emergency Stop

  1. Clear the Halt state with M999
  2. Home all axes before attempting further movement
  3. Check that heaters are at safe temperatures before proceeding
  4. Verify machine state before resuming work

Further Reading