Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By pbecchi
#56195 Great library, but.....

since I added the library and the setup() and loop() lines to my previous sensor logger program I experienced a strange behaviour:

-the Telnet and the HTTP connection I was using before don't work anymore, or ,
if I get to be connected, it run very slowly and unreliably!

Any reason for that? I would like to use the library but in parallel to the other connections!
Any way to fix that?

Thanks Paolo
User avatar
By NailBuster
#56435
pbecchi wrote:Great library, but.....

since I added the library and the setup() and loop() lines to my previous sensor logger program I experienced a strange behaviour:

-the Telnet and the HTTP connection I was using before don't work anymore, or ,
if I get to be connected, it run very slowly and unreliably!

Any reason for that? I would like to use the library but in parallel to the other connections!
Any way to fix that?

Thanks Paolo


I'd guess that you are hitting the limit of concurrent open connections with the esp8266? I think after 3-4 open ports/server/services things start to get unreliable.

You can look at my other github project (myWebServer) to see example how I use an http/html file browser (doesn't use ftp) to copy/download/remove Spiff files...
User avatar
By pbecchi
#56498 Thanks!

I was not aware of this limitation:
As a matter of fact I use:

ArduinoOTA
WebHTTPServer
Telnet
and
FTP

I have seen that executing .begin() and .handle() under an if(ftpFlag) may be a solution.
The ftpFlag is setted by Http: when you need it.

Paolo
User avatar
By Stévanovich
#57599 Hello,

For my sketch , in loop() , i need to know if there a connected client with ftp.
I had a look , but i didn't find to get this information.
If possible,I need some help to modify class like this :

ESP8266FtpServer.cpp
Code: Select all// Add this extern
extern bool FtpClientConnected;

WiFiServer ftpServer( FTP_CTRL_PORT );
WiFiServer dataServer( FTP_DATA_PORT_PASV );


Add somewhere :
Code: Select allFtpClientConnected = false; // or true;


In my sketch:
Code: Select allvoid loop() {
   ftpSrv.handleFTP();
        if(FtpClientConnected){
            return; // Priviligie le client FTP si necessaire
        }


thanks for help
Best regards