Lenteur client FTP entre deux requêtes

Bonjour à tous...
J'avance sur mon projet mais j'ai un problème de lenteur du client FTP que je n'arrive pas à résoudre. A première vu je dirais que c'est du à la librairie car rien dans mon code ne l'explique.
Lorsque je veut lire le contenu du fichier texte le client attend 6 secondes avant de faire une nouvelle requête. J'ai essayé sur mon serveur FTP ainsi que sur un serveur pro externe et le problème reste le même. Lorsque je modifie ma requête pour afficher le contenu du répertoire je n'ai pas de délai entre deux requêtes. Je ne parle pas du temps de téléchargement du fichier mais bien du temps entre la fin d'une requête et le début de la suivante.

Ma carte: UNO R3 + WiFi + ESP8266

Voici mon code

//#include "Arduino.h"
#include <ESP8266WiFi.h>
#include <FTPClient_Generic.h>

// Variables affichage moniteur série
char Affiche;
char Affiche2;
char Affiche3;
unsigned long Tempo;
unsigned long TempsFtp;

//// Variables client FTP
String list[128];
char fileName[] = "Foobar_Now_Playing.txt";

//// FTP A
//char ftp_server[] = "xxx.xxx.xxx.xxx";
////char ftp_server[] = "A";
//char ftp_user[] = "user";
//char ftp_pass[] = "pass";
//char dirName[] = "/";


//// FTP B
char ftp_server[] = "xxx.xxx.xxx.xxx";
char ftp_user[] = "user";
char ftp_pass[] = "pass";
char dirName[] = "/";

//// WiFi
//// WiFi A
char WIFI_SSID[] = "A";
char WIFI_PASS[] = "pass";
////// WiFi B
//char WIFI_SSID[] = "B";
//char WIFI_PASS[] = "pass";
////// WiFi C
//char WIFI_SSID[] = "C";
//char WIFI_PASS[] = "pass";

// FTPClient_Generic(char* _serverAdress, char* _userName, char* _passWord, uint16_t _timeout = 10000);
//FTPClient_Generic ftp (ftp_server, ftp_user, ftp_pass, 1000);
//FTPClient_Generic ftp (ftp_server, 21, ftp_user, ftp_pass, 10000);
FTPClient_Generic ftp (ftp_server, 12469, ftp_user, ftp_pass, 10000);

void setup(){
  Affiche = 0;
  Affiche2 = 0;
  Affiche3 = 0;
  Tempo = millis();
  TempsFtp = millis();
//  uint16_t ftp_port = 12469;
  Serial.begin(115200);
  Serial.println();

  WiFi.begin(WIFI_SSID, WIFI_PASS);
}

void loop() {
//// Si WiFi KO
  if (WiFi.status() != WL_CONNECTED){
    if (Affiche == 0){
      Serial.print("Connecting");
      Serial.print(".");
      Tempo = millis();
      Affiche = 1;
      Affiche2 = 0;
    }
    else {
      if (millis()-Tempo > 500){
        Serial.print(".");
        Tempo = millis();
      }
    }
  }

//// Si WiFi OK
  if (WiFi.status() == WL_CONNECTED){
    Affiche = 0;
    if (Affiche2 == 0){
      Serial.println();
      Serial.print("Connected, IP address: ");
      Serial.println(WiFi.localIP());
      Serial.print("SSID: ");
      Serial.println(WiFi.SSID());
      Affiche2 = 1;
      Serial.println("WiFi OK");
    }

//// Si FTP OK
    if(ftp.isConnected()==1){
      if(Affiche3 == 1){
        Serial.println("Connecté au serveur FTP");
        Affiche3 = 0;  
      }
//    if(millis()-TempsFtp > 300){

      //Change directory
      ftp.ChangeWorkDir(dirName);

//      //List directory content
//      ftp.InitFile(COMMAND_XFER_TYPE_ASCII);
//      ftp.ContentListWithListCommand("", list);
//
//      for (uint16_t i = 0; i < sizeof(list); i++){
//        if (list[i].length() > 0)
//        Serial.println(list[i]);
//      else
//      break;
//      }

      //Download the text file or read it
      String response = "";
//      ftp.InitFile(COMMAND_XFER_TYPE_ASCII);
      ftp.InitFile("Type A");
      ftp.DownloadString(fileName, response);
      Serial.println("The file content is: " + response);
      TempsFtp=millis();
//    }
    }
    else{
      Serial.println("Connection au serveur FTP");
      ftp.OpenConnection();
      if(ftp.isConnected()==1){
        Affiche3 = 1;
      }
    }
  }
}

Voici les logs du client FTP pour lister le contenu du repertoire et tout se passe bien.
Au besoin je pourrai aussi vous donner les logs de mon serveur FTP.

14:21:24.831 -> Connecting.......
14:21:28.691 -> Connected, IP address: 192.168.43.251
14:21:28.691 -> SSID: Makomo8
14:21:28.691 -> WiFi OK
14:21:28.691 -> Connection au serveur FTP
14:21:29.066 -> Connecté au serveur FTP
14:21:29.722 -> .
14:21:29.722 -> ..
14:21:29.722 -> Foobar_Now_Playing.txt
14:21:29.722 -> SBC_data
14:21:29.722 -> _Upload
14:21:29.722 -> completed
14:21:29.722 -> config
14:21:29.722 -> downloading
14:21:29.722 -> home
14:21:29.722 -> watch
14:21:30.410 -> .
14:21:30.410 -> ..
14:21:30.410 -> Foobar_Now_Playing.txt
14:21:30.410 -> SBC_data
14:21:30.410 -> _Upload
14:21:30.410 -> completed
14:21:30.410 -> config
14:21:30.410 -> downloading
14:21:30.410 -> home
14:21:30.410 -> watch
14:21:30.972 -> .
14:21:30.972 -> ..
14:21:30.972 -> Foobar_Now_Playing.txt
14:21:30.972 -> SBC_data
14:21:30.972 -> _Upload
14:21:30.972 -> completed
14:21:30.972 -> config
14:21:30.972 -> downloading
14:21:30.972 -> home
14:21:30.972 -> watch

...et les logs pour afficher le contenu du fichier texte

14:26:42.484 -> Connecting.......
14:26:46.405 -> Connected, IP address: 192.168.43.251
14:26:46.405 -> SSID: Makomo8
14:26:46.405 -> WiFi OK
14:26:46.405 -> Connection au serveur FTP
14:26:46.829 -> Connecté au serveur FTP
14:26:52.401 -> The file content is: etat<playing>Artist<Thievery CorporationArtist>Album<It Takes a ThiefAlbum>Titre<Holographic UniverseTitre>Bitrate<320Bitrate>Codec<MP3Codec>Duree<3:42Duree>
14:26:58.351 -> The file content is: etat<playing>Artist<Thievery CorporationArtist>Album<It Takes a ThiefAlbum>Titre<Holographic UniverseTitre>Bitrate<320Bitrate>Codec<MP3Codec>Duree<3:42Duree>
14:27:03.990 -> The file content is: etat<playing>Artist<Thievery CorporationArtist>Album<It Takes a ThiefAlbum>Titre<Holographic UniverseTitre>Bitrate<320Bitrate>Codec<MP3Codec>Duree<3:42Duree>
14:27:09.677 -> The file content is: etat<playing>Artist<Thievery CorporationArtist>Album<It Takes a ThiefAlbum>Titre<Holographic UniverseTitre>Bitrate<320Bitrate>Codec<MP3Codec>Duree<3:42Duree>
14:27:15.845 -> The file content is: etat<playing>Artist<Thievery CorporationArtist>Album<It Takes a ThiefAlbum>Titre<Holographic UniverseTitre>Bitrate<320Bitrate>Codec<MP3Codec>Duree<3:42Duree>

Si quelqu'un à une idée je suis preneur ^^
Bon après midi...

Voici les logs vu de mon serveur FTP. On voit bien que l'Arduino attend 5 secondes avant de lancer une nouvelle requête.

(000004)06/06/2022 17:03:19 - (not logged in) (192.168.1.40)> Connected on port 21, sending welcome message...
(000004)06/06/2022 17:03:19 - (not logged in) (192.168.1.40)> 220 .
(000004)06/06/2022 17:03:20 - (not logged in) (192.168.1.40)> USER Arduino
(000004)06/06/2022 17:03:20 - (not logged in) (192.168.1.40)> 331 Password required for arduino
(000004)06/06/2022 17:03:20 - (not logged in) (192.168.1.40)> PASS *******
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> 230 Logged on
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> CWD /
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> PASV
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,239,205)
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> Type A
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> 200 Type set to A
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000004)06/06/2022 17:03:20 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000004)06/06/2022 17:03:25 - arduino (192.168.1.40)> CWD /
(000004)06/06/2022 17:03:25 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000004)06/06/2022 17:03:25 - arduino (192.168.1.40)> PASV
(000004)06/06/2022 17:03:25 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,230,17)
(000004)06/06/2022 17:03:25 - arduino (192.168.1.40)> Type A
(000004)06/06/2022 17:03:25 - arduino (192.168.1.40)> 200 Type set to A
(000004)06/06/2022 17:03:26 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000004)06/06/2022 17:03:26 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000004)06/06/2022 17:03:26 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> CWD /
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> PASV
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,196,180)
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> Type A
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> 200 Type set to A
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000004)06/06/2022 17:03:31 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:38 - (not logged in) (192.168.1.40)> Connected on port 21, sending welcome message...
(000005)06/06/2022 17:03:38 - (not logged in) (192.168.1.40)> 220 .
(000005)06/06/2022 17:03:38 - (not logged in) (192.168.1.40)> USER Arduino
(000005)06/06/2022 17:03:38 - (not logged in) (192.168.1.40)> 331 Password required for arduino
(000005)06/06/2022 17:03:38 - (not logged in) (192.168.1.40)> PASS *******
(000005)06/06/2022 17:03:38 - arduino (192.168.1.40)> 230 Logged on
(000005)06/06/2022 17:03:38 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:03:38 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:03:39 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:03:39 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,255,134)
(000005)06/06/2022 17:03:39 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:03:39 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:03:39 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:03:39 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:39 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,250,74)
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:44 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:49 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:03:49 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:03:49 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:03:49 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,216,68)
(000005)06/06/2022 17:03:49 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:03:49 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:03:50 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:03:50 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:50 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,198,21)
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:03:55 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,246,237)
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:00 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,225,170)
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:06 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,251,236)
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:11 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:16 - arduino (192.168.1.40)> CWD /
(000005)06/06/2022 17:04:16 - arduino (192.168.1.40)> 250 CWD successful. "/" is current directory.
(000005)06/06/2022 17:04:16 - arduino (192.168.1.40)> PASV
(000005)06/06/2022 17:04:16 - arduino (192.168.1.40)> 227 Entering Passive Mode (192,168,1,16,214,22)
(000005)06/06/2022 17:04:17 - arduino (192.168.1.40)> Type A
(000005)06/06/2022 17:04:17 - arduino (192.168.1.40)> 200 Type set to A
(000005)06/06/2022 17:04:17 - arduino (192.168.1.40)> RETR Foobar_Now_Playing.txt
(000005)06/06/2022 17:04:17 - arduino (192.168.1.40)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000005)06/06/2022 17:04:17 - arduino (192.168.1.40)> 226 Successfully transferred "/Foobar_Now_Playing.txt"

Salut...
Personne n'a eu de souci avec cette librairie ou aurait une idée sur la cause de mon problème ?

Bonne journée ^^

je ne connais pas la bibliothèque FTPClient_Generic

avez vous essayé avec leur code d'exemple FTPClient_DownloadFile pour voir s'il y avait le même souci ?

Salut, oui j'ai essayé avec son code, uniquement la partie pour lire le contenu du fichier.
J'ai aussi essayé deux types differents d'InitFle ((COMMAND_XFER_TYPE_ASCII) et ("Type A")) mais sans changement.

Parcontre si tu connais une autre librairie je veux bien l'essayer.

    if(ftp.isConnected()==1){
      if((millis() - TempsReadFtp) > 500){
        FtpRead = 1;
        ftp.ChangeWorkDir(dirName);    //Change de répertoire

        //Lire le fichier
        String response = "";
        ftp.InitFile(COMMAND_XFER_TYPE_ASCII);
//        ftp.InitFile("Type A");
        ftp.DownloadString(fileName, response);
        FoobarRead = response;
        TempsReadFtp = millis();
      }
    }

je n'utilise le FTP que sur ESP32, jamais essayé de bibliothèque pour ESP8266 ni joué avec la carte "UNO R3 + WiFi + ESP8266" qui est assez exotique

et si vous faites 2 requêtes vous voyez le même délai ?

Oui, le délai est le même.
Mais maintenant que tu parles de l'ESP32 je vais surement en prendre un car je veux rajouter une télécommande BT, la suite du projet :smile:

j'ai utilisé esp32_ftpclient qui semble fonctionnelle

1 Like

Bonjour à tous ^^
Je viens de recevoir mon ESP32S et j'ai repris mon code. En utilisant la Librairie ESP32_FTPClient tout ce passe à merveille et je n'ai pas de temps d'attente entre deux requêtes FTP. Donc soit l'ESP8266 déconne (ce qui m'étonnerait) soit il y a un truc avec la librairie FTPClient_Generic (je penche plutôt pour ça mais je n'ai pas les compétences pour aller fouiller dans son code ^^).

Voici le code que j'utilise et les logs de mon serveur FTP

//ESP32S
//Programme pour se connecter au WiFi et au FTP pour lire les tags de Foobar dans un fichier .txt

#include <WiFi.h>
#include "ESP32_FTPClient.h"

//WiFi Livebox
#define WIFI_SSID "xxxx"
#define WIFI_PASS "xxxx"

//FTP MakomotoryP
char ftp_server[] = "xxxx.xxxx.xxxx.xxxx";
//uint16_t ftp_port = 21;
char ftp_user[] = "xxxx";
char ftp_pass[] = "xxxx";
//char dirName[] = "/";
char fileName[] = "Foobar_Now_Playing.txt";
//ESP32_FTPClient ftp (ftp_server, ftp_port, ftp_user, ftp_pass, 1000);
ESP32_FTPClient ftp (ftp_server, 21, ftp_user, ftp_pass, 1000);

//Variables affichage moniteur série - TROUVER UN AUTRE NOM !!!!!!
unsigned long TempoReadFtp;
int WifiRead, WifiSend, FtpRead, FtpSend;
String FoobarRead, FoobarSend;

void SendToSerial(){
  Serial.print("<");
  Serial.print(WifiSend);
  Serial.print("<");
  Serial.print(FtpSend);
  Serial.print("<");
  Serial.println(FoobarSend);
}


void setup() {
  TempoReadFtp = millis();
  WifiRead,  WifiSend, FtpRead, FtpSend = 0;
  FoobarRead, FoobarSend = "";
  
  Serial.begin(115200);
  Serial.println();

  //Initialisation du WiFi
  //L'ESP32S s'occupe de la reconnection automatique
  WiFi.begin(WIFI_SSID, WIFI_PASS);

  //Envoi de la première trame pour renseigner l'afficheur
  delay(1000);
  SendToSerial();
}


void loop() {
  //Si WiFi déconnecté
  if(WiFi.status() != WL_CONNECTED){
    WifiRead = 0;
    FtpRead = 0;
    FoobarRead = "";
  }

  //Si FTP Déconnecté
  if(ftp.isConnected()==0){
     FtpRead = 0;
     FoobarRead = "";
  }
  
  //Si WiFi connecté
  if (WiFi.status() == WL_CONNECTED){
    WifiRead = 1;

    //Si FTP Déconnecté
    if(ftp.isConnected()==0){
      FtpRead = 0;
      FoobarRead = "";
      ftp.OpenConnection();
    }

    //Si FTP connecté
    if((ftp.isConnected()==1)&&(millis()-TempoReadFtp)>=300){
      FtpRead = 1;
      //ftp.ChangeWorkDir(dirName);    //Change de répertoire

      //Lire le fichier
      String response = "";
      ftp.InitFile("Type A");
      ftp.DownloadString(fileName, response);
      FoobarRead = response;
      TempoReadFtp = millis();
    }
  }

  //Envoi sur le moniteur série
  if((WifiRead != WifiSend) || (FtpRead != FtpSend) || (FoobarRead != FoobarSend)){
    WifiSend = WifiRead;
    FtpSend = FtpRead;
    FoobarSend = FoobarRead;
    SendToSerial();
  }

}
Server offline.
Creating listen socket on port 21...
Server online
(000009)29/10/2022 10:53:45 - (not logged in) (192.168.1.13)> Connected on port 21, sending welcome message...
(000009)29/10/2022 10:53:45 - (not logged in) (192.168.1.13)> 220 .
(000009)29/10/2022 10:53:45 - (not logged in) (192.168.1.13)> USER Arduino
(000009)29/10/2022 10:53:45 - (not logged in) (192.168.1.13)> 331 Password required for arduino
(000009)29/10/2022 10:53:45 - (not logged in) (192.168.1.13)> PASS *******
(000009)29/10/2022 10:53:45 - arduino (192.168.1.13)> 230 Logged on
(000009)29/10/2022 10:53:45 - arduino (192.168.1.13)> SYST
(000009)29/10/2022 10:53:45 - arduino (192.168.1.13)> 215 UNIX emulated by FileZilla
(000009)29/10/2022 10:53:45 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:45 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:46 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:46 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:46 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:46 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,222,4)
(000009)29/10/2022 10:53:46 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:46 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:46 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:47 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:47 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:47 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:47 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:48 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:48 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,203,180)
(000009)29/10/2022 10:53:48 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:48 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:48 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,197,201)
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:50 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,239,150)
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:51 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,196,200)
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:53 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:54 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:54 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:54 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:54 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:55 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:55 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,246,175)
(000009)29/10/2022 10:53:55 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:55 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:55 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,195,84)
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:56 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:58 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:53:58 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:53:58 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:53:58 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:53:58 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:53:58 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,218,101)
(000009)29/10/2022 10:53:59 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:53:59 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:53:59 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,250,121)
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:54:00 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> CWD /
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> 250 CWD successful. "/" is current directory.
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> Type A
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> 200 Type set to A
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> PASV
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> 227 Entering Passive Mode (192,168,1,16,248,238)
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> RETR Foobar_Now_Playing.txt
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> 150 Opening data channel for file download from server of "/Foobar_Now_Playing.txt"
(000009)29/10/2022 10:54:02 - arduino (192.168.1.13)> 226 Successfully transferred "/Foobar_Now_Playing.txt"

Bonne journée.....

Bonne nouvelle
Merci d’être revenu documenter la situation

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.