Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Conversation

wwatson4506
Copy link
Contributor

@wwatson4506 wwatson4506 commented May 15, 2022

I was able to fix the problem with incomplete downloads to an FTP client. Problem was in the doRetrieve() function.
See this thread:
https://forum.pjrc.com/threads/70062-Teensy-4-1-Adafruit-Airlift-Featherwing-Co-Processor-FTP-Server-not-opening-Port-21
Post #127.
This fixed both QNEthernet and NativeEthernet. Tested with Filezilla and gFTP.

Fixed download problem where files that were sent from the Teensy4.x to the PC were incomplete. File size was smaller than the original file.  The problem was in the doRetrieve() function. The data.write() buffer was being overwritten before the last transfer was finished. Limited the read size to space left in data.write() buffer if it was smaller than FTP_BUF_SIZE.
@khoih-prog
Copy link
Owner

khoih-prog commented May 16, 2022

HI @wwatson4506

Thanks for your valuable PR. I've tested and verified that file download is OK.

I'm merging now and looking forward to receiving more of your PRs.

Best Regards,

PS:

BTW, could you have a look at and help fix the bug mentioned in FTPClient_Generic Library #6

binary upload for large files only working on NativeEthernet, not QNEthernet yet (some bug, ???).

Edited

The binary upload for large files has been already fixed in FTPClient_Generic releases v1.3.0

@khoih-prog khoih-prog merged commit c31e057 into khoih-prog:main May 16, 2022
khoih-prog added a commit that referenced this pull request May 16, 2022
### Releases v1.1.0

1. Fix bug incomplete downloads from server to client. Check [Incomplete downloads from server to client. #2](#2)
khoih-prog added a commit that referenced this pull request May 16, 2022
### Releases v1.1.0

1. Fix bug incomplete downloads from server to client. Check [Incomplete downloads from server to client. #2](#2)
@khoih-prog
Copy link
Owner

Hi @wwatson4506

The new FTP_Server_Teensy41 releases v1.1.0 has just been published. Your contribution is noted in Contributions and Thanks

Best Regards,


Releases v1.1.0

  1. Fix bug incomplete downloads from server to client. Check Incomplete downloads from server to client. #2

@egonbeermat
Copy link

I still have the same problem. I am using FTP_Server_Teensy41 v1.1.0 (as reported in the console), verified that the Stream.h/cpp files are patched, and am using NativeEthernet and FileZilla 3.59.0 on Windows.

When I try to retrieve a 39 byte file from the Teensy using FileZilla, it fails. FileZilla log shows:

Status: Logged in
Status: Retrieving directory listing...
Status: Directory listing of "/" successful
Status: Connecting to 192.168.1.91:221...
Status: Connection established, waiting for welcome message...
Error: Connection timed out after 20 seconds of inactivity
Error: Could not connect to server
Status: Disconnected from server
Status: Delaying connection for 5 seconds due to previously failed connection attempt...
Status: Connecting to 192.168.1.91:221...
Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server".
Error: Could not connect to server
Status: Disconnected from server

The "Status: Connection established, waiting for welcome message..." appears after I request the file in FileZilla.

@khoih-prog
Copy link
Owner

khoih-prog commented May 19, 2022

Hi @egonbeermat

Can you open a new issue or we can merge yours with client being disconnected immediately after response Listening at 192.168.2.241 : 55600 #3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants