How to Configure FTP Communication in an ESP32 Device?

File Transfer Protocol

On a computer network, the File Transfer Protocol is a common communication protocol used to send files from a server to a client. FTP uses distinct data and controls connections between the server and the client in a client-server architecture. It is a network protocol used for file transmission using Transmission Control Protocol/Internet Protocol (TCP/IP) connections between computers. FTP is categorised as an application layer protocol within the TCP/IP stack. The client needs to be authenticated to the server with a username and password to transfer files.


ESP32 FTP Server

This protocol can be used to transfer files from server to client(download) or client to server(upload). We can create an FTP server on an ESP device using the ESP32FtpServer library. The server must have the capability to store data. In the case of ESP32, it has a total of 4MB size of storage, but we can extend the storage by using an external memory card. SD card modules are available that can be used to connect with the esp device. For the communication between the sd card and esp device, there are 2 types of protocols available as of my knowledge that is SPI(Serial Peripheral Interface) and SDIO(Secure Digital Input Output). 

Connect the esp32 device to the sd card module. Here I used  SPI communication.



Here is a simple implementation of the esp32 FTP server. Replace the wifi credentials with yours. After the successful completion of this code, open the serial monitor, and you will get an IP address. You can access the FTP server by using this IP. Within the code, you can also find FTP credentials.

user: esp32

password: esp32

Using this URL, you can now connect to the FTP server via file explorer. Replace the IP address with the one you got from the serial monitor. 

ftp://esp32:esp32@192.161.125.151/



Comments

Popular Posts