Updated documentation of events

master
Gina Häußge 2013-05-27 01:03:53 +02:00
parent be99930021
commit 624630ac63
2 changed files with 61 additions and 63 deletions

61
octoprint/events.md Normal file
View File

@ -0,0 +1,61 @@
TODO: Add to config documentation
There are two types of event handlers at the moment:
* ''systemCommandTrigger'': invokes an external command without waiting for the result
* ''gcodeCommandTrigger'': sends some gcode to the printer. Separate multiple commands with a comma
Example:
events:
systemCommandTrigger:
enabled: True
subscriptions:
- event: Disconnected
command: python ~/growl.py -t mygrowlserver -d "Lost connection to printer" -a OctoPrint -i http://rasppi:8080/Octoprint_logo.png
- event: PrintStarted
command: python ~/growl.py -t mygrowlserver -d "Starting _FILE_" -a OctoPrint -i http://rasppi:8080/Octoprint_logo.png
- event: PrintDone
command: python ~/growl.py -t mygrowlserver -d "Completed _FILE_" -a OctoPrint -i http://rasppi:8080/Octoprint_logo.png
gcodeCommandTrigger:
enabled: True
subscriptions:
- event: Connected
command: M115,M17 printer connected!,G28
command values support the following dynamic tokens:
* ''%(data)s'': the data associated with the event (not all events have data, when they do, it's often a filename)
* ''%(filename)s'': filename of the current print (not always the same as _DATA_ filename)
* ''%(progress)s'': the progress of the print in percent
* ''%(zheight)s'': the current Z position of the head
* ''%(now)s'': the date and time of the event in ISO 8601
Available Events:
* ''Startup'': the server has started
* ''Connected'': the server has connected to the printer (data is port and baudrate)
* ''Disconnected'': the server has disconnected from the printer
* ''ClientOpen'': a client has connected to the web server
* ''ClientClosed'': a client has disconnected from the web server
* ''PowerOn'': the GCode has turned on the printer power via M80
* ''PowerOff'': the GCode has turned on the printer power via M81
* ''Upload'': a gcode file upload has been uploaded (data is filename)
* ''LoadStart'': a gcode file load has started (data is filename)
* ''LoadDone'': a gcode file load has finished (data is filename)
* ''PrintStarted'': a print has started
* ''PrintFailed'': a print failed
* ''PrintDone'': a print completed successfully
* ''Cancelled'': the print has been cancelled via the cancel button
* ''Home'': the head has gone home via G28
* ''ZChange'': the printer's Z-Height has changed (new layer)
* ''Paused'': the print has been paused
* ''Waiting'': the print is paused due to a gcode wait command
* ''Cooling'': the GCode has enabled the platform cooler via M245
* ''Alert'': the GCode has issued a user alert (beep) via M300
* ''Conveyor'': the GCode has enabled the conveyor belt via M240
* ''Eject'': the GCode has enabled the part ejector via M40
* ''CaptureStart'': a timelapse image is starting to be captured (data is image filename)
* ''CaptureDone'': a timelapse image has completed being captured (data is image filename)
* ''MovieDone'': the timelapse movie is completed (data is movie filename)
* ''EStop'': the GCode has issued a panic stop via M112
* ''Error'': an error has occurred (data is error string)

View File

@ -1,63 +0,0 @@
Add to the "system:" section of config.yaml
There are two types of event handlers at the moment:
system: invokes an external command without waiting for the result
gcode: sends some gcode to the printer. Separate multiple commands with a comma
Example:
system:
events:
- event: Connected
type: gcode
command: M115,M17 printer connected!,G28
- event: Disconnected
type: system
command: python ~/growl.py -t mygrowlserver -d "Lost connection to printer" -a OctoPrint -i http://rasppi:8080/Octoprint_logo.png
- event: PrintStarted
type: system
command: python ~/growl.py -t mygrowlserver -d "Starting _FILE_" -a OctoPrint -i http://rasppi:8080/Octoprint_logo.png
- event: PrintDone
type: system
command: python ~/growl.py -t mygrowlserver -d "Completed _FILE_" -a OctoPrint -i http://rasppi:8080/Octoprint_logo.png
command values support the following dynamic tokens:
_DATA_ - the data associated with the event (not all events have data, when they do, it's often a filename)
_FILE_ - filename of the current print (not always the same as _DATA_ filename)
_LINE_ - the current GCode line
_PROGRESS_ - the percent complete
_ZHEIGHT_ - the current Z position of the head
_NOW_ - the date and time of the event
Available Events:
Startup -- the server has started
Connected -- the server has connected to the printer (data is port and baudrate)
Disconnected -- the server has disconnected from the printer
ClientOpen -- a client has connected to the web server
ClientClosed -- a client has disconnected from the web server
PowerOn -- the GCode has turned on the printer power via M80
PowerOff -- the GCode has turned on the printer power via M81
Upload -- a gcode file upload has been uploaded (data is filename)
LoadStart -- a gcode file load has started (data is filename)
LoadDone -- a gcode file load has finished (data is filename)
PrintStarted -- a print has started (data is filename)
PrintFailed -- a print failed (data is filename)
PrintDone -- a print completed successfully (data is filename)
Cancelled -- the print has been cancelled via the cancel button (data is filename)
Home -- the head has gone home via G28
ZChange -- the printer's Z-Height has changed (new layer)
Paused -- the print has been paused
Waiting -- the print is paused due to a gcode wait command
Cooling -- the GCode has enabled the platform cooler via M245
Alert -- the GCode has issued a user alert (beep) via M300
Conveyor -- the GCode has enabled the conveyor belt via M240
Eject -- the GCode has enabled the part ejector via M40
CaptureStart -- a timelapse image is starting to be captured (data is image filename)
CaptureDone -- a timelapse image has completed being captured (data is image filename)
MovieDone -- the timelapse movie is completed (data is movie filename)
EStop -- the GCode has issued a panic stop via M112
Error -- an error has occurred (data is error string)