Stepper motor trouble

I’m trying to control a stepper motor with home assistant

the picture is what i referenced for wiring

I’m using this ESP32 which i know works with esp home because I’m using one for my printer temp sensor

the pin out on the board is as follows

the only changes i made to the wiring is the step and direction pins are going to pins 31 and 30 and I’m using a 12v power supply instead of a 9v battery

here is my Yaml

# Configure the stepper component
stepper:
  - platform: a4988
    id: dosing_pump
    step_pin: GPIO19
    dir_pin: GPIO18
    max_speed: 100 steps/s


# Create a switch or button to activate it
switch:
  - platform: template
    name: "Run Stepper"
    turn_on_action:
      - stepper.set_target:
          id: dosing_pump
          target: 1000 # Moves 1000 steps
    turn_off_action:
      - stepper.set_target:
          id: dosing_pump
          target: 0
                              

My switch shows up in home assistant but when i click on it the motor does not turn. the switch turns on for maybe a second or 2 and then turns it self back off

Good, 9V smoke alarm battery wouldn’t work in most of cases.
And even the 12V PSU has to have sufficient amp rating.

You can fix that by adding:
optimistic: true
to your template switch, but what’s the point? Why should the switch remain on when the target is already reached? I think button would be better approach. Or template cover.

This is the thing here.
Make sure step/dir are not swapped.
Ensure your board has enable pin pulled low and that you have jumper on rst/slp pins like on your image.
Give acceleration to your setup
acceleration: 100

ok i started playing around and tried a new code i found off google

stepper:
  - platform: a4988
    id: my_stepper
    step_pin: GPIO12
    dir_pin: GPIO14
    max_speed: 250 steps/s
    # Optional settings
    acceleration: 100
    deceleration: 100

number:
  - platform: template
    name: "Stepper Position"
    id: stepper_control
    min_value: -2000
    max_value: 2000
    step: 10
    set_action:
      then:
        - stepper.set_target:
            id: my_stepper
            target: !lambda "return x;"

i rewired it for the new pins and also swapped out the driver just incase

my power supply is rated for 5a

now when i plug in the 12v power supply i here a very faint whirring noise and when i change the value in HA it still does not move and the noise stops and never comes back

I believe you have to work with the hardware. Wiring error? Current pot set too low?

turned out to be the enable pin. it is supposed to be pulled low by default. but i had to do it via a jumper

That’s why I mentioned it.
Pololu has pulldown. Some AE board does not…