I'm using this FTP server in my ESP826 project. I have found that it is very unstable to send some files to server. Based on Wireshark logs TCP connection is dropped after STOR operation:
Debug shows on ESP:
"ftpdataserver client...."
Client (FileZilla):
"
Command: STOR esp8266-template.cfg
Response: 425 No data connection
"
I have fixed it with following change in FtpServer::dataConnect() (code attached below):
1) "data.stop()" commented
2) "data.available()" or-ed in return
Not sure if it is best solution, however after this changes files transfers works stable at every time.
Regards,
Bruno
"
boolean FtpServer::dataConnect()
{
unsigned long startTime = millis();
//wait 5 seconds for a data connection
if (!data.connected())
{
while (!dataServer.hasClient() && millis() - startTime < 10000)
{
//delay(100);
yield();
}
if (dataServer.hasClient()) {
//data.stop();
data = dataServer.available();
I'm using this FTP server in my ESP826 project. I have found that it is very unstable to send some files to server. Based on Wireshark logs TCP connection is dropped after STOR operation: Debug shows on ESP: "ftpdataserver client...." Client (FileZilla): " Command: STOR esp8266-template.cfg Response: 425 No data connection "
I have fixed it with following change in FtpServer::dataConnect() (code attached below): 1) "data.stop()" commented 2) "data.available()" or-ed in return
Not sure if it is best solution, however after this changes files transfers works stable at every time.
Regards, Bruno
" boolean FtpServer::dataConnect() { unsigned long startTime = millis(); //wait 5 seconds for a data connection if (!data.connected()) { while (!dataServer.hasClient() && millis() - startTime < 10000) { //delay(100); yield(); } if (dataServer.hasClient()) { //data.stop(); data = dataServer.available();
ifdef FTP_DEBUG
}
return data.connected() || data.available();
} "