ExecOnMcode is a SBC plugin for DuetSoftwareFramework and based on dsf-python to run commands on user-defined M-Codes.
This plugin is based on the original idea from wilriker's execonmcode.
It provides M1200 M-Code which is used to update the interception filters.
Others M-Codes and related commands can be added by editing the ExecOnMcode.json
file located in System directory and then issuing M1200
(or restarting the plugin) to update the interception filters.
Command arguments can be passed from G-Code parameters, e.g: when issuing Mxxx "arg1 arg2"
, the parameters arg1 arg2
will be appended as arguments to the command triggered by Mxxx
.
- Go on the
Plugins
Tab of Duet Web Control. - Select
External plugins
. - Click on Upload System Files and select the plugin zip archive.
- Follow the on-screen instructions to install the plugin.
- Click on the
Start
button to start the plugin. - ExecOnMcode entry should appears under the Settings tab of DWC.
As the plugin runs under dsf user on the system, the command you wish to run using ExecOnMcode should be allowed to be run from that user.
If for some reason you want to go beyond that limitation, create a 010_dsf-nopasswd
file into /etc/sudoers.d/
with the following content : dsf ALL=(ALL) NOPASSWD: ALL
Then use sudo
with the command you wish to run using ExecOnMcode.