FTP Server using ESP32 with SD Card

Home Forums The libraries hosted on the site Simple FTP Server FTP Server using ESP32 with SD Card

Tagged: , ,

Viewing 5 reply threads
  • Author
    Posts
    • #24871
      Fikry
      Participant

        Hi Renzo….
        I want to create ESP32 as FTP Server with SD Card but it is failed. So, I will to explain what I have done as below.
        1. I have try it without SD Card so it means I use SPIFFS methode and you see the arduino code on picture 1 & its FtpServerKey.h file also on picture 8, picture 9, picture 10 and picture 11.
        2. Then I have setting in the FileZilla, you can see on picture 3, picture 4, picture 5, picture 6 and picture 7.
        3. Then I upload the arduino codes successfully, you can see on picture 2.
        4. Then I connect the FileZilla and the directory is successfully listing, you can see on picture 12.
        5. Then I try to upload and download the file is success, you can see on picture 13 and picure 14.
        6. After that I try using SD Card and I edit the arduino code, you can see on picture 15.
        7. Then I also change #define DEFAULT_STORAGE_TYPE_ESP32 STORAGE_SPIFFS with #define DEFAULT_STORAGE_TYPE_ESP32 STORAGE_SD in FtpServerKey.h file, you can see on picture 16.
        8. Then I upload the arduino codes successfully, you can see on picture 17.
        9. Setting’s FileZilla is same as before, so connect it directly. the directory is successfully listing, you can see on picture 18.
        10. After that, I try to download and upload the file but it was unsuccessful.

        Can you assit me to solve this, maybe there is something wrong with arduino code or anything ? Thank you in advanced. All picture I attached in 1 pdf file (Discuss.pdf)

      • #27715
        masiur
        Participant

          Using ESP32 DevkitV1 with Micro SD card
          using
          https://github.com/xreef/SimpleFTPServer/blob/master/examples/Arduino_esp32_SD/Arduino_esp32_SD.ino

          Modify FtpServerKey.h file
          #define DEFAULT_STORAGE_TYPE_ESP32 STORAGE_SD

          modify Arduino code:
          –> change ssid & password
          –>and below code
          SPI.begin(18, 19, 23, 5); //SCK, MISO, MOSI,SS
          if (SD.begin(5, SPI)) {

          OK for:
          –>show SD card all folder and file
          –>Download file from ESP32 FTP Server(SD Card) is OK

          Problem:Upload to ESP32 FTP Server not possible.
          Using FileZilla Client (i also use other FTP Client software WinSCP)
          FileZilla Client config:
          Protocol:FTP
          Host:192.168.0.101 Port:21
          Encryption:only use plain FTP(insecure)
          Login Type:Normal
          User:My ESP32 FTP server user
          Password:My ESP32 FTP server password

          Error for Upload:
          Status: Connecting to 192.168.0.101:21…
          Status: Connection established, waiting for welcome message…
          Status: Plain FTP is insecure. Please switch to FTP over TLS.
          Status: Logged in
          Status: Retrieving directory listing…
          Status: Directory listing of “/” successful
          Status: Starting upload of D:\test1.txt
          Command: TYPE A
          Response: 200 TYPE is now ASCII
          Command: PASV
          Response: 227 Entering Passive Mode (192,168,0,101,195,89)
          Command: STOR test1.txt
          Error: Disconnected from server: ECONNABORTED – Connection aborted
          Error: File transfer failed
          Status: Connecting to 192.168.0.101:21…
          Status: Connection established, waiting for welcome message…
          Status: Plain FTP is insecure. Please switch to FTP over TLS.
          Status: Logged in
          Status: Starting upload of D:\test1.txt
          Status: Retrieving directory listing of “/”…
          Command: TYPE I
          Response: 200 TYPE is now 8-bit binary
          Command: PASV
          Response: 227 Entering Passive Mode (192,168,0,101,195,89)
          Command: MLSD
          Response: 150 Accepted data connection to port 50009
          Response: 226-options: -a -l
          Response: 226 5 matches total
          Command: TYPE A
          Response: 200 TYPE is now ASCII
          Command: PASV
          Response: 227 Entering Passive Mode (192,168,0,101,195,89)
          Command: STOR test1.txt
          Error: Disconnected from server: ECONNABORTED – Connection aborted
          Error: File transfer failed
          Status: Connecting to 192.168.0.101:21…
          Status: Connection established, waiting for welcome message…
          Status: Plain FTP is insecure. Please switch to FTP over TLS.
          Status: Logged in
          Status: Starting upload of D:\test1.txt
          Status: Retrieving directory listing of “/”…
          Command: TYPE I
          Response: 200 TYPE is now 8-bit binary
          Command: PASV
          Response: 227 Entering Passive Mode (192,168,0,101,195,89)
          Command: MLSD
          Response: 150 Accepted data connection to port 50009
          Response: 226-options: -a -l
          Response: 226 5 matches total
          Command: TYPE A
          Response: 200 TYPE is now ASCII
          Command: PASV
          Response: 227 Entering Passive Mode (192,168,0,101,195,89)
          Command: STOR test1.txt
          Error: Connection timed out after 20 seconds of inactivity
          Error: File transfer failed

          Can you help me. 6 day lot of thing try but not work. 🙁

        • #28631
          lsdlsd88
          Participant

            I think I have a similar issue.

            mega2560 with w5100 shield.

            using the example in simple ftp server, Arduino Ethernet, SD or SDFAT, client: tried everything.

            dirlist ok, download ok, upload: nothing. no debug messages, client just disconnects for timeout.

          • #28638
            Renzo Mischianti
            Keymaster

              Hi all,
              Do you have to follow the guide to configure the FTP client?
              Bye RM

            • #32468
              lordwhiteley
              Participant

                hello,please can you tell me where to add the following lines ie which file do I alter?

                SPI.begin(18, 19, 23, 5); //SCK, MISO, MOSI,SS
                if (SD.begin(5, SPI)) {

                Thankyou

              • #32469
                Renzo Mischianti
                Keymaster

                  Hi,
                  you can find an example here.

                  Check also the documentation here.
                  FTP Server using ESP32 with SD Card

                  Bye Renzo

                  • #32470
                    lordwhiteley
                    Participant

                      So do you just add the following section of code…

                      SPI.begin(18, 19, 23, 5); //SCK, MISO, MOSI,SS
                      if (SD.begin(5, SPI)) {

                      into the Arduino_esp32_SD.ino file then?

                      Any particular section?

                      Many thanks in advance 🙂

                      • This reply was modified 5 months, 3 weeks ago by lordwhiteley.
                    • #32478
                      Renzo Mischianti
                      Keymaster

                        Put in substitution of the original SD.begin declaration.
                        Bye Renzo

                  Viewing 5 reply threads
                  • You must be logged in to reply to this topic.
                  Exit mobile version