…and after that didn’t work out, using an onboard input on the 6x CNC Controller:
control:
reset_pin: gpio.2:pu:low
With either pin configuration, triggering the input (connecting the input to gnd) for only fractions of a second causes a reset as desired, but causes the controller to go into alarm over the reset_pin input being active on startup:
<Idle|MPos:0.000,0.000,0.000,0.000|Bf:15,256|FS:0,0|Ov:100,100,100|A:F> Grbl 3.9 [FluidNC v3.9.8 (wifi) ‘’ for help] [MSG:ERR: reset_pin is active at startup] Grbl 3.9 [FluidNC v3.9.8 (wifi) ‘’ for help] [MSG:ERR: reset_pin is active at startup] Grbl 3.9 [FluidNC v3.9.8 (wifi) ‘’ for help] [MSG:ERR: reset_pin is active at startup] [MSG:INFO: ALARM: Control Pin Initially On] ALARM:11 [MSG:INFO: ALARM: Control Pin Initially On] ALARM:11 [MSG:INFO: ALARM: Control Pin Initially On] ALARM:11 <Alarm|MPos:0.000,0.000,0.000,0.000|Bf:15,256|FS:0,0> [MSG:INFO: ALARM: Control Pin Initially On] ALARM:11 [MSG:INFO: ALARM: Control Pin Initially On] ALARM:11
Interesting. Not sure how you could put a delay on to give you time to let go of the reset button unless it was on the pre-reset side of the code. I know the buttons on the esp32 have a debounce cap, I guess now I know why?
I’m not sure what’s on the board for input debouncing. I think the simplest solution would be for the code to have a delay, at least for the reset input, to wait for the input(s) to stabilize on boot.
More than anything, I’m just surprised that something so simple doesn’t work. The docs say:
This section is used for control inputs. These are typically used with switches.
At least, unsurprisingly, the feed hold and cycle start inputs work as expected.
Hrm. Weird. I’m on v3.9.8. Mitch added a 1000ms delay on March 8.
bool Control::startup_check() {
bool ret = false;
for (auto pin : _pins) {
if (pin->get()) {
delay_ms(1000);
if (pin->get()) {
log_error(pin->legend() << " is active at startup");
ret = true;
}
}
}
return ret;
}