diff options
author | Daniel Plasa <dplasa@gmail.com> | 2020-05-31 18:38:42 +0200 |
---|---|---|
committer | Daniel Plasa <dplasa@gmail.com> | 2020-05-31 18:38:42 +0200 |
commit | 341c4b534347301733c97c6cf95198bc072d9491 (patch) | |
tree | 12f9613be0bc9d5814cb0f0ec3f2809a40c71110 /examples/FTPServerSample | |
parent | fix esp32 compile errors (diff) | |
download | FTPCLientServer-341c4b534347301733c97c6cf95198bc072d9491.tar FTPCLientServer-341c4b534347301733c97c6cf95198bc072d9491.tar.gz FTPCLientServer-341c4b534347301733c97c6cf95198bc072d9491.tar.bz2 FTPCLientServer-341c4b534347301733c97c6cf95198bc072d9491.tar.lz FTPCLientServer-341c4b534347301733c97c6cf95198bc072d9491.tar.xz FTPCLientServer-341c4b534347301733c97c6cf95198bc072d9491.tar.zst FTPCLientServer-341c4b534347301733c97c6cf95198bc072d9491.zip |
Diffstat (limited to 'examples/FTPServerSample')
-rw-r--r-- | examples/FTPServerSample/LittleFSSample/LittleFSSample.ino | 3 | ||||
-rw-r--r-- | examples/FTPServerSample/SPIFFSSample/SPIFFSSample.ino | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/examples/FTPServerSample/LittleFSSample/LittleFSSample.ino b/examples/FTPServerSample/LittleFSSample/LittleFSSample.ino index d30120b..4a02754 100644 --- a/examples/FTPServerSample/LittleFSSample/LittleFSSample.ino +++ b/examples/FTPServerSample/LittleFSSample/LittleFSSample.ino @@ -22,6 +22,7 @@ #include <ESP8266WiFi.h> #include <LittleFS.h> #include <FTPServer.h> +#define BAUDRATE 74880 const char *ssid PROGMEM = "YOUR_SSID"; const char *password PROGMEM = "YOUR_PASS"; @@ -31,7 +32,7 @@ FTPServer ftpSrv(LittleFS); void setup(void) { - Serial.begin(74880); + Serial.begin(BAUDRATE); WiFi.begin(ssid, password); bool fsok = LittleFS.begin(); diff --git a/examples/FTPServerSample/SPIFFSSample/SPIFFSSample.ino b/examples/FTPServerSample/SPIFFSSample/SPIFFSSample.ino index b15bd98..23bce4a 100644 --- a/examples/FTPServerSample/SPIFFSSample/SPIFFSSample.ino +++ b/examples/FTPServerSample/SPIFFSSample/SPIFFSSample.ino @@ -18,9 +18,11 @@ #if (defined ESP32) #include <WiFi.h> #include <SPIFFS.h> +#define BAUDRATE 115200 #elif (defined ESP8266) #include <ESP8266WiFi.h> #include <FS.h> +#define BAUDRATE 74880 #endif #include <FTPServer.h> @@ -34,7 +36,7 @@ FTPServer ftpSrv(SPIFFS); void setup(void) { - Serial.begin(74880); + Serial.begin(BAUDRATE); WiFi.begin(ssid, password); bool fsok = SPIFFS.begin(); @@ -72,7 +74,7 @@ void loop(void) ftpSrv.handleFTP(); // - // Code below just to debug in Serial Monitor + // Code below just for debugging in Serial Monitor // if (action == show) { @@ -112,7 +114,7 @@ void loop(void) uint16_t ListDir(const char *path) { uint16_t dirCount = 0; - Dir dir = SPIFFS.openDir(path); + Dir dir = SPIFFS.openDir(path, "r"); while (dir.next()) { ++dirCount; |