Searching for FTP Server example on Teensy 4.1 with QNEthernet

Hello guys,

Does anyone have an example of an FTP server running successfully with Teensy 4.1 and QNEthernet
successful running ?:confused:

I need an working library to upload an download files between the teensy and his sd card and a pc.

Best greetings..

electrolyt
 
I've been trying for 6 months to get an FTP server working with Teensy 4.1 and Adafruit Airlift Featherwing. Here's the code I have been trying to get to work. Hope this helps.



Code:
#include <SimpleFTPServer.h>
#include <SdFat.h>
#include <SdFatConfig.h>
#include <sdios.h>
#include <WiFiNINA.h>
#include <SPI.h>

    //Define WiFi Connections
    #define SPIWIFI       SPI
    #define SPIWIFI_SS    5
    #define ESP32_RESET   6
    #define SPIWIFI_ACK   9
    #define ESP32_GPIO0  -1
    
    
    //Define WiFi Credentials
    const char* ssid = "MATRIX";
    const char* pass = "rpentagon845psilly417";
    int status = WL_IDLE_STATUS;     // the Wifi radio's status

    //Define SD Card Object
    SdFat sd;

    //Define FTP Server Object
    FtpServer ftpSrv;

    // Use these with the Teensy 3.5 & 3.6 SD card
    #define SDCARD_CS_PIN    BUILTIN_SDCARD
    #define SDCARD_MOSI_PIN  11  // not actually used
    #define SDCARD_SCK_PIN   13  // not actually used

    // IP address of FTP server
    // if set to 0, use DHCP for the routeur to assign IP
    // IPAddress serverIp( 192, 168, 1, 40 );
    IPAddress serverIp( 192, 168, 1, 127 );  //This IP is the same IP given to Teensy by DHCP

    



void setup() {

  
    //Initialize serial and wait for port to open:
    Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

    // Set up the pins!
    WiFi.setPins(SPIWIFI_SS, SPIWIFI_ACK, ESP32_RESET, ESP32_GPIO0, &SPIWIFI);
    
    SPI.begin();
    
          
    String fv = WiFi.firmwareVersion();
 
    Serial.print("Firmware Version is ");
    Serial.println(fv);
    
  // attempt to connect to Wifi network:
    Serial.println("Wifi Begin");
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);
    Serial.println("...Connecting");
    
   
  }

    // you're connected now, so print out the data:
    Serial.print("You're connected to the network.");
    printCurrentNet();
    printWifiData();

  // Initialize the SD card
    SPI.setMOSI(SDCARD_MOSI_PIN);
    SPI.setSCK(SDCARD_SCK_PIN);
    Serial.println("Preparing to initialize SD Card");
  while (!(SD.begin(SDCARD_CS_PIN))) {
    // stop here if no SD card, but print a message
    Serial.println("SD Card Not Initialized");
    delay(500);
    }
    
    Serial.println("SD Card Initialized");


    //Initialize FTP Server
    Serial.println();
    Serial.println("Initializing FTP Server...");
    ftpSrv.begin("esp8266","esp8266");
    // ftpSrv.init( externalIp );
    //ftpSrv.init( IPAddress( 192, 168, 1, 195 ));
}

void loop() {
    ftpSrv.handleFTP();
}



void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      Serial.print("0");
    }
    Serial.print(mac[i], HEX);
    if (i > 0) {
      Serial.print(":");
    }
  }
    Serial.println();
}

void printWifiData() {
    // print your board's IP address:
    IPAddress ip = WiFi.localIP();
    Serial.print("IP Address: ");
    Serial.println(ip);
    Serial.println(ip);
  
    // print your MAC address:
    byte mac[6];
    WiFi.macAddress(mac);
    Serial.print("MAC address: ");
    printMacAddress(mac);
}

void printCurrentNet() {
    // print the SSID of the network you're attached to:
    Serial.print("SSID: ");
    Serial.println(WiFi.SSID());
  
    // print the MAC address of the router you're attached to:
    byte bssid[6];
    WiFi.BSSID(bssid);
    Serial.print("BSSID: ");
    printMacAddress(bssid);
  
    // print the received signal strength:
    long rssi = WiFi.RSSI();
    Serial.print("signal strength (RSSI):");
    Serial.println(rssi);
  
    // print the encryption type:
    byte encryption = WiFi.encryptionType();
    Serial.print("Encryption Type:");
    Serial.println(encryption, HEX);
    Serial.println();
}
 
I've got 2 posts on this forum asking for assistance and both have gotten over 50 views and not a single reply. I guess I'm not one of the cool kids. :)
 
Hi jhall0326,
Thank you for your reply. Your exempel sketch shows a connection for a ftp server via wifi. So the ftp server sketch is running on the Adafruit Airlift Featherwing ?
I am searching for a exampel that should run on a teensy with the lanport extension. Best case is using the great qnethernet library. All others ethernet libraries are often a little bit buggy.
Are you sure that your sketch is realistic ? The Featherwing bord in combination with the teensy and your Sketch confused me.

Greetings
Elektrolyt
 
I've ported and will create a new FTP_Server for Teensy 4.1 QNEthernet, as well as many other boards, using WiFi, Ethernet W5x00, ENC, etc.
Tested so far OK with QNEthernet, RP2040 W5x00, etc.

Will try to publish the new library within a week.
 
The new FTP_Server_Teensy41 has just been published to support Tensy 4.x using QNEthernet, NativeEthernet or W5x00 using Ethernet_Generic Library

It's currently supporting SD card, using SDFat. The LittleFS, other FS using (Q)SPI Flash will be added gradually.

Please check, test and report any issue.

Code:
Starting FTP_Server_SDFAT2 on TEENSY 4.1 with QNEthernet
FTP_Server_Teensy41 v1.0.0
Initializing SD card...
Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT32

Volume size (Kbytes): 31452672
Volume size (Mbytes): 30715

===============================
SDCard Initialization : done.
test.txt                                      1048702    22:42  April 29, 2022
foo.txt                                            13    00:00  January 1, 1980
datalog.bin                                  41943040    00:00  January 1, 2022
index.htm                                        3810    22:50  April 29, 2022
mydatalog.txt                                      10    22:24  April 9, 2022
edit.htm.gz                                      4116    20:15  March 13, 2022
CanadaFlag_1.png                                41214    20:15  March 13, 2022
CanadaFlag_2.png                                 8311    20:15  March 13, 2022
CanadaFlag_3.jpg                                11156    20:15  March 13, 2022
favicon.ico                                      1150    22:54  April 29, 2022
graphs.js.gz                                     1971    20:15  March 13, 2022
CanadaFlag_2_1.png                               8311    22:52  April 29, 2022
ESP_AT_WM_Lite.txt                               1547    22:51  April 29, 2022
done!

=========== USE_QN_ETHERNET ===========
Initialize Ethernet using static IP => IP Address = 192.168.2.241
FTP Server Credentials => account = teensy4x, password = ftp_test
[FTP]  Ftp server waiting for connection on port  21
[FTP]  Client connected!
USER teensy4x
PASS ftp_test
[FTP]  Authentication Ok. Waiting for commands.
SYST
DELE test.txt
PORT 192,168,2,30,169,133
[FTP]  Data IP set to  192.168.2.30 , Data port set to  43397
LIST
DELE datalog.bin
PORT 192,168,2,30,135,195
[FTP]  Data IP set to  192.168.2.30 , Data port set to  34755
LIST
PORT 192,168,2,30,165,55
[FTP]  Data IP set to  192.168.2.30 , Data port set to  42295
LIST
PORT 192,168,2,30,206,193
[FTP]  Data IP set to  192.168.2.30 , Data port set to  52929
RETR index.htm
[FTP]  Sending  index.htm
PORT 192,168,2,30,182,29
[FTP]  Data IP set to  192.168.2.30 , Data port set to  46621
STOR index1.htm
[FTP]  Receiving  index1.htm
[FTP]  Transfer completed in (ms)  250 , Speed (kbytes/s)  15
QUIT
[FTP]  Disconnecting client
[FTP]  Ftp server waiting for connection on port  21
 
Dear khoih-prog,

wow, that is a great work. :eek:
That`s exactly what i need.
I will test it, and will give you an report.

Thanks very much.
 
Dear khoih-prog,

i did some test and will report the situation. I am using the example sketch "FTP_Server_SDFAT2" with FileZilla V3.59.0 as FTP-Client. When the client connect the server in active transfer mode, is the sdcard with fileacess working. But when i configure the ftp-client to connect in passive mode, FileZilla is reporting that directory could not be received and the connection will be disconnected by Error "ECONNABORTED".
It would be great if both transfer modes where working.
Was it planed to be ?

I have a temporary start issue:
Sometimes i got only a small logging after restart of the teensy.
The example sketch, didn`t loggs always the files from the sdcard.
When i disconnect the usbcabel -> power off and connect the teensy again,
a new logg appers with the full logging including the files from the sd card.
See logg 2.

1. Logging:
Starting FTP_Server_SDFAT2 on TEENSY 4.1 with QNEthernet
FTP_Server_Teensy41 v1.0.0
Initializing SD card...
Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT32

Volume size (Kbytes): 30639104
Volume size (Mbytes): 29921

===============================
SDCard Initialization : done.
System Volume Information/

2. Logging:
Starting FTP_Server_SDFAT2 on TEENSY 4.1 with QNEthernet
FTP_Server_Teensy41 v1.0.0
Initializing SD card...
Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT32

Volume size (Kbytes): 30639104
Volume size (Mbytes): 29921

===============================
SDCard Initialization : done.
System Volume Information/
WPSettings.dat 12 13:40 December 28, 2021
IndexerVolumeGuid 76 23:16 December 28, 2021
Konfig.ini 699 17:49 December 22, 2021
PAGE2.HTM 18384 18:51 April 14, 2022
Para.ini 868 00:00 January 1, 2022
Bilder/
Schaltung.gif 7137 13:19 January 29, 2022
Backup/
SPS1/
SPS2/
INDEX.HTM 22102 23:33 April 29, 2022
done!
=========== USE_QN_ETHERNET ===========
Initialize Ethernet using static IP => IP Address = 192.168.0.59
FTP Server Credentials => account = admin, password = pass
[FTP] Ftp server waiting for connection on port 21

Best greetings,

Electrolyt
 
Hi Electrolyt

Thanks for testing.

The passive mode is working OK here. I'm testing using Ubuntu pftp or ftp -p. The default data port is default at 55600 in passive mode, instead of 20 in active mode. But you can change the passive data port via the following command in the example

Code:
// Object for FtpServer
//  Command port and Data port in passive mode can be defined here
FtpServer ftpSrv( 221, 25000 );
// FtpServer ftpSrv( 421 ); // Default data port in passive mode is 55600
//FtpServer ftpSrv; // Default command port is 21 ( !! without parenthesis !! )

For the SD card, I just take from the example listfiles of Teensy SD Library and have no issue here. Can you test listfiles or add some delay, etc. to fix the issue.

That file-listing feature is only optional.
 
I'm testing now using FileZilla v3.46.3 and OK in passive mode

Code:
Starting FTP_Server_SDFAT2 on TEENSY 4.1 with using QNEthernet
FTP_Server_Teensy41 v1.0.0
Initializing SD card...
Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT32

Volume size (Kbytes): 31452672
Volume size (Mbytes): 30715

===============================
SDCard Initialization : done.
index1.htm                                       3810    23:14  April 29, 2022
foo.txt                                            13    00:00  January 1, 1980
index.htm                                        3810    22:50  April 29, 2022
mydatalog.txt                                      10    22:24  April 9, 2022
edit.htm.gz                                      4116    20:15  March 13, 2022
CanadaFlag_1.png                                41214    20:15  March 13, 2022
CanadaFlag_2.png                                 8311    20:15  March 13, 2022
CanadaFlag_3.jpg                                11156    20:15  March 13, 2022
favicon.ico                                      1150    22:54  April 29, 2022
graphs.js.gz                                     1971    20:15  March 13, 2022
CanadaFlag_2_1.png                               8311    22:52  April 29, 2022
ESP_AT_WM_Lite.txt                               1547    22:51  April 29, 2022
done!
=========== USE_QN_ETHERNET ===========
Initialize Ethernet using static IP => IP Address = 192.168.2.241
FTP Server Credentials => account = teensy4x, password = ftp_test
[FTP]  Ftp server waiting for connection on port  21
[FTP]  Client connected!
USER teensy4x
PASS ftp_test
[FTP]  Authentication Ok. Waiting for commands.
[FTP]  Connection management set to passive
[FTP]  Listening at  192.168.2.241 : 55600
PORT 192,168,2,30,128,77
[FTP]  Data IP set to  192.168.2.30 , Data port set to  32845
RETR favicon.ico
[FTP]  Sending  favicon.ico
[FTP]  Ftp server waiting for connection on port  21

Selection_156.png
 
Hi khoih-prog,

i didn't realize the different FTP initializations for the transfer mode.
I changed that for my understanding like this:
Code:
#define FTP_Active					// Set transfer mode to active

// Object for FtpServer
#ifndef FTP_Active
  // FTP-Server-object for passive mode can be defined here
  //FtpServer ftpSrv( 221, 55600 ); // Define command port 221 and data port 55600 in passive transfer mode
  FtpServer ftpSrv( 221 );          // Define command port 221 and the default data port in passive transfer mode is 55600
#else
  // FTP-Server-object for active mode is defined here
  FtpServer ftpSrv;                 // Default command port 21 in active transfer mode ( !! without parenthesis !! )
#endif

With these different initializations modes, i got it succsefully working in passive and active transfer mode.
Response: 220--- Welcome to FTP_Server_Teensy41 ---
Response: 220 -- FTP_Server_Teensy41 v1.0.0 --
Status: Plain FTP is insecure. Please switch to FTP over TLS.
Command: USER admin
Response: 331 Ok. Password required
Command: PASS ****
Response: 230 Ok
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current directory
Status: Directory listing of "/" successful
Status: Disconnected from server: ECONNABORTED - Connection aborted
I havent seen an issue at the moment for the listfiles again.
I will integrate the ftp server in my mainsketch and test the ftp library then more.
I will write an responce if there are some news.

cheers
 
Last edited:
Hi khoih-prog
Sorry to ask a stupid question, I am using Filezilla as a FTP client and a Teensy 4.1 as the FTP server.
So once I set up the Teensy as the FTP server and connect Filezilla(running on my pc) to it, I should be able to see all the files on the Teensy SD card on Filezilla right?. If I then choose to download a file from the Teensy SD card to my PC through FileZilla, then do I have to add any additional code to your FTP_Server_Teensy41 to download the files( like does there need to be code on the Teensy that will start sending the file)
or does FileZilla take care of downloading from the Teensy?
Thanks
 
I'm in the process of porting / rewriting the new FTPClient_Generic, to support all boards (including Teensy, Portenta, SAMD, RP2040, etc), using Ethernet, WiFi.

I'll publish the new library within several days.

Some preliminary test results hereafter. The server is Teensy4.1 using QNEthernet and FTP_Server_Teensy41 library

Please wait.

---

FTPClient_UploadImage on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library on SPI0/SPI

Code:
Starting FTPClient_UploadImage on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library on SPI0/SPI
FTPCLIENT_GENERIC v1.0.0
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
[EWS] RPIPICO setCsPin: 17
[ETG] W5100 init, using SS_PIN_DEFAULT = 17 , new ss_pin =  10 , W5100Class::ss_pin =  17
[ETG] Chip is W5100S
[ETG] W5100::init: W5100S, SSIZE = 4096
[EWS] =========================
[EWS] Currently Used SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
Using mac index = 4
Connected! IP address: 192.168.2.101
[FTP] Connecting to:  192.168.2.241
[FTP] Command connected
[FTP] Send USER =  teensy4x
[FTP] Send PASSWORD =  ftp_test
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send CWD
[FTP] Send MLSD
[FTP] Result start
[FTP] Result:  150 Accepted data connection to port 55600
226-options: -a -l
226 18 matches total

[FTP] Result end

Directory info: 
Type=file;Modify=20220429231446;Size=3810; index1.htm

Type=file;Modify=19800101000000;Size=13; foo.txt

Type=file;Modify=20190101003904;Size=3714; index2.htm

Type=file;Modify=20220429225004;Size=3810; index.htm

Type=file;Modify=20220409222458;Size=10; mydatalog.txt

Type=file;Modify=20220313201514;Size=4116; edit.htm.gz

Type=file;Modify=20220313201514;Size=41214; CanadaFlag_1.png

Type=file;Modify=20220313201514;Size=8311; CanadaFlag_2.png

Type=file;Modify=20220313201514;Size=11156; CanadaFlag_3.jpg

Type=file;Modify=20190101003834;Size=1150; favicon.ico

Type=file;Modify=20220313201514;Size=1971; graphs.js.gz

Type=file;Modify=20220429225252;Size=8311; CanadaFlag_2_1.png

Type=file;Modify=20220429225138;Size=1547; ESP_AT_WM_Lite.txt

Type=file;Modify=20190101023514;Size=18; helloworld.txt

Type=dir;Modify=20190101000020;Size=0; myNewDir

Type=dir;Modify=20190101001150;Size=0; my_new_dir

Type=file;Modify=20190101023748;Size=51695; octocat.jpg

Type=file;Modify=20190101023748;Size=11; hello_world.txt

Writing octocat.jpg
[FTP] Send TYPE Type I
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send STOR
[FTP] Writing
[FTP] Close File
Writing hello_world.txt
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send STOR
[FTP] Write File
[FTP] Close File
[FTP] Connection closed


FTPClient_DownloadFile on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library on SPI0/SPI

Code:
Starting FTPClient_DownloadFile on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library on SPI0/SPI
FTPCLIENT_GENERIC v1.0.0
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
[EWS] RPIPICO setCsPin: 17
[ETG] W5100 init, using SS_PIN_DEFAULT = 17 , new ss_pin =  10 , W5100Class::ss_pin =  17
[ETG] Chip is W5100S
[ETG] W5100::init: W5100S, SSIZE = 4096
[EWS] =========================
[EWS] Currently Used SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
Using mac index = 19
Connected! IP address: 192.168.2.114
[FTP] Connecting to:  192.168.2.241
[FTP] Command connected
[FTP] Send USER =  teensy4x
[FTP] Send PASSWORD =  ftp_test
[FTP] Send CWD
Creating new file helloworld.txt
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send STOR
[FTP] Write File
[FTP] Close File
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send RETR
[FTP] Result start
[FTP] Result:  150-Connected to port 55600
150 18 bytes to download
226 File successfully transferred

[FTP] Result end
The file content is: Hi, I'm a new file
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send MLSD
[FTP] Result start
[FTP] Result:  150 Accepted data connection to port 55600
226-options: -a -l
226 18 matches total

[FTP] Result end
type=file;modify=20220429231446;size=3810; index1.htm

type=file;modify=19800101000000;size=13; foo.txt

type=file;modify=20190101003904;size=3714; index2.htm

type=file;modify=20220429225004;size=3810; index.htm

type=file;modify=20220409222458;size=10; mydatalog.txt

type=file;modify=20220313201514;size=4116; edit.htm.gz

type=file;modify=20220313201514;size=41214; canadaflag_1.png

type=file;modify=20220313201514;size=8311; canadaflag_2.png

type=file;modify=20220313201514;size=11156; canadaflag_3.jpg

type=file;modify=20190101003834;size=1150; favicon.ico

type=file;modify=20220313201514;size=1971; graphs.js.gz

type=file;modify=20220429225252;size=8311; canadaflag_2_1.png

type=file;modify=20220429225138;size=1547; esp_at_wm_lite.txt

type=file;modify=20190101024026;size=18; helloworld.txt

type=dir;modify=20190101000020;size=0; mynewdir

type=dir;modify=20190101001150;size=0; my_new_dir

type=file;modify=20190101023928;size=51695; octocat.jpg

type=file;modify=20190101023930;size=11; hello_world.txt


File size is: 18
[FTP] Send TYPE Type I
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send RETR
[FTP] Result start
[FTP] Result:  150-Connected to port 55600
150 18 bytes to download
226 File successfully transferred

[FTP] Result end
[FTP] Send TYPE Type I
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)

[FTP] _dataAddress:  192.168.2.241 , Data port:  55600
[FTP] Data connection established
[FTP] Send MKD
[FTP] FTP error:  521 "myNewDir" directory already exists

[FTP] Send CWD
[FTP] FTP error:  521 "myNewDir" directory already exists

[FTP] Send STOR
[FTP] FTP error:  521 "myNewDir" directory already exists

[FTP] Writing
[FTP] FTP error:  521 "myNewDir" directory already exists

[FTP] Close File
CloseConnection
[FTP] Connection closed
 
Hi Maher,

you should see the files on the sd card with the filezilla connection.
You don't need to write special code for upload / download files.
The FTP server managed the filehandling with the call from ftpSrv.service(); in the loop.
So if you use filezilla like the windows explorer, you are manuelley able to transfer files to or from the teensy per drag & drop.

Greetings..
 
Hi khoih-prog
thanks for this library
i initialized the FTP server object as FtpServer ftpSrv
I am running the FTP_Server_SDFAT2 example
and I am trying to connect to this server using FileZilla
however I get this error in FileZilla
Screenshot 2022-06-02 124226.png

this is the arduino serial monitor
Code:
Starting FTP_Server_SDFAT2 on TEENSY 4.1 with NativeEthernet
FTP_Server_Teensy41 v1.1.0
Initializing SD card...
Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT32

Volume size (Kbytes): 30522368
Volume size (Mbytes): 29807

===============================
SDCard Initialization : done.
System Volume Information/
  IndexerVolumeGuid                                76    14:22  June 1, 2022
WS01.csv                                         1032    16:32  June 1, 2022
mtpindex.dat                                        0
SensorData/
  WS0.csv                                        3119    13:56  June 2, 2022
  WS1.csv                                        8562    13:47  June 2, 2022
  WS2.csv                                        8564    13:53  June 2, 2022
done!
======== USE_NATIVE_ETHERNET ========
Using mac index = 9
Connected! IP address: 142.66.212.127
FTP Server Credentials => account = teensy4x, password = ftp_test
[FTP]  Ftp server waiting for connection on port  21
[FTP]  Client connected!
[FTP]  Authentication Ok. Waiting for commands.
[FTP]  Connection management set to passive
[FTP]  Listening at  142.66.212.127 : 20
[FTP]  Ftp server waiting for connection on port  21
[FTP]  Client connected!
[FTP]  Authentication Ok. Waiting for commands.
[FTP]  Connection management set to passive
[FTP]  Listening at  142.66.212.127 : 20
[FTP]  Ftp server waiting for connection on port  21
 

Attachments

  • Screenshot 2022-06-02 124226.png
    Screenshot 2022-06-02 124226.png
    26.2 KB · Views: 50
Last edited:
Hi khoih-prog
Hi Maher,


Get exactly the same problem, (only with Native ethernet).

Hi khoih-prog
thanks for this library
i initialized the FTP server object as FtpServer ftpSrv
I am running the FTP_Server_SDFAT2 example
and I am trying to connect to this server using FileZilla
however I get this error in FileZilla
View attachment 28573
 
Hi microguy
so with other ethernet libraries you were not seeing this issue? if so is it the QNEthernet library that works with this?
I tired with the older filezilla 3.46.3 version also but still get the same error
thanks
 
Hi,

Yes, I tried with QNethernet, and it's working. work in active or passive transfer. for passive transfer, if you use Filezilla on windows, you need to be careful with firewall! (I tried FTPRush too)
But as I have other part of my software that run with nativeEthernet, I think I can't easily use Qnethernet .
I use Filezilla 3.60.1.

Hi microguy
so with other ethernet libraries you were not seeing this issue? if so is it the QNEthernet library that works with this?
I tired with the older filezilla 3.46.3 version also but still get the same error
thanks
 
QNEthernet is mostly a drop-in replacement, but there are additional features that I think make the library easier to use, more robust, and more functional, once you learn how to use it. But at the end of the day, use what you think works best. As the author, I may or may not be a little biased. :)
 
Hi microguy,
could you share how you setup your filezilla and firewall?
I am using windows 10 and Teensy 4.1
I have filezilla 3.60.1 for ftp client and using QNEthernet now
I set up filezilla in active mode( edit -> setting -> passive mode -> fall back to active mode) i believe this should switch filezilla to active mode
SSJune16.png
but I get ECONABORTED error now. Do you know what might be going wrong here?
Thanks
 
Hi microguy,
I got the FTP to work with NativeEthernet in active mode
in filezilla i went to file->site manager->under general use FTP protocol and plain FTP encryption and then under transfer setings use Active mode and check the box to limit number of simultaneous connections to 1
and also under edit->settings->passive mode->check fall back to active mode
hope this works for you

also another issue i ntoiced was that filezilla is unable to open a folder on the teensy SD card that is larger than 3MB, have you encountered this issue before?
don't know if its a filezilla issue or an issue with the teensy FTP server
Thanks
 
Hi Maher,

Hi microguy,
also another issue i ntoiced was that filezilla is unable to open a folder on the teensy SD card that is larger than 3MB, have you encountered this issue before?
don't know if its a filezilla issue or an issue with the teensy FTP server
Thanks

OK, I tried with Native Ethernet and it seems that the problem is not exactly the file or folder size but the number of file, you can't have more than 14 files in your root directory.


but I get ECONABORTED error now. Do you know what might be going wrong here?
Thanks

I'm setting up Filezilla like you, so I Think the problem is only the firewall config. On mine, I deactivate it for all private network (but my test computer is only connected to Teensy).
 
Dear khoih-prog,

please can you assist me ?
When i'am using the FTP_Server_Teensy41 V1.2.0 i got following error:

Unbenannt.PNG

It isn't possible to view the directory within FileZilla.
When i'am using the older Version V1.1.0 of the FTP-Server, everything is working.
I'am using QNEthernet V0.18.0 and the Arduino IDE V2.0.3.

Can you take a look into the greatful library ?

Best greetings,

electrolyt
 
Back
Top