Wiznet / RP2040-HAT-C

Ethernet Example for RP2040
64 stars 35 forks source link

I can't upload or edit files in FTP Server #20

Open rcrIbercomp opened 1 year ago

rcrIbercomp commented 1 year ago

Hi, I am testing the W5x00_ftp_server.c in a W5100S-EVB-Pico, and I can't upload files to the FTP Server or edit the ones that exists there.

directorios

I can build the example, burn it on the RPI and connect through FTP with WinSCP. I can also download the test.txt file in my computer.

This is the trace I get: --> When Download file: download

--> When upload file: upload

--> When creating file in the FTP Server: newFile

Also when trying to edit the new file in the FTP Server, I get connection error.

Any idea of what is happening?

Kind Regards

keitarusm commented 1 year ago

I hope you already figured this out, but the FTP example provided doesn't do anything with files, it's only the comms interface. The actual code for the FTP server in ftpd.c, which is part of the ioLibrary_Driver repo and not the RP2040-HAT-C repo, shows this on or about line 295 where you'll see that the response given to the FTP client is hardcoded in. Similarly, when you try and store a file the server code will dutifully listen to the transmission, storing it in a buffer temporarily, responding to the client that the file was successfully transferred(regardless of conditions). It will respond with the same buffer it used to 'listen' with, now having overwritten the first bytes with the response string.

tldr; There is no file handling in the example, it is left as an exercise for the reader.