summaryrefslogtreecommitdiffstats
path: root/examples/FTPServerSample
diff options
context:
space:
mode:
Diffstat (limited to 'examples/FTPServerSample')
-rw-r--r--examples/FTPServerSample/LittleFSSample/LittleFSSample.ino3
-rw-r--r--examples/FTPServerSample/SPIFFSSample/SPIFFSSample.ino8
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;