This branch supports DuetWebControl / DuetSoftwareFramework 3.7. See MIGRATION-3.7.md for API changes, build/test instructions and the scope of hardware validation.
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.
- Open the Plugins page in Duet Web Control 3.7.
- Select Install plugin, choose the plugin ZIP and follow the installation steps.
- Start the plugin. Open ExecOnMcode under Preferences to edit commands.
Configuration is stored at 0:/sys/ExecOnMcode/ExecOnMcode.json. Opening the
panel only reads it; saving uploads the file and sends M1200 to reload filters.
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.
