FTPClient_Generic library
How To Install Using Arduino Library Manager
Features
This FTPClient_Generic library is a simple yet complete FTP Client library for AVR, mega-AVR, Portenta_H7, Teensy, SAM DUE, Arduino SAMD21, Adafruit SAMD21/SAMD51, Adafruit nRF52, ESP32/ESP8266, STM32, RP2040-based, etc. boards using either WiFi or Ethernet.
Library is based on and modified from:
Currently supported Boards using Ethernet
This FTPClient_Generic library currently supports these following boards:
- nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc.
- SAM DUE
- SAMD21
- Arduino SAMD21: ZERO, MKRs, NANO_33_IOT, etc.
- Adafruit SAMD21 (M0): ItsyBitsy M0, Feather M0, Feather M0 Express, Metro M0 Express, Circuit Playground Express, Trinket M0, PIRkey, Hallowing M0, Crickit M0, etc.
- Seeeduino: LoRaWAN, Zero, Femto M0, XIAO M0, Wio GPS Board, etc.
- SAMD51
- Adafruit SAMD51 (M4): Metro M4, Grand Central M4, ItsyBitsy M4, Feather M4 Express, Trellis M4, Metro M4 AirLift Lite, MONSTER M4SK Express, Hallowing M4, etc.
- Seeeduino: Wio Terminal, Grove UI Wireless
-
Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC) with SPI, SPI1, SPI2
-
AVR Mega1280, 2560, ADK.
-
ESP32
-
ESP8266
-
RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core with SPI, SPI1
-
Portenta_H7
-
Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.
Currently supported Ethernet shields/modules
- W5x00 using
Ethernet_Generic
library - W5x00 using
Ethernet
,EthernetLarge
,Ethernet2
orEthernet3
library - ENC28J60 using
EthernetENC
orUIPEthernet
library - Teensy 4.1 built-in Ethernet using
NativeEthernet
library - Teensy 4.1 built-in Ethernet using
QNEthernet
library - Portenta_H7 Ethernet using
Portenta_Ethernet
library
Currently Supported Boards using WiFi
This FTPClient_Generic library currently supports these following boards:
-
SAM DUE
-
SAMD21
- Arduino: ZERO, MKR, NANO_33_IOT, etc.
- Adafruit SAMD21 (M0) : ItsyBitsy M0, Feather M0, Feather M0 Express, Metro M0 Express, Circuit Playground Express, Trinket M0, PIRkey, HalloWing M0, Crickit M0, etc.
- Seeeduino: LoRaWAN, Zero, Femto M0, XIAO M0, Wio GPS Board, etc.
- SAMD51
- Adafruit SAMD51 (M4) : Metro M4, Grand Central M4, ItsyBitsy M4, Feather M44 Express, Trellis M4, Metro M4 AirLift lite, MONSTER M4SK Express, Hallowing EM4 xpress, etc.
- Seeeduino: Wio Terminal, Grove UI Wireless
-
Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC)
-
All STM32F/L/H/G/WB/MP1 with more than 32KB flash memory.
-
AVR Mega1280, 2560, ADK, 32U4, 16U4, etc. using Arduino, Adafruit or Sparkfun core. To use patch for
ArduinoSTL
library. -
RP2040-based boards, such as Nano RP2040 Connect, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core
-
RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core.
-
ESP32
- ESP32 boards, such as
ESP32_DEV
, etc. - ESP32S2-based boards, such as
ESP32S2_DEV
,ESP32_S2 Saola
, etc. - ESP32C3-based boards, such as
ESP32C3_DEV
, etc. New - ESP32_S3 (ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, etc.) New
-
ESP8266
-
Portenta_H7
-
nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc.
-
Arduino
megaAVR
boards using Arduino core
- UNO WiFi Rev2 :
WiFi101
New - Nano Every :
WiFiEspAT
New
- CO2 Ampel
- SAMD :
WiFi101
New
-
STM32 using
STM32duino Maple
core. New -
Sparkfun SAMD
- SAMD21, SAMD51 :
WiFiEspAT
New
- Industruino SAMD
- D21G : WiFiEspAT New
- Tlera Corp STM32WB boards
- Firefly-WB55RG, Nucleo-WB55RG, etc. :
WiFiEspAT
New
- Maixduino boards
- Sipeed Maixduino, etc. :
WiFiEspAT
New
-
RTL8720DN
using RealtekAmebaD
core New -
Arduino, Sparkfun, Adafruit, etc. AVR boards (Mega, 32U4, etc.). To use patch for
ArduinoSTL
library New
- Arduino Uno / Mega / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano, etc.
- Arduino ATMega 16U4, 32U4 such as AVR Leonardo, Leonardo ETH, YUN, Esplora, LILYPAD_USB, AVR_ROBOT_CONTROL, AVR_ROBOT_MOTOR, AVR_INDUSTRIAL101, etc.
- Adafruit ATMega 32U4 such as AVR_FLORA8, AVR_FEATHER32U4, AVR_CIRCUITPLAY, AVR_ITSYBITSY32U4_5V, AVR_ITSYBITSY32U4_3V, AVR_BLUEFRUITMICRO, AVR_ADAFRUIT32U4, etc.
- Adafruit ATMega 328(P) such as AVR_METRO, AVR_FEATHER328P, AVR_PROTRINKET5, AVR_PROTRINKET3, AVR_PROTRINKET5FTDI, AVR_PROTRINKET3FTDI, etc.
- Generic or Sparkfun AVR ATmega_32U4 such as AVR_MAKEYMAKEY, AVR_PROMICRO, etc.
- Generic or Sparkfun AVR ATmega_328(P) such as ARDUINO_REDBOT, ARDUINO_AVR_DIGITAL_SANDBOX, etc.
- Generic or Sparkfun AVR ATmega128RFA1 such as ATMEGA128RFA1_DEV_BOARD, etc.
Currently supported WiFi shields/modules
- WiFiNINA using
WiFiNINA_Generic library
- WiFi101 using
WiFi101 library
orModified WiFi101 Library v0.16.1+
- u-blox W101, W102 using
WiFiNINA_Generic library
- ESP8266-AT command using
WiFiEspAT library
- ESP8266/ESP32-AT command using
ESP_AT_Lib library
- Built-in WiFi of ESP32, ESP8266
- Built-in WiFi of Portenta_H7
Changelog
Releases v1.0.0
- Initial porting and coding to support many more boards, using WiFi or Ethernet
Examples:
Ethernet Examples
- FTPClient_DownloadFile
- FTPClient_UploadImage
- FTPClient_DownloadFile_RP2040_SPI1
- FTPClient_DownloadFile_STM32_LAN8742A
- FTPClient_UploadImage_STM32_LAN8742A
WiFi Examples
General Example
Debug Terminal Output Samples
1. FTPClient_DownloadFile on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
The following is debug terminal output when running example FTPClient_DownloadFile on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Starting FTPClient_DownloadFile on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
FTPCLIENT_GENERIC v1.0.0
[EWS] ======== USE_PORTENTA_H7_ETHERNET ========
Using mac index = 13
Connected! IP address: 192.168.2.123
[FTP] Connecting to: 192.168.2.241
[FTP] Command connected
[FTP] Send USER = teensy4x
[FTP] Send PASSWORD = ftp_test
[FTP] Send CWD
Creating new file helloworld.txt
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)
[FTP] _dataAddress: 192.168.2.241 , Data port: 55600
[FTP] Data connection established
[FTP] Send STOR
[FTP] Write File
[FTP] Close File
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)
[FTP] _dataAddress: 192.168.2.241 , Data port: 55600
[FTP] Data connection established
[FTP] Send RETR
[FTP] Result start
[FTP] Result: 150-Connected to port 55600
150 18 bytes to download
226 File successfully transferred
[FTP] Result end
The file content is: Hi, I'm a new file
[FTP] Send TYPE Type A
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)
[FTP] _dataAddress: 192.168.2.241 , Data port: 55600
[FTP] Data connection established
[FTP] Send MLSD
[FTP] Result start
[FTP] Result: 150 Accepted data connection to port 55600
226-options: -a -l
226 18 matches total
[FTP] Result end
type=file;modify=20220429231446;size=3810; index1.htm
type=file;modify=19800101000000;size=13; foo.txt
type=file;modify=20190101003904;size=3714; index2.htm
type=file;modify=20220429225004;size=3810; index.htm
type=file;modify=20220409222458;size=10; mydatalog.txt
type=file;modify=20220313201514;size=4116; edit.htm.gz
type=file;modify=20220313201514;size=41214; canadaflag_1.png
type=file;modify=20220313201514;size=8311; canadaflag_2.png
type=file;modify=20220313201514;size=11156; canadaflag_3.jpg
type=file;modify=20190101003834;size=1150; favicon.ico
type=file;modify=20220313201514;size=1971; graphs.js.gz
type=file;modify=20220429225252;size=8311; canadaflag_2_1.png
type=file;modify=20220429225138;size=1547; esp_at_wm_lite.txt
type=file;modify=20190101002054;size=18; helloworld.txt
type=dir;modify=20190101000020;size=0; mynewdir
type=dir;modify=20190101001150;size=0; my_new_dir
type=file;modify=20190101001412;size=51695; octocat.jpg
type=file;modify=20190101001414;size=11; hello_world.txt
File size is: 18
[FTP] Send TYPE Type I
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)
[FTP] _dataAddress: 192.168.2.241 , Data port: 55600
[FTP] Data connection established
[FTP] Send RETR
[FTP] Result start
[FTP] Result: 150-Connected to port 55600
150 18 bytes to download
226-File successfully transferred
226 1 ms, 18 kbytes/s
[FTP] Result end
[FTP] Send TYPE Type I
[FTP] Send PASV
[FTP] outBuf = 227 Entering Passive Mode (4043483328, port 55600)
[FTP] _dataAddress: 192.168.2.241 , Data port: 55600
[FTP] Data connection established
[FTP] Send MKD
[FTP] FTP error: 521 "myNewDir" directory already exists
[FTP] Send CWD
[FTP] FTP error: 521 "myNewDir" directory already exists
[FTP] Send STOR
[FTP] FTP error: 521 "myNewDir" directory already exists
[FTP] Writing
[FTP] FTP error: 521 "myNewDir" directory already exists
[FTP] Close File
CloseConnection
[FTP] Connection closed