Site icon Renzo Mischianti

ESP8266 NodeMCU, SD CARD & SimpleFtpServer

Hello from France, First of all, thanks to Renzo for all his work. I have adapted one of Renzo's examples (Arduino_esp32_SD) to transfer files via FTP between an SD CARD and my PC. When I upload files to the SD CARD, everything works perfectly. However, if I download files from the SD CARD to the PC, the file is created in the destination directory, but it's empty. I use the SD / ESP8266WiFi / SimpleFTPServer libraries. I've tried this with several FTP clients and files of different sizes: the target file is always empty. I should add that I read the file on the SD CARD with this code:
File config_SD = SD.open("config.txt","r"); 
 if (!config_SD.available()) {
      while (config_SD.available()){
          Serial.println(config_SD.readStringUntil('\n')); 
      }
  }
 config_SD.close(); 
Could you please give me a hint? Thank you and have a nice day. Bruno
Exit mobile version