That is a great question. I didn’t know the answer so I asked the AI and here’s what it came up with. It seems reasonably on point to me, but you never really know with AI generated stuff. At least it seems like a starting point to explore from:
The Issue: M3 Without a Speed Value (S) Won’t Toggle the output_pin
Looking directly at the OnOff::setState and OnOff::set_output source code:
MaslowCNC / Maslow_4 / firmware / FluidNC / src / Spindles / OnOffSpindle.cpp
void OnOff::setState(SpindleState state, SpindleSpeed speed) {
// ...
uint32_t dev_speed = mapSpeed(speed);
if (state == SpindleState::Disable) {
if (_zero_speed_with_disable) {
dev_speed = offSpeed();
The output_pin (Aux1/GPIO.48) only goes HIGH when dev_speed != 0. That means:
M3 alone (no S value, so speed defaults to 0) → pin stays LOW 
M3 S1000 (or any non-zero S value) → pin goes HIGH 
M5 → pin goes LOW 
Fixes / Things to Try
1.
Always include a speed value with M3
gcode
M3 S1000
This is the most direct fix. Any non-zero S value will work since the OnOff spindle only cares whether speed is zero or not.
2.
Double-check your YAML structure and spindle type name
The YAML must use the correct type key OnOff (capital O, capital O). Here’s a correct minimal example:
config.yaml
spindle:
OnOff:
output_pin: gpio.48
Your config snippet shows:
YAML
spindle:
on_off:
output_pin: gpio.48
**`on_off` (lowercase) is wrong.** The registered name in the firmware is `"OnOff"` (mixed case). If the type key doesn't match exactly, the spindle config won't load and the pin won't be claimed at all — which would explain why nothing changes.
3.
Confirm the spindle config actually loaded on boot
After uploading the YAML and rebooting, watch the serial/terminal startup log. You should see a line like:
Code
[MSG:INFO] OnOff Spindle Ena:NO_PIN Out:gpio.48 Dir:NO_PIN
If you don’t see this line, the spindle config didn’t parse correctly (likely the YAML key name issue above).
4.
Pin connector orientation — you’re right
You confirmed GPIO.48 works as an input for probing, so the pin is real and accessible. The 4-pin connector pinout you described (GND, 3.3V, Aux1, Aux2 top to bottom) is consistent with the Maslow 4 board design. No issue there.
5.
Note: GPIO.48 output is 3.3V logic level
The Aux pins output 3.3V logic (not 5V, not 12V). If your spindle controller requires a higher-voltage signal or a relay, you’ll need a level shifter or signal relay in between.
Summary
| Problem |
Likely Cause |
Fix |
| Nothing changes on M3 |
Speed was 0 (no S value) |
Use M3 S1000 |
| Config not loading |
YAML key on_off should be OnOff |
Fix YAML key to OnOff: |
| No startup log message |
Config parse failure |
Fix YAML + check serial log |
The most likely root cause is a combination of the YAML key name (on_off vs OnOff) and not passing a speed value with M3.