2 stepper motor accelStepper help

I need help with a project to control 2 stepper motors with a nodemcu, I already looked at all the topics already open and none helped me to solve this problem. When I test the code outside the blynk it works correctly, but as soon as I use the parameters for blynk no engine works.
I already checked the hardware and they are ok. I realize that when I press the V1 button, the engine energizes, but it does not take the steps I commanded. it feels like not giving time for everything stated in V1 .
1- NodeMCU
2- 2 DRV8825
3- 4 Push button (end of course)
4- power supply 3A
5- resistors pull down
6- 2 nema 17

  //****************************BLYNK*************************
#include <SoftwareSerial.h>
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
  char auth[] = "****";
  char ssid[] = "***";
  char pass[] = "***";
  
  //****************************MOTOR***************************
#include <AccelStepper.h>
  #define DIR 14          //D5                       //porta direção janela
   #define STEP 12        //D6                      //porta passos janela
      #define DIR2 4      //D2                     //porta direção cortina
         #define STEP2 0  //D3                    //porta passos cortina
          const int dist  = 1000;                 //Distancia que irá percorrer em passos janela
          const int dist2 = 1000;                //Distancia que irá percorrer em passos cortina
          const int velo  = 200;               // velocidade da janela
          const int velo2 = 200;              //velocidade da cortina
          const int acel  = 100;             //aceleração janela
          const int acel2  = 100;            //aceleração cortina
          
 //******************JANELA******************
const int fimfechar = 2;        //D4       fim de curso sensor, pino no +vcc para detectar fim de curso
  const int fimabrir = 5;       //D1         fim de curso quando abrir
    const int liberar = 1;     //TX        desabilita driver
    
  //******************CORTINA******************
const int fimfechar2 = 15;      //D8       fim de curso sensor, pino no +vcc para detectar fim de curso
  const int fimabrir2 = 13;     //D7         fim de curso quando abrir
      const int liberar2 = 16; //D0        desabilita driver    
                         
  //***************************INTERRUPT*********************
void ICACHE_RAM_ATTR fimdecursoabrir();                      //prioridade
      void ICACHE_RAM_ATTR fimdecursofechar();              //prioridade
          void ICACHE_RAM_ATTR fimdecursoabrir2();         //prioridade
               void ICACHE_RAM_ATTR fimdecursofechar2();  //prioridade
               
 //******************************LIBRARY********************   
AccelStepper stepper1(AccelStepper::DRIVER, STEP,  DIR);
AccelStepper stepper2(AccelStepper::DRIVER, STEP2, DIR2);
BlynkTimer timer;

//*****************************FECHAR JANELA******************************** 
 
BLYNK_WRITE(V0){                                    //DIGITAL V0 BLYNK
     
    int fechar = param.asInt();                    // armazena em fechar, o valor do botao 
    int ifimfechar = digitalRead(fimfechar);      //armazena o valor do fim de curso fechar em ifimfechar
    
    if ((fechar == LOW) && (ifimfechar == LOW))    //condição para fechamento da janela
    {                                                           
    digitalWrite(liberar, LOW);                           //Habilita o drive para acionar o motor
      stepper1.moveTo(dist);                                   // Irá mover o valor declarado em "dist"
        stepper1.run();
         timer.setTimeout(2000L, Acaofechar);                 //aguarda 2 segundos e desativa o drive   
    }       
     }
     void Acaofechar(){
       digitalWrite(liberar, HIGH);                    //Desabilita o driver
         Blynk.virtualWrite(V4,"fechou");                 //Indica no celular atravez do display V3 que a janela fechou
           }
 
//*****************************ABRIR JANELA********************************             
 BLYNK_WRITE(V1){                                 //DIGITAL V1 NO BLYNK
    
  int abrir = param.asInt();                       // Armazena em abrir, o valor do botão 
  int ifimabrir = digitalRead(fimabrir);          //Armazena o valor do fim de curso abrir em ifimmabrir

  if((abrir == LOW) &&    (ifimabrir == LOW))    //condição para abertura da janela
    {
                                                   // o motor dará 100 passos em modo 1 para 360º sentido anti-horário *******ABRIR JANELA********
    digitalWrite(liberar, LOW);                  //Habilita o drive para acionar o motor
    stepper1.moveTo(-dist);                          // Irá mover o valor declarado em "dist"
    stepper1.run();
    timer.setTimeout(2000L, Acaoabrir);         //aguarda 2 segundos e desativa o drive 
        }    
   }
   void Acaoabrir(){
    digitalWrite(liberar, HIGH);                //Desabilita o driver
       Blynk.virtualWrite(V4,"ABriu");          //Indica no celular atravez do display V3 que a janela abriu
   }
 
 void fimdecursofechar(){ 
   int ifimfechar = digitalRead(fimfechar);  
     static bool fimfechar = HIGH;
       static unsigned long statecurse;  
  if ((millis() - statecurse)>100)  {
     digitalWrite (liberar , HIGH);
         Blynk.virtualWrite(V4,"PAREDE fechou");
           statecurse = millis();       
    }
  }
void fimdecursoabrir(){  
  int ifimabrir = digitalRead(fimabrir);  
     static bool fimabrir = HIGH;
       static unsigned long statecurse;  
   if ((millis() - statecurse)>100)  {
        digitalWrite (liberar , HIGH);
           Blynk.virtualWrite(V4,"PAREDE ABRIU");
              statecurse = millis();      
   }
}

//**********************************FECHAR CORTINA**********************************************************************************
  
BLYNK_WRITE(V2){                                    //DIGITAL V2 BLYNK
     
    int fechar2 = param.asInt();                    // armazena em fechar, o valor do botao 
    int ifimfechar2 = digitalRead(fimfechar2);      //armazena o valor do fim de curso fechar em ifimfechar
    
       
   if ((fechar2 == LOW) && (ifimfechar2 == LOW))    //condição para fechamento da janela
    {
                                                            // o motor dará 100 passos em modo 1 para 360º sentido horário ********FECHAR JANELA*******
    digitalWrite(liberar2, LOW);                           //Habilita o drive para acionar o motor
    stepper2.moveTo(dist);                                   // Irá mover o valor declarado em "dist"
    stepper2.run();
    timer.setTimeout(2000L, Acaofechar2);                  //aguarda 2 segundos e desativa o drive   
    }       
     }
     void Acaofechar2(){
       digitalWrite(liberar2, HIGH);                    //Desabilita o driver
       Blynk.virtualWrite(V4,"fechou!!");                 //Indica no celular atravez do display V3 que a janela fechou
      
     }
//*****************************ABRIR CORTINA******************************** 
   BLYNK_WRITE(V3){                                 //DIGITAL V3 NO BLYNK
    
  int abrir2 = param.asInt();                       // Armazena em abrir, o valor do botão 
  int ifimabrir2 = digitalRead(fimabrir2);          //Armazena o valor do fim de curso abrir em ifimmabrir

  if((abrir2 == LOW) &&    (ifimabrir2 == LOW))    //condição para abertura da janela
    {
                                                   // o motor dará 100 passos em modo 1 para 360º sentido anti-horário *******ABRIR JANELA********
    digitalWrite(liberar2, LOW);                  //Habilita o drive para acionar o motor
    stepper2.moveTo(-dist);                          // Irá mover o valor declarado em "dist"
    stepper2.run();
    timer.setTimeout(2000L, Acaoabrir2);         //aguarda 2 segundos e desativa o drive 
        }    
   }
   void Acaoabrir2(){
    digitalWrite(liberar2, HIGH);                //Desabilita o driver
       Blynk.virtualWrite(V4,"ABriu!!");          //Indica no celular atravez do display V3 que a janela abriu
   }
 
 void fimdecursofechar2(){
  int ifimfechar2 = digitalRead(fimfechar2);  
    static bool fimfechar2 = HIGH;
      static unsigned long statecurse2;
    if ((millis() - statecurse2)>100)  {
      digitalWrite (liberar2 , HIGH);
         Blynk.virtualWrite(V4,"cortina fechou");
           statecurse2 = millis();     
    }
  }

void fimdecursoabrir2(){  
  int ifimabrir2 = digitalRead(fimabrir2);  
     static bool fimabrir2 = HIGH;
        static unsigned long statecurse2;
     if ((millis() - statecurse2)>100)  {
      digitalWrite (liberar2 , HIGH);
         Blynk.virtualWrite(V4,"cortina abriu");
         statecurse2 = millis();       
   }
}


 
void setup()
{  
   Serial.begin(9600);
    Blynk.begin(auth, ssid, pass);
    pinMode(fimfechar,INPUT); 
    pinMode(fimabrir,INPUT);    
    pinMode(liberar,OUTPUT);
    digitalWrite(liberar,HIGH);
    attachInterrupt(digitalPinToInterrupt(fimabrir), fimdecursoabrir, RISING);
    attachInterrupt(digitalPinToInterrupt(fimfechar), fimdecursofechar, RISING);
    
    stepper1.setMaxSpeed(velo);
    stepper1.setAcceleration(acel);
    stepper1.moveTo(dist);

    //*************************************CORTINA*************************************************
    pinMode(fimfechar2,INPUT); 
    pinMode(fimabrir2,INPUT);    
    pinMode(liberar2,OUTPUT);
    digitalWrite(liberar2,HIGH);
    attachInterrupt(digitalPinToInterrupt(fimabrir2), fimdecursoabrir2, RISING);
    attachInterrupt(digitalPinToInterrupt(fimfechar2), fimdecursofechar2, RISING);
    
    stepper2.setMaxSpeed(velo2);
    stepper2.setAcceleration(acel2);
    stepper2.moveTo(dist2);
}

void loop()
{
    Blynk.run();
        timer.run();
}


You can’t use these function calls inside ISR:

Blynk.virtualWrite(V4,"PAREDE fechou");
Blynk.virtualWrite(V4,"PAREDE ABRIU");
Blynk.virtualWrite(V4,"cortina fechou");
Blynk.virtualWrite(V4,"cortina abriu");

Set flags in ISR, then use timer to process Blynk.virtualWrite calls.

that would not be important is just to situate myself. I can take it off without a problem. but even without that the error persists.

an important thing.even if i decrease the maximum of the code the error continues.it is as if the node did not actually execute the action, is there anything to put as to wait for the action to execute? because if I press the V0 button several times the moto turns.but as if taking a very short step

#include <SoftwareSerial.h>
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
  char auth[] = "****";
  char ssid[] = "****";
  char pass[] = "****";

#define STEPPER1_DIR_PIN 14
#define STEPPER1_STEP_PIN 12

AccelStepper stepper1(AccelStepper::DRIVER, STEPPER1_STEP_PIN, STEPPER1_DIR_PIN);

void setup()
{  
  Serial.begin(9600);
    Blynk.begin(auth, ssid, pass);
    
    stepper1.setMaxSpeed(200.0);
    stepper1.setAcceleration(200.0);
    stepper1.moveTo(100);
    
    
}

void loop()
{
  Blynk.run();
        
 
}

BLYNK_WRITE(V0){                                    
        int fechar = param.asInt();
        if ( fechar == LOW) {
           if (stepper1.distanceToGo() == 0)
  stepper1.moveTo(-stepper1.currentPosition());
  stepper1.run();
        }
}

You also have to move the stepper control code out of BLYNK_WRITE(V0), just set a flag, then use timer to run the stepper. For example (you have to check if the stepper control logic is correct)

#include <SoftwareSerial.h>
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "****";
char ssid[] = "****";
char pass[] = "****";

#define STEPPER1_DIR_PIN 14
#define STEPPER1_STEP_PIN 12

AccelStepper stepper1(AccelStepper::DRIVER, STEPPER1_STEP_PIN, STEPPER1_DIR_PIN);
BlynkTimer timer;

bool fechar = false;

BLYNK_WRITE(V0) 
{ 
  if (!param.asInt()) 
  {
    fechar = true;
  }
}

void checkStatus()
{
  if (fechar) 
  {
    fechar = false;
    
    if (stepper1.distanceToGo() == 0)
      stepper1.moveTo(-stepper1.currentPosition());
      
    stepper1.run();
  }
}

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);

  stepper1.setMaxSpeed(200.0);
  stepper1.setAcceleration(200.0);
  stepper1.moveTo(100);
  // Check every 0.1s
  timer.setTimeout(100L, checkStatus);
}

void loop()
{
  Blynk.run();
  timer.run();
}

I tried to do as you suggested but there was no answer. engine did not move. the logic of the stepper motor is correct previously tested without the blynk.

if i use the millis () function would it solve? I used it very little until today. The problem would be to know the exact time it takes to perform the necessary steps. if setting a high value would prevent the engine from turning the other way?