Stepper with Endstop - Endstop-Signal only once Stepper is stopped (GPIO/BinarySensor)

Hi everyone,

I’m using a stepper-motor with an Endstop. Everything is working fine individually, but while the stepper is running, the ESP32 does not detect, if the Endstop-Switch is turned on. Only once the stepper stops, the Signal from the Endstop-Switch is reportet.

Strangly enough: when the stepper is running, the ESP32 notices the change of the Endstop-Switch (Binary-Sensor) from On to Off. But the other way, the ESP32 does not notices the change, only once the stepper is stopped the Endswitch-State is reportet in the logs.

The Endswitch is connected normally open - so from off to on means that the GPIO is not connected to ground anymore.

Did someone have the same strange behaviour or can imagine, what’s the problem here?

Many greetings,
Chris

I think posting your config and logs may help in this instance. Links to hardware and wiring diagrams or descriptions may help too.