Which pin configuration are you using for the Nano ESP32 ?
See https://docs.arduino.cc/tutorials/nano-esp32/pin-setup/