summaryrefslogtreecommitdiffstats
path: root/examples/FTPServerSample/SPIFFSSample
diff options
context:
space:
mode:
authorDaniel Plasa <dplasa@gmail.com>2020-05-31 18:38:42 +0200
committerDaniel Plasa <dplasa@gmail.com>2020-05-31 18:38:42 +0200
commit341c4b534347301733c97c6cf95198bc072d9491 (patch)
tree12f9613be0bc9d5814cb0f0ec3f2809a40c71110 /examples/FTPServerSample/SPIFFSSample
parentfix esp32 compile errors (diff)
downloadFTPCLientServer-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/SPIFFSSample')
-rw-r--r--examples/FTPServerSample/SPIFFSSample/SPIFFSSample.ino8
1 files changed, 5 insertions, 3 deletions
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;