Code Monkey home page Code Monkey logo

esp8266ftpserver's Introduction

esp8266FTPServer

Simple FTP Server for using esp8266/esp32 SPIFFs

Now should support esp32!!!

I've modified a FTP server from arduino/wifi shield to work with esp8266....

This allows you to FTP into your esp8266 and access/modify the spiffs folder/data...it only allows one ftp connection at a time....very simple for now...

I've tested it with Filezilla, and the basics work (upload/download/rename/delete). There's no create/modify directory support(no directory support in SPIFFS yet).

You need to setup Filezilla(or other client) to only allow 1 connection.. To force FileZilla to use the primary connection for data transfers: Go to File/Site Manager then select your site. In Transfer Settings, check "Limit number of simultaneous connections" and set the maximum to 1

only supports Passive ftp mode....

It does NOT support any encryption, so you'll have to disable any form of encryption...

feel free to try it out (sample provided)....unzip into your arduino library directory (and restart arduino ide).

this is the original project on github I worked from: https://github.com/gallegojm/Arduino-Ftp-Server/tree/master/FtpServer

esp8266ftpserver's People

Contributors

beegee-tokyo avatar lnxbil avatar nailbuster avatar sandtec65 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  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  avatar  avatar

Watchers

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

esp8266ftpserver's Issues

Failed to connect with Filezilla

Hello nailbuster,

Firstly, thank you for the library.
I tried your example, I editted in my ssid and password and keyed in the user name and password from my Filezilla site in the main function of the example. and I couldnt find a place to key in the Host IP address. I ran the code on my ESP8266 Huzzah Feather, and it only shows this:

Connected to MySSID
IP address: 192.168.179.8
SPIFFS opened!

then it just gets stuck there, I am sure its a beginner's inquiry since I am not familiar with FTP servers and all, seeking your assistance

Regards

Large File Upload

I've been testing the changes for faster upload/download and esp32 support.

I've found almost everything works well with both esp8266 and esp32....

Found one issue that don't know if others can replicate. Upload of files larger than 512K (524,288) bytes will 'stall'. On the esp8266 the file will eventually upload fine, on the esp32 sometimes the file will fail upload but trying again usually gets the file to the esp32.

downloading files >512K works fine and fast.

all testing was done using FileZilla.

esp32 itself isn't 'perfect' yet... I was testing it hard and got to the point where I had to reformat the spiffs to get it working but couldn't replicate it.

thanks to the all those who have contributed/helped.

FTP Connection from Command Prompt

Hi.. I am trying to login via normal FTP command prompt in windows... Can't get past this point.. Any ideas?

ftp> open 10.0.0.247
Connected to 10.0.0.247.
220--- Welcome to FTP for ESP8266/ESP32 ---
220--- By David Paiva ---
220 -- Version FTP-2017-10-18 --
500 Syntax error
530 user not found
User (10.0.0.247:(none)):

Does not work with ESPAsyncWebServer

Hi, I would like to use the ftp server, but I am using ESPAsyncWebServer. The ftp tries to connect but then stops and does not do anything or issues a random error (username, password or something else).

The ESPAsyncWebServer does not use server.handleClient(); in the loop(). Do have any idea how can be done so that both work together?

Breaking from loop with commands

Hello,

I'm working with this library and i was wondering if there was some kind of way of breaking from the loop when the quit command is recieved. For example:

While(True){
ftpSrv.handleFTP();
if(Quitcommandrecieved()){//This function does not exist, is there a way to still do this?
break;
}
}

[Feature suggestion] Check if client is connected

Could you please add a public method in the class to check if a client is connected to the server and prevent that other part of the code try to access to the files in SPIFFS while they are used by the FTP server? Alternatively a method to close FTPServer and make all files available to the rest of the code again.

gz file coruption

A strange little issue..
I have some large .js files "212k and 290k" included in to my web interface, i decided that using gz and the browsers deflate option would be a much better alternative.

If i upload the .gz files using the serial IDE interface it all works perfectly but if i upload the same files using FTP for some reason it appears the file becomes corrupt or truncated.

using gzip the files come down in size to 26k so i would not have thought the issue was a size problem.

FTP server stop after wrong connection

I can connect to ESP8266 FTP serever in local network.

I have tried connect to ESP8266 from internet, but I did't set well the router port forwarding. The outer PC connect to the ESP, but it didn't download the contents of it. After this wrong connection I can not connect to ftp server from local network. The symptom is similar, the client connect to the server, but the contents are not downloaded. I can see a 'downlad' pop up window (Total commander), but nothing happens.
After that I restart the ESP and I can connect from local network.

Dependant libraries

You haven't specified which WifiESP library, and by who, your library is dependent on.
So when I download this it won't compile!
Can you please specify the github repositry that you have used re #include <WifiESP.h>

Insufficient info to get this to compile

I have unzipped your library along with the one at https://github.com/esp8266/Arduino.
It still wouldn't compile.
Arduino IDE complains about not being able to find queue.h - I found this in tools/sdk/.... and copied it to C:\Program Files (x86)\Arduino\libraries\esp8266FTPServer and I got past this compile error.
So clearly there are other things that you need to do with the Arduino IDE installation to make your library compile without my hack. And you need to details these, step by step.

Failed to retrieve directory listing

Hello,
I am using this library with no problems but after some time (about a week ) it stops working and fails to retrieve the directory listing. Http server which is installed alongside and have an access to SPIFFS works without problem so the ESP is working.

USING FTPSERVER with SDFat.h lib causes: error:'File' is already declared in this scope using fs::File

Hello. I'm a new user of esp8266, and sice few months ago I started to develop a data logger with ESP-12E module.
All worked since I decided to add the FTP feature to my project (where I use library #include "SdFat.h")
Now I added your library <ESP8266FtpServer.h> and when I compile the scketch I obtain this error:

sp8266/FS.h:136:11: error: 'File' is already declared in this scope

using fs::File;
^
I found here me-no-dev/ESPAsyncWebServer#112 , an old discussion on similar issue, but I was now able to implement to your libary and to solve the issue.
Could you help me ?
thanks Alessandro

esp8622 crash..

esp with working wifi, www server, spiffs, socket, oled via spi.
added ftp, and when transfering file esp crash.
using filezilla, disconnect client when choiced transfer file (i have to connect again, wait for connection).

Migration to LittleFS File System

Hi, thanks for library. It's works good for me, but since Esp8266 community Library 2.7.1, SPPIFS seem to depreciate and we are encouraged to migrate to a LittleFS file system. I have tried to convert all SPPIFS references to LittleFS reference in your library. The compilation runs Ok, and I can connect to my FTP server without problem. But when I try to Upload or download one file, I obtain an error and can't do it. For example, when I want to show root directory, I get "425 No data connection MLSD". Is-there any chance than you upgrade your library to be compatible with LittleFS file system ?
Best Regards
Eric

Folder emulation

Hi David,

I just stumbled upon this nice ftp server, works great out of the box.

Is any work done on emulating folders?

rewrite to use async TCP-Functions

Hi.

I had troubles with your FTP-Server uploading small files to SPIFFS (ie. 300byte files).
I noticed the troubles where coming from the blocking TCP-Functions that you use. It makes it behave very unstable.

I have rewritten the entire thing and made use Async TCP-Library from me-no-dev. Its way more responsive and works very nicely. I wanted to share the code with you.

https://github.com/Monarch73/MicroHomebridgeAlexaEsp8266/blob/master/MicroHomebridgeAlexaEsp8266/FtpServ.h

Its just this header-file that also includes the implementation. For me it's part of a different project. Maybe you want to convert it to a stand-alone project, if you like.

litttle bug

in FTPFilesystem.h
#ifdef ESP_IDF_VERSION && ESP_IDF_VERSION_VAL
line 57 needs to be replaced by
#if defined ESP_IDF_VERSION && defined ESP_IDF_VERSION_VAL
otherwise it wont compile

Slow data transfer

Hi all, I'm using SD card in MMC mode, and have nice transfer rate to and from SD (3-5 MB/s).
But I need reading SD card by 4096byte block for this.
This lib use 2*1460 byte buffer and it so little for me.
Only 0.5-0.6 MB/s transfer rate.

dataIp=softAPIP if in AP mode

Hi David. Thanks for esp8266FTPServer!

My ESP is set up in AP mode so doesn't have WiFi.localIP set. To connect from my android phone I added:

  else if( ! strcmp( command, "PASV" ))
  {
    if (data.connected()) data.stop();
    dataIp = WiFi.localIP();
    if(0 == dataIp[0])            ///  <<<  These two lines (There's surely a better test !?)
      dataIp = WiFi.softAPIP();   ///  <<<

Don't know if it's the right way but it works in this instance. :-)

Thanks again
Doug

LIST command does not work

ls or dir command invoked by console ftp client returns 550 Can't open directory error.

Looks like the if (!SPIFFS.exists(cwdName))... code in LIST implementation should be commented as already done for MSLD.

TCP connection is dropped by server just after STOR issued

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
Serial.println("ftpdataserver client....");
#endif

  }

}

return data.connected() || data.available();

}
"

ESP8266FtpServer not working!

I successfully used this library in a project, but suddenly nothing seems to work anymore!
If I set the ESP core to 1.6.5 there is no SPIFFS.
If I set either 2.0 or 2.1 I get an error in buf format for ReadByte function in the library.

As it looks, the standard is now more strict in the compiler, so it won't accept conversion from char to unsigned char.

I reinstalled the Arduino IDE (1.6.7 I admit) to no avail.
Now I removed all references to FtpServer from my projects, but as soon as I include the library the sketch compiles but hangs on startup.
Is it possible to give a fast check to this issue?
Shouldn't be a big problem for somebody who knows where to look.

Able to download fine but not upload some files

I am running esp8266FTPServer on an ESP8266. I have used this library for several years without any issues. I recently had to recompile some old code using the Arduino IDE 1.8.8 plus the newer 2.5 board manager. I am not sure if my problems relate to the new IDE and board manager, insufficient memory or some other unrelated issue. Filezilla has gone through several revisions since I used this code last too.

Here's the problem:

Using Filezilla I can download fine. When I try to upload with Filezillza, many files show a size of zero. If I try to delete them and go again, I get the overwrite message even thought they should be deleted and I still get the zero size file. My sketch seems able to do these operations fine, no problems upload, downloading or deleting if done within the sketch. Free memory is around 32000.

Not only can I not isolate the source of the problem, I am not sure how to go about troubleshooting it,

Thoughts anyone?

Advanced IP Scanner crashes the FTP server

All is well with my use of the FTP server for updating and changing files in my ESP8266 SPIFFS with one exception.

'Advanced IP Scanner' crashes the Ftp server causing a reboot. Here's the exception Decode:

0x400dc503: FtpServer::userIdentity() at C:\Users\William\Documents\Arduino\libraries\esp8266FTPServer-master/ESP8266FtpServer.cpp line 1020
0x400de4d9: FtpServer::handleFTP() at C:\Users\William\Documents\Arduino\libraries\esp8266FTPServer-master/ESP8266FtpServer.cpp line 1020
0x400d71d6: loop() at C:\Users\William\Documents\Arduino\OWM_forecast_ESP32_SPIFFSg/OWM_forecast_ESP32_SPIFFSg.ino line 371
0x400e95e5: loopTask(void*) at C:\Users\William\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/main.cpp line 19
0x40088f75: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 355 (discriminator 1)

Any advice?

ESP32s "AI Thinker"

Hi,

im trying to integrate your project using a ESP CAM. Connection works, upload works, download works, BUT after refreshing the folder in FileZilla I get an empty folder.

Any hint what to look at?

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.