hello, i tried the taifun ftp ar app i want to write an ftp apk to load data files. only the application crashes my esp8266. it is configured in access point mode, as soon as I connect the apk, the esp reset! whereas with filezilla ouandftp it works very well?
I forgot something? I put my code, it is very simple. thanks for your reading.
#include <ESP8266WiFi.h>
#include <SD.h>
//#include "ESP8266FtpServer.h"
//#include <SimpleFTPServer.h>
const char* ssid = "xxxxxxxxxx";
const char* password = "xxxxxxxxxx";
// config static IP
IPAddress apIP(192,168,xx,xx);
IPAddress gateway(192,168,xx,xx);
IPAddress subnet(255,255,255,0);
FtpServer ftpSrv;//set #define FTP_DEBUG in ESP8266FtpServer.h to see ftp verbose on serial
File root;
void setup(void){
Serial.begin(115200);
Serial.println("");
//Setting the Ip address for the WiFi connectivity
WiFi.config(apIP,gateway,subnet);
Serial.println();
Serial.print("Configuring access point...");
//Setting the esp to softaccess point mode
WiFi.mode(WIFI_AP);
WiFi.disconnect();
delay(100);
//changing softAP config and starting the Start AP
WiFi.softAPConfig(apIP,gateway,subnet);
WiFi.softAP(ssid,password);
//2 indicates the Chip select pin
if (SD.begin(15)) {
Serial.println("SD opened!");
ftpSrv.begin("xxxxx","xxxxxxx"); //username, password for ftp. set ports in ESP8266FtpServer.h (default 21, 50009 for PASV)
}
// printDirectory(root,0);
}
void loop(void){
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
}