Arduino ESP8266 as FTP client connect to Server

Hello I try to connect an ESP 8266 with an moisture sensor to my FTP Server. My FTP Server runs on the XMC4700 controller. Sadly the client can't connect to the Server.
With WinSCP everything runs as it should.

This is my code:

#include <ESP8266WiFi.h>
#include <LittleFS.h>
#include <FTPClient.h>
#include "Arduino.h"

#define SensorPin A0

float SensorValue=0;
int SensorValuePercent=0;
int SensorValuePercentArray[32]={0};
const int MinValue = 746;   //you have to change this
const int MaxValue = 290;   //you have to change this
int i=0; 

const char *ssid PROGMEM = "FRITZ!Box 7530 FQ";
const char *password PROGMEM = "*****";

File SENS2;

// tell the FTP Client to use LittleFS
FTPClient ftpClient(LittleFS);

// provide FTP servers credentials and servername
FTPClient::ServerInfo ftpServerInfo("ifx", "", "192.168.178.10",21);

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

    Serial.println(F("Inizializing FS..."));
    if (LittleFS.begin()){
        Serial.println(F("done."));
    }else{
        Serial.println(F("fail."));
    }
    
    // Get all information of your LittleFS
    FSInfo fs_info;
    LittleFS.info(fs_info);
 
    Serial.println("File sistem info.");
 
    Serial.print("Total space:      ");
    Serial.print(fs_info.totalBytes);
    Serial.println("byte");
 
    Serial.print("Total space used: ");
    Serial.print(fs_info.usedBytes);
    Serial.println("byte");
 
    Serial.print("Block size:       ");
    Serial.print(fs_info.blockSize);
    Serial.println("byte");
 
    Serial.print("Page size:        ");
    Serial.print(fs_info.totalBytes);
    Serial.println("byte");
 
    Serial.print("Max open files:   ");
    Serial.println(fs_info.maxOpenFiles);
 
    Serial.print("Max path lenght:  ");
    Serial.println(fs_info.maxPathLength);
 
    Serial.println();
 
    // Open dir folder
    Dir dir = LittleFS.openDir("/");
    // Cycle all the content
    while (dir.next()) {
        // get filename
        Serial.print(dir.fileName());
        Serial.print(" - ");
        // If element have a size display It else write 0
        if(dir.fileSize()) {
            File f = dir.openFile("r");
            Serial.println(f.size());
            f.close();
        }else{
            Serial.println("0");
        }
    }

  delay(5000);
    
  
  WiFi.begin(ssid, password);

  bool fsok = LittleFS.begin();
  Serial.printf_P(PSTR("FS init: %s\n"), fsok ? PSTR("ok") : PSTR("fail!"));

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.printf_P(PSTR("."));
  }
  Serial.printf_P(PSTR("\nConnected to %s, IP address is %s\n"), ssid, WiFi.localIP().toString().c_str());

  ftpClient.begin(ftpServerInfo);
}

enum consoleaction
{
  show,
  get,
  put,
  wait,
  format,
  list
};
consoleaction action = show;

String fileName;
bool transferStarted = false;
uint32_t startTime;

void loop()
{
  // this is all you need
  // make sure to call handleFTP() frequently
  ftpClient.handleFTP();
  GetSensorValue();  
  StoreData();



  //
  // Code below just to debug in Serial Monitor
  //
  if (action == show)
  {
    Serial.printf_P(PSTR("Enter 'F' to format, 'L' to list the contents of the FS, 'G'/'P' + File to GET/PUT from/to FTP Server\n"));
    action = wait;
  }
  else if (action == wait)
  {
    if (transferStarted )
    {
      const FTPClient::Status &r = ftpClient.check();
      if (r.result == FTPClient::OK)
      {
        Serial.printf_P(PSTR("Transfer complete, took %lu ms\n"), millis() - startTime);
        transferStarted = false;
      }
      else if (r.result == FTPClient::ERROR)
      {
        Serial.printf_P(PSTR("Transfer failed after %lu ms, code: %u, descr=%s\n"), millis() - startTime, ftpClient.check().code, ftpClient.check().desc.c_str());
        transferStarted = false;
      }
    }

    if (Serial.available())
    {
      char c = Serial.read();
      if (c == 'F')
        action = format;
      else if (c == 'L')
        action = list;
      else if (c == 'G')
      {
        action = get;
        fileName = Serial.readStringUntil('\n');
        fileName.trim();
      }
      else if (c == 'P')
      {
        action = put;
        fileName = Serial.readStringUntil('\n');
        fileName.trim();
      }
      else if (!(c == '\n' || c == '\r'))
        action = show;
    }
  }

  else if (action == format)
  {
    startTime = millis();
    LittleFS.format();
    Serial.printf_P(PSTR("FS format done, took %lu ms!\n"), millis() - startTime);
    action = show;
  }

  else if ((action == get) || (action == put))
  {
    startTime = millis();
    ftpClient.transfer(fileName, fileName, action == get ?
                       FTPClient::FTP_GET_NONBLOCKING : FTPClient::FTP_PUT_NONBLOCKING);
    Serial.printf_P(PSTR("transfer started, took %lu ms!\n"), millis() - startTime);
    transferStarted = true;
    action = show;
  }

  else if (action == list)
  {
    Serial.printf_P(PSTR("Listing contents...\n"));
    uint16_t fileCount = listDir("", "/");
    Serial.printf_P(PSTR("%d files/dirs total\n"), fileCount);
    action = show;
  }
}

uint16_t listDir(String indent, String path)
{
  uint16_t dirCount = 0;
  Dir dir = LittleFS.openDir(path);
  while (dir.next())
  {
    ++dirCount;
    if (dir.isDirectory())
    {
      Serial.printf_P(PSTR("%s%s [Dir]\n"), indent.c_str(), dir.fileName().c_str());
      dirCount += listDir(indent + "  ", path + dir.fileName() + "/");
    }
    else
      Serial.printf_P(PSTR("%s%-16s (%ld Bytes)\n"), indent.c_str(), dir.fileName().c_str(), (uint32_t)dir.fileSize());
  }
  return dirCount;
}

void GetSensorValue()
{
  SensorValue = analogRead(SensorPin); 
  SensorValuePercent = map(SensorValue, MinValue, MaxValue, 0, 100);
  delay(250);
}

void StoreData()
{
    SensorValuePercentArray[i]=SensorValuePercent;
    i++;
    
    if (i==32)
    {
      i=0;
      //Serial.println("Data ready to store in FS");
      StoreDataFS();
      //CheckFS();
    } 
}

void StoreDataFS()
{
     SENS2 = LittleFS.open(F("/SENS2.txt"), "w");
     if (SENS2){
        //Serial.println("Write file content!");
        int y=0;
        
        while(y<32){
        SENS2.print(SensorValuePercentArray[y]);
        SENS2.print("\n");
        y++;
        }
        
        SENS2.close();
    }else{
        Serial.println("Problem on create file!");
    }
    Transfer();
} 

void Transfer()
{
  ftpClient.transfer("/SENS2.txt", "", FTPClient::FTP_PUT_NONBLOCKING); 
}

void CheckFS()
{
    SENS2 = LittleFS.open(F("/SENS2.txt"), "r");
    if (SENS2){
        Serial.println("Read file content!");
        /**
         * File derivate from Stream so you can use all Stream method
         * readBytes, findUntil, parseInt, println etc
         */
        Serial.println(SENS2.readString());
        SENS2.close();
    }else{
        Serial.println("Problem on read file!");
    }
    //delay(4000);
}

And this is the response:
Inizializing FS...
done.
File sistem info.
Total space: 2072576byte
Total space used: 16384byte
Block size: 8192byte
Page size: 2072576byte
Max open files: 5
Max path lenght: 32

MEASURE.txt - 0
SENS2.txt - 64
FS init: ok
.......
Connected to FRITZ!Box 7530 FQ, IP address is 192.168.178.44
Enter 'F' to format, 'L' to list the contents of the FS, 'G'/'P' + File to GET/PUT from/to FTP Server
transfer started, took 5 ms!
Enter 'F' to format, 'L' to list the contents of the FS, 'G'/'P' + File to GET/PUT from/to FTP Server
Transfer failed after 1520 ms, code: 220, descr=220

FTP response code 220 means the file was completely transferred and the server is ready for the next transfer. Given you FTP server complies to standards.

Remove the delay() call from GetSensorValue(). It doesn't help but slows down the loop() so that handleFTP() isn't called often enough (maybe).

Thanks that solved the problem