Closed dibg closed 2 years ago
Sadly I have the same problem. As an interim solution you can simply create the stepper via Config and define the pin there.
void setup()
{
Serial.begin(115200);
stepperMotorServer = new ESPStepperMotorServer(ESPServerRestApiEnabled | ESPServerWebserverEnabled | ESPServerSerialEnabled);
stepperMotorServer->setWifiCredentials(wifiName, wifiSecret);
stepperMotorServer->setWifiMode(ESPServerWifiModeClient); //start the server as a wifi client (DHCP client of an existing wifi network)
stepperConfiguration = new ESPStepperMotorServer_StepperConfiguration(STEP_PIN, DIRECTION_PIN);
stepperConfiguration->setDisplayName("M1");
stepperConfiguration->setMicrostepsPerStep(1);
stepperConfiguration->setBrakeIoPin(5, 1);
stepperConfiguration->setStepsPerMM(200);
stepperConfiguration->setStepsPerRev(800);
stepperMotorServer->addOrUpdateStepper(stepperConfiguration);
stepperMotorServer->start();
}
Currently adding the following details to the configuration persistence logic:
nestedStepperConfig["breakPin"] = stepperConfig->getBrakeIoPin();
nestedStepperConfig["breakPinActiveState"] = stepperConfig->getBrakePinActiveState();
nestedStepperConfig["breakEngageDelay"] = stepperConfig->getBrakeEngageDelayMs();
nestedStepperConfig["breakReleaseDelay"] = stepperConfig->getBrakeReleaseDelayMs();
Pushed to master branch, not yet tested
Has been fixed in version v0.4.8
Describe the bug "Save current configuration to device" button doesn't save the "ESP IO pin for motor brake" setting. On the next boot this must be re entered. I use the brake functionality to enable/disable the power of the stepper to save power.
Environment the same with : https://github.com/pkerspe/ESP-StepperMotor-Server/issues/24
Extra INFO This is what api/comfig returns
And this is what i asked to be saved