Controlling a stepper motor via NodeMCU + L293DD based motor shield

Following this tutorial: https://www.instructables.com/id/Motorized-WiFi-IKEA-Roller-Blind/

I have a NodeMCU v1.0 (ESP-12E) board together with a ESP-12E Motor Shield and a 28BYJ-48 stepper motor.

The LUA-Code from the tutorial works, but flashing the NodeMCU using the flashing tools provided by the tutorial & writing code in LUA is cumbersome.

Therefore, I would like to use the Arduino IDE to program the board in C++. However, I cannot seem to get it to work, using the basic Stepper library provided by the Arduino IDE. I am using pins 1,2,3,4 as well as 2038 steps per revolution and 15 RPM.

However, when trying to move the motor, the board is constantly crashing. Can someone help me out?

This is the code:

#include <Stepper.h>

bool stepped = false;
const int stepsPerRevolution = 2038;

Stepper myStepper(stepsPerRevolution, 1,  3,  2,  4);

void setup() {
  Serial.begin(74880);
  myStepper.setSpeed(15);
  Serial.println("UP");
}

void loop() {
  if (!stepped)
  {
    Serial.println("stepping ...");
    myStepper.step(stepsPerRevolution);
    stepped = true;
  }
}

How is the motor powered? Can you post a schematic of the project? Include all components and power supplies.

Currently, the motor is powered from the USB cable plugged into the NodeMCU. This worked when using the LUA firmware.

I also have an external power supply with 9V in place, which is connected to the motor shield. I just tried using the 9V as power source, it will actually make the motor spin, but still result in a crash loop.

The code I am using now (tried to use the CheapStepper library):

#include <CheapStepper.h>

const int stepsPerRevolution = 2048;

CheapStepper motor(D1, D3, D2, D4);

void setup() {
  Serial.begin(74880);

  motor.setTotalSteps(stepsPerRevolution);
  motor.setRpm(17);

  Serial.println("stepping ...");
  motor.move(true, stepsPerRevolution);
}