I am using SEEED SAMD Board v1.8.5 (Seeeduino wio terminal ) and I want to run SimpleFTPServer on it. I am running the given example code(wio_termianl_SdFat) in Arduino IDE .
My library version for SimpleFTPServer is given below v2.1.6.
Also my configuration for FtpServerKey.h are given below .
// Wio Terminal
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_SEEED_RTL8720DN
#define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SEEED_SD
MY CODE :
/*
* FtpServer Wio Terminal with SdFat library
* and with callbacks to the main actions of FTP server
*
*
*
* https://www.mischianti.org/category/my-libraries/simple-ftp-server/
*
*/
#include "SdFat.h"
#include <rpcWiFi.h>
#include <FtpServer.h>
// #define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_SEEED_RTL8720DN
// #define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SDFAT2
#define SD_CONFIG SdSpiConfig(SDCARD_SS_PIN, 4)
SdFs sd;
FtpServer ftpSrv;
const char *ssid = "SSID";
const char *password = "PASSWORD";
void setup()
{
Serial.begin(115200);
delay(1000);
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
// Initialize the SD.
if (!sd.begin(SD_CONFIG)) {
sd.initErrorHalt(&Serial);
}
FsFile dir;
FsFile file;
// Open root directory
if (!dir.open("/")){
Serial.println("dir.open failed");
}
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.print(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
delay(1000);
Serial.print("Starting SD.");
Serial.println("finish!");
while (file.openNext(&dir, O_RDONLY)) {
file.printFileSize(&Serial);
Serial.write(' ');
file.printModifyDateTime(&Serial);
Serial.write(' ');
file.printName(&Serial);
if (file.isDir()) {
// Indicate a directory.
Serial.write('/');
}
Serial.println();
file.close();
}
if (dir.getError()) {
Serial.println("openNext failed");
} else {
Serial.println("Done!");
}
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp.
}
void loop(void) {
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
}
I am encountering the following error while compiling the code in Arduino IDE . Please help me to run this example code with Wio Terminal in Arduino IDE.
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:344:0,
from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:62:7: error: ‘Sd2Card’ does not name a type; did you mean ‘SdCard’?
Sd2Card card;
^~~~~~~
SdCard
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:63:7: error: ‘SdVolume’ does not name a type; did you mean ‘FsVolume’?
SdVolume volume;
^~~~~~~~
FsVolume
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:71:37: error: ‘SD_CHIP_SELECT_PIN’ was not declared in this scope
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
^~~~~~~~~~~~~~~~~~
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:71:37: note: suggested alternative: ‘SD_CHIP_SELECT_MODE’
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
^~~~~~~~~~~~~~~~~~
SD_CHIP_SELECT_MODE
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:0:
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:348:20: error: reference to ‘File’ is ambiguous
#define FTP_DIR File
^
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:584:20: note: in expansion of macro ‘FTP_DIR’
bool openDir( FTP_DIR * pdir );
^~~~~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:11:0:
/home/dnk126/Arduino/libraries/SdFat/src/SdFat.h:458:16: note: candidates are: typedef class FsFile File
typedef FsFile File;
^~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:344:0,
from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:28:9: note: class SDLib::File
class File : public Stream {
^~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:0:
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:348:20: error: ‘File’ has not been declared
#define FTP_DIR File
^
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:584:20: note: in expansion of macro ‘FTP_DIR’
bool openDir( FTP_DIR * pdir );
^~~~~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:0:
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:597:15: error: expected ‘;’ at end of member declaration
const char* getFileName(FTP_FILE *file){
^~~~~~~~~~~
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:597:36: error: expected ‘)’ before '’ token
const char getFileName(FTP_FILE *file){
^
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:0:
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:347:21: error: reference to ‘File’ is ambiguous
#define FTP_FILE File
^
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:651:22: note: in expansion of macro ‘FTP_FILE’
uint32_t fileSize( FTP_FILE file );
^~~~~~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:11:0:
/home/dnk126/Arduino/libraries/SdFat/src/SdFat.h:458:16: note: candidates are: typedef class FsFile File
typedef FsFile File;
^~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:344:0,
from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:28:9: note: class SDLib::File
class File : public Stream {
^~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:0:
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:347:21: error: ‘File’ has not been declared
#define FTP_FILE File
^
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:651:22: note: in expansion of macro ‘FTP_FILE’
uint32_t fileSize( FTP_FILE file );
^~~~~~~~
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:347:21: error: reference to ‘File’ is ambiguous
#define FTP_FILE File
^
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:726:3: note: in expansion of macro ‘FTP_FILE’
FTP_FILE file;
^~~~~~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:11:0:
/home/dnk126/Arduino/libraries/SdFat/src/SdFat.h:458:16: note: candidates are: typedef class FsFile File
typedef FsFile File;
^~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:344:0,
from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:28:9: note: class SDLib::File
class File : public Stream {
^~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:0:
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:348:20: error: reference to ‘File’ is ambiguous
#define FTP_DIR File
^
/home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:727:3: note: in expansion of macro ‘FTP_DIR’
FTP_DIR dir;
^~~~~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:11:0:
/home/dnk126/Arduino/libraries/SdFat/src/SdFat.h:458:16: note: candidates are: typedef class FsFile File
typedef FsFile File;
^~~~
In file included from /home/dnk126/Arduino/libraries/SimpleFTPServer/FtpServer.h:344:0,
from /home/dnk126/Arduino/libraries/SimpleFTPServer/examples/Wio_terminal_SdFat/Wio_terminal_SdFat.ino:15:
/home/dnk126/Downloads/arduino-1.8.19-linux64/arduino-1.8.19/libraries/SD/src/SD.h:28:9: note: class SDLib::File
class File : public Stream {
^~~~
Multiple libraries were found for “FreeRTOS.h”
Used: /home/dnk126/.arduino15/packages/Seeeduino/hardware/samd/1.8.5/libraries/Seeed_Arduino_FreeRTOS
Not used: /home/dnk126/Arduino/libraries/Seeed_Arduino_FreeRTOS-master
Multiple libraries were found for “Adafruit_ZeroDMA.h”
Used: /home/dnk126/.arduino15/packages/Seeeduino/hardware/samd/1.8.5/libraries/Adafruit_ZeroDMA
Not used: /home/dnk126/Arduino/libraries/Adafruit_Zero_DMA_Library
exit status 1
Error compiling for board Seeeduino Wio Terminal.