Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Luis_Pereira
    Participant

      Hi,

      First of all, thank you very much for your quick response.
      The setLocalIp function placed before or after the server begin did not solve it, in the end I noticed that on FtpServer.cpp on line localIp = NET_CLASS.localIP(); always set the local IP to 0.0.0.0, as if the setLocalIp made no diference…not sure why, doesn’t make sense. So I forced it, right after localIp = NET_CLASS.localIP(); I placed localIp=IPAddress (192, 168, 4, 1); and that solved it in a very dirty way.

      To make it STA and AP proof, In FtpServer.h I changed the function begin to:
      begin( const char * _user, const char * _pass, bool AP=false ,const char * welcomeMessage = "Welcome to Simply FTP server");
      , and in FtpServer.cpp changed:
      localIp = NET_CLASS.localIP(); toif(!AP)localIp = NET_CLASS.localIP();else localIp=WiFi.softAPIP();.

      This way the FTP server works on both STA and AP now, just passing true or false on the server.begin.
      Surely the fix did not require all this trouble but I just couldn’t figure out why the setLocalIp wasn’t doing the job =\

      Anyway, it’s solved somehow, thank you very much for your help and libraries.

      Cheers, Luís Pereira.

      Luis_Pereira
      Participant

        (Not sure why but my post disappeared after editing, sorry in advance if this results in duplicated post)
        Hi
        Has anyone managed to have Esp32 with Access point+FTP on SD card storage?
        I have been using Esp32 with STA mode+FTP on SD card storage for a while, and it works perfectly both ways (upload, download), but now I need to do it in AP mode, and aparently there is a problem with fetching the SD file list after the connection is made, while on STA mode Filezilla prints this after connection:

        Status:	Connecting to 192.168.1.107: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:	Retrieving directory listing of "/"...
        Status:	Directory listing of "/" successful

        On the AP mode Filezilla prints this:

        Status:	Connecting to 192.168.4.1: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...
        Command:	PWD
        Response:	257 "/" is your current directory
        Command:	TYPE I
        Response:	200 TYPE is now 8-bit binary
        Command:	PASV
        Response:	227 Entering Passive Mode (0,0,0,0,195,89)
        Command:	MLSD
        Error:	The data connection could not be established: WSAEADDRNOTAVAIL - Cannot assign requested address
        Response:	425 No data connection
        Error:	Failed to retrieve directory listing

        On the serial monitor on arduino IDE, from boot and connection start I get:

        ets Jul 29 2019 12:21:46
        
        rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
        configsip: 0, SPIWP:0xee
        clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
        mode:DIO, clock div:1
        load:0x3fff0030,len:1344
        load:0x40078000,len:13516
        load:0x40080400,len:3604
        entry 0x400805f0
        Set AP named:ESP32
        AP IP address: 192.168.4.1
        Card Mount Successful.
        SD opened!
        Listing directory: /
         DIR : System Volume Information
         DIR : Data
         FILE: .dropbox.device SIZE: 56
         FILE: Backup_dongle.txt SIZE: 370
         FILE: settings.txt SIZE: 368
        NOT ANONYMOUS
        esp32
         Ftp server waiting for connection on port 21
         Client connected!
        >>>>>>>>>>>>>>> _callback 0 1 1
        CONNECTED
        -U-S-E-R- -e-s-p-3-2-
        -
        Command is: USER
        USER: esp32 esp32
        -P-A-S-S- -e-s-p-3-2-
        -
        Command is: PASS
         Authentication Ok. Waiting for commands.
        -O-P-T-S- -U-T-F-8- -O-N-
        -
        Command is: OPTS
        200 OK, UTF8 ON
        -P-W-D-
        -
        Command is: PWD
        -T-Y-P-E- -I-
        -
        Command is: TYPE
        -P-A-S-V-
        -
        Command is: PASV
         Connection management set to passive
         Listening at 0.0.0.0:50009
        -M-L-S-D-
        -
        Command is: MLSD
        List of file!!

        I’m sending the code I’m using for both STA or AP mode, depending onthe commented section on the setup(). Also, I’m using arduino IDE 1.8.19 and esp32 board version 2.0.3.
        STA and AP code attached.

        Can anyone give me a haned please, any tips are welcome.
        Thank you.

        Cheers, Luís Pereira.

        Attachments:
        You must be logged in to view attached files.
        Luis_Pereira
        Participant

          Hi
          Has anyone managed to have Esp32 with Access point+FTP on SD card storage?
          I have been using Esp32 with STA mode+FTP on SD card storage for a while, and it works perfectly both ways (upload, download), but now I need to do it in AP mode, and aparently there is a problem with fetching the SD file list after the connection is made, while on STA mode Filezilla prints this after connection:

          Status:	Connecting to 192.168.1.107: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:	Retrieving directory listing of "/"...
          Status:	Directory listing of "/" successful

          On the AP mode Filezilla prints this:

          Status:	Connecting to 192.168.4.1: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...
          Command:	PWD
          Response:	257 "/" is your current directory
          Command:	TYPE I
          Response:	200 TYPE is now 8-bit binary
          Command:	PASV
          Response:	227 Entering Passive Mode (0,0,0,0,195,89)
          Command:	MLSD
          Error:	The data connection could not be established: WSAEADDRNOTAVAIL - Cannot assign requested address
          Response:	425 No data connection
          Error:	Failed to retrieve directory listing

          I’m sending the code I’m using for both STA or AP mode, depending onthe commented section on the setup(). Also, I’m using arduino IDE 1.8.19 and esp32 board version 2.0.3.
          STA and AP code attached.

          Can anyone give me a haned please, any tips are welcome.
          Thank you.

          Cheers, Luís Pereira.

          Attachments:
          You must be logged in to view attached files.
        Viewing 3 posts - 1 through 3 (of 3 total)