GithubHelp home page GithubHelp logo

dplasa / ftpclientserver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nailbuster/esp8266ftpserver

49.0 49.0 28.0 105 KB

Simple FTP Server and Client for the esp8266/esp32 with LittleFS and SPIFFS support

License: GNU Lesser General Public License v2.1

C++ 100.00%

ftpclientserver's People

Contributors

addioelectronics avatar beegee-tokyo avatar dplasa avatar lnxbil avatar nailbuster avatar norbim1 avatar sandtec65 avatar scrators avatar vortigont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ftpclientserver's Issues

Fix buffer sizes

I see one buffer of size 2048 and one buffer of 32KB. Neither makes much sense.
The buffers should be of size 1x or 2x the size of the lwip buffer configuration (low mem vs. high speed).
Support for lwip 1.x can be ignored, it will be pulled put in the near future. Requirement of lwip 2.x can be stated in the Readme.
About that 32KB buffer, that one really doesn't make sense, especially if support for encryption is to be implemented (requires a lot of heap).

FTP Server not working with NppFTP plugin of Notepad++ text editor

Hi,

I just tried to use the Notepad++ text editor (NppFTP plugin) with your FTP Server.
Connection and directory listing works, but as soon as I want to upload or download a file, the log just says "-> Quit" and the operation fails. No matter if Active or Passive mode.

Other clients like WinSCP work fine...

Copying folders with csv files inside

Hello,
Is there any way to copy a complete folder with csv files inside

  • Folder 1
    -- File 1.csv
    -- File 2.csv
  • Folder 2
    -- File 1.csv
    -- File 2.csv
    -- File 3.csv

Thanks

Not able to download complete file

I am trying to download a file with size of around 332kB, but I am failing in downloading complete file. Last few bytes(around 100) are not transferred

Add support for FFat

Hello,
Thanks for this great job.
My question is regarding the possibility of adding the option for the FFat file system.
The FFat system is the one that Espressif has adopted by default in its development today.
Could you take it into consideration?
You could tell me to implement it myself, but unfortunately I don't have enough knowledge for it.
Thanks in advance
Greetings

LittleFSSample fails to compile

Title says it all, get exactly the same errors when trying to use FTPClientServer in my own project.

In file included from /home/andy/Arduino/libraries/FTPClientServer-master/FTPServer.h:32, from /home/andy/Arduino/sketches/LittleFSSample/LittleFSSample.ino:24: /home/andy/Arduino/libraries/FTPClientServer-master/FTPCommon.h:11:7: error: 'esp8266Pool' has not been declared 11 | using esp8266Pool::polledTimeout::oneShotMs; // import the type to the local namespace | ^~~~~~~~~~~ In file included from /home/andy/Arduino/libraries/FTPClientServer-master/FTPServer.h:32, from /home/andy/Arduino/sketches/LittleFSSample/LittleFSSample.ino:24: /home/andy/Arduino/libraries/FTPClientServer-master/FTPCommon.h:130:5: error: 'oneShotMs' does not name a type 130 | oneShotMs aTimeout; // timeout from esp8266 core library | ^~~~~~~~~ exit status 1 Error compiling for board NodeMCU 1.0 (ESP-12E Module).

SD FS unsupported?

Hi Daniel.
Thanks so much for this great library!
I'm working on trying to use it with SD filesystem which appears to work generally the same way code wise as SPIFFS and LittleFS, but it doesn't seem to be able to create a file with the SD filesystem. I'm not sure if this is a bug or just unsupported by the library. I'm using an ESP32WROOM with only 4MB of flash and trying to download a file from FTP that is 5.9MB so there are a lot of things that can go wrong. Not sure the best way to debug other than download starts and then fails with error "Transfer failed after 191 ms, code: 220, descr=220-You are user number 5 of 150 allowed." No file is saved on the SD card. I basically changed all of the references to LittleFS to SD for example: FTPClient ftpClient(SD); bool fsok = SD.begin(csPin); etc. I think that the issue is with SD.begin not being called correctly. Forgive me for asking such a stupid question but how can I view the FTP_DEBUG_MSG information in the serial monitor? I saw another post asking for SD card implementation and I'd love to see if I can figure it out. Thanks again!

Library not working with ESP8266 (client) and IIS or Filezilla (server)

Hi! I spend several hours trying to GET/PUT a file from/to a server that is working with other clients on my local network. I'm using a NODEMCU (ESP8266) as client and I already solve the PolledTimeout.h compilation problem. I keep getting the 451 error code and already tried to change the client from LittleFS to SPIFSF and several other things. As a note, my server is working fine when I use "ftp" from windows command prompt or "ftp:\address" from Windows Explorer or filezilla client. More details on the attached figure.

451 code

Fix timeout calculations

The code that checks timeouts is flawed and reinvents the wheel. I strongly suggest replacing with polledTimeout::oneShotMs, which is known to be correct and even covered by unit tests, see core examples.

Clean up macro pseudo functions

At a glance I saw some macros used like functions. They should be cleaned up to actually be functions.
Example: CLIENT_SEND.

Compile errors on Arduino IDE 2.1.0 re: esp8266Pool & oneShotMs

Hello dplasa:
I've run into a compile problem:

In file included from C:\Users\Gary\Documents\Arduino\libraries\FtpClientServer/FTPClient.h:23,
from C:\Users\Gary\Documents\Arduino\APRSTest\APRSTest.ino:12:
C:\Users\Gary\Documents\Arduino\libraries\FtpClientServer/FTPCommon.h:11:7: error: 'esp8266Pool' has not been declared
11 | using esp8266Pool::polledTimeout::oneShotMs; // import the type to the local namespace
| ^~~~~~~~~~~
In file included from C:\Users\Gary\Documents\Arduino\libraries\FtpClientServer/FTPClient.h:23,
from C:\Users\Gary\Documents\Arduino\APRSTest\APRSTest.ino:12:
C:\Users\Gary\Documents\Arduino\libraries\FtpClientServer/FTPCommon.h:130:5: error: 'oneShotMs' does not name a type
130 | oneShotMs aTimeout; // timeout from esp8266 core library
| ^~~~~~~~~

exit status 1

Compilation error: exit status 1

I have at the start of the file. Wish to use FTP to transfer local files to a server. I followed instruction on how to add a .zip to the library.
Not sure where to go from here.

Thank you
#include <LittleFS.h>
#include <FTPClient.h>
#include <FTPCommon.h>

Debugging environment proposal

Hello,

Once esp8266/Arduino#7404 is merged,(merged)
if you are tunning linux, (or WSL on windows),
you can run your ftp example on your PC and use host debug tools.

I have tried with ftp cmdline client and littlefs-ftp-server: it works with little files but not big ones (600KB), failing log:
(on both esp and emulation environment)

[FTP] Transfer 536 bytes net->FS
[FTP] Transfer 536 bytes net->FS
[FTP] Transfer 536 bytes net->FS
[FTP] Transfer 536 bytes net->FS
[FTP] Transfer 152 bytes net->FS
(both client and server frozen at that point)

IMPORTANT: you must replace all your %S by %s (and you can leave them like that) (they are very harmful for linux's printf, and man page advise to not use them).

To run the emulation environment, provided the above PR is merged and if you use esp8266 git master version,

cd /path/to/esp8266ArduinoCore/tests/host
export LIB=/path/to/libraries/esp8266FTPServer
make ULIBDIRS=${LIB} FORCE32=0 D=1 V=1 ${LIB}/examples/FTPServerSample/LittleFSSample/LittleFSSample

./bin/LittleFSSample/LittleFSSample  -v 
valgrind ./bin/LittleFSSample/LittleFSSample  -v 
gdb ./bin/LittleFSSample/LittleFSSample 
  -> run -v

port will be 9021 (not 21)

Server with SD

Hello Daniel.
I spent four days searching the INTERNET FTPServer.
All work poorly. Tested on NODEMCU with ESP8622
Your server is a miracle. Works with any FTP CLIENT. You are very smart and
conscientious person.
I myself am not able to write libraries.
Maybe you have a version of FTPServer for SD card.
It will be my happiness to receive it !!!!!!
The procedure for recording on the CD would be enough for me

Sorry, translated with translate.google

Thanks in advance for your reply.

How to handle FTP server crashing and restarting?

I've been using this ftp client library with a nodemcu to log data and periodically ftp the results to a server.

Worked well for several weeks until the server crashed and restarted. At this point the transfers all stopped and did not resume unless I reset the nodemcu.

Is there an efficient way to query whether the ftp client needs to be reinitialized?

So something like:

ftpClient.begin(ftpServerInfo);

and then a loop to check if the connection is alive (I am unsure if this functionality already exists) followed by
ftpClient.end(ftpServerInfo); (Is there anything like this?)
ftpClient.begin(ftpServerInfo);

My apologies if the answer is obvious and my thanks if you can point me in the right direction.

Make LIST output compatible with FuseFS

Fuse FTP-FS (fuse filesystem) -- connection is OK but nothing is visible (neither are directories)

mkdir /tmp/xxx
curlftpfs ftp://ftp:[email protected] /tmp/xxx
cd /tmp/xxx
ls -al # empty result
touch x # freeze

This empty result is probably due to the format of the LIST output -- the way it was implemented is not understood by FuseFS.
Second problem: FuseFS sends "LIST -a", the "-a" gets treated by the server as filename/dirname and it tries to list "cwd/-a" which fails.

Touch freeze... not sure what happens here.

Factor out the WiFiClient/Server objects

The WiFiClient/Server should be factored out. This can be done by allowing a constructor that receives the object already prepared beforehand. An example is the http client. Alternatively, you can use an approach like the webserver.
The CAs or fingerprint or whatever can then be set up before passing in.
As in other such cases, the FTP client/server would not own the obkect passed in and so shouldn't destroy it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.