{"id":16239729,"url":"https://github.com/nopnop2002/esp-idf-ftpserver","last_synced_at":"2025-09-01T12:17:10.436Z","repository":{"id":40691124,"uuid":"338534117","full_name":"nopnop2002/esp-idf-ftpServer","owner":"nopnop2002","description":"ftp server for esp-idf using FAT file system","archived":false,"fork":false,"pushed_at":"2025-06-27T03:38:02.000Z","size":225,"stargazers_count":46,"open_issues_count":0,"forks_count":15,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T04:53:48.124Z","etag":null,"topics":["esp-idf","esp32","fat32","ftp","ftp-server"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nopnop2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-13T08:55:43.000Z","updated_at":"2025-06-27T03:38:05.000Z","dependencies_parsed_at":"2023-01-29T02:01:46.344Z","dependency_job_id":"10b47502-a6cd-40c3-93bb-1ae1f42bf165","html_url":"https://github.com/nopnop2002/esp-idf-ftpServer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nopnop2002/esp-idf-ftpServer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-ftpServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-ftpServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-ftpServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-ftpServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/esp-idf-ftpServer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-ftpServer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273122138,"owners_count":25049539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp-idf","esp32","fat32","ftp","ftp-server"],"created_at":"2024-10-10T13:44:51.737Z","updated_at":"2025-09-01T12:17:10.385Z","avatar_url":"https://github.com/nopnop2002.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-idf-ftpServer\nFTP Server for esp-idf using FATFS/LittleFS.   \nI found [this](https://www.esp32.com/viewtopic.php?f=13\u0026t=5013#p21738) information.   \nSo, I ported from [here](https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/blob/master/MicroPython_BUILD/components/micropython/esp32/libs/ftp.c).   \nDirectory operations are possible because FATFS/LittlsFS is used.   \n\n\n# Difference between FATFS and LittleFS\n- FATFS   \n\tCase insensitive.   \n\t```\n\tftp\u003e dir\n\t227 (192,168,10,130,7,232)\n\t150\n\t-rw-rw-rw-   1 root  root        41 May 08 00:47 long_file_name_support.txt\n\tdrw-rw-rw-   1 root  root         0 May 08 00:48 sub_directory1\n\tdrw-rw-rw-   1 root  root         0 May 08 00:48 sub_directory2\n\t```\n\n- LittleFS   \n\tCase sensitive.   \n\t```\n\tftp\u003e dir\n\t227 (192,168,10,130,7,232)\n\t150\n\t-rw-rw-rw-   1 root  root        41 May 08 00:51 LONG_FILE_NAME_SUPPORT.txt\n\tdrw-rw-rw-   1 root  root         0 Dec 31 1969 SUB_DIRECTORY1\n\tdrw-rw-rw-   1 root  root         0 Dec 31 1969 SUB_DIRECTORY2\n\t-rw-rw-rw-   1 root  root        41 May 08 00:51 long_file_name_support.txt\n\tdrw-rw-rw-   1 root  root         0 Dec 31 1969 sub_directory1\n\tdrw-rw-rw-   1 root  root         0 Dec 31 1969 sub_directory2\n\t```\n\n# Software requirements\nESP-IDF V5.0 or later.   \nESP-IDF V4.4 release branch reached EOL in July 2024.   \nESP-IDF V5.1 is required when using ESP32-C6.   \n\n# Installation\n```\ngit clone https://github.com/nopnop2002/esp-idf-ftpServer\ncd esp-idf-ftpServer/\nidf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}\nidf.py menuconfig\nidf.py flash monitor\n```\n\n# Partition table for Builtin SPI Flash Memory\nIf you select FATFS on the built-in SPI flash memory, this project will use partitions_example_fatfs.csv.   \nIf you select LittleFS on the built-in SPI flash memory, this project will use partitions_example_littlefs.csv.   \nIf your board has 4M SPI Flash Memory, you can get more space by changing this.   \nThe maximum partition size that can be specified for the 4M flash model is 0x2F0000(=2,960K).   \nIf you use 4M SPI Flash Memory, you need to change this.   \n![config_flash_size](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/81926a15-2d4e-466f-a889-d118b92eba0d)\n\n# Configuration\n![config-main](https://user-images.githubusercontent.com/6020549/107847756-a4aa2900-6e31-11eb-9525-6fd82bead5a3.jpg)\n![config-app](https://user-images.githubusercontent.com/6020549/127939325-1b565ef7-9045-4800-95ad-0153342b5fc1.jpg)\n\n## File System Selection\nThis project supports the following file systems.   \nYou can select any one using menuconfig.   \n- LittleFS on Builtin SPI Flash Memory   \n- FATFS on Builtin SPI Flash Memory   \n- FATFS on SD card with SDSPI Interface   \n- FATFS on SD card with SDMMC Interface (Valid only for ESP32/ESP32S3)   \n\nBesides this, ESP32 supports SPIFFS, but this project will not use SPIFFS because it cannot handle directories.\n![Image](https://github.com/user-attachments/assets/b6438577-6bf3-40d2-b700-b81f269fba37)\n![Image](https://github.com/user-attachments/assets/32b224fe-dfc0-4aee-b46e-ac05362e8f89)\n\nWhen using SD card with SDMMC, you can select 1 Line mode or 4 Line mode.   \n![config-filesystem-3](https://user-images.githubusercontent.com/6020549/222020427-d1dd2c40-955d-46ca-b32f-3e8b8439778a.jpg)\n![config-filesystem-4](https://user-images.githubusercontent.com/6020549/222020434-e54cd185-1b1c-45eb-bdf8-44d2f627fe5f.jpg)\n\n\nNote:   \nThe connection when using SDSPI, SDMMC will be described later.   \n\nNote:   \nLittleFS requires ESP-IDF V5.2 or later.   \n\n## WiFi Setting for Station-MODE\n\n![config-wifi-sta](https://user-images.githubusercontent.com/6020549/222010634-3c6736ff-0d35-4982-9e6f-d56c7b7dc870.jpg)\n\nYou can connect using the mDNS hostname instead of the IP address.   \n![config-wifi-2](https://user-images.githubusercontent.com/6020549/127940382-d431c962-746e-45d7-9693-3f844c0b01d3.jpg)\n\nYou can use static IP.   \n![config-wifi-3](https://user-images.githubusercontent.com/6020549/127940390-3edfb3ea-6545-4709-9786-3e8a944e5ac7.jpg)\n\n## WiFi Setting for AccessPoint-MODE\n\n![config-wifi-ap](https://user-images.githubusercontent.com/6020549/222010670-4d0ab08f-857c-4828-98e4-3c42e39f6f2a.jpg)\n\n\n## FTP Server Setting\n![config-server](https://user-images.githubusercontent.com/6020549/127940653-0d54f2ca-5dee-4c97-a7e7-276299237a41.jpg)\n\n\n\n# Using FATFS on SD card with SDSPI Interface\n\n|ESP32|ESP32S2/S3|ESP32C2/C3/C6|SPI card pin|Notes|\n|:-:|:-:|:-:|:-:|:--|\n|GPIO23|GPIO35|GPIO01|MOSI|10k pullup if can't mount|\n|GPIO19|GPIO37|GPIO03|MISO||\n|GPIO18|GPIO36|GPIO02|SCK||\n|GPIO14|GPIO34|GPIO04|CS|||\n|3.3V|3.3V|3.3V|VCC|Don't use 5V supply|\n|GND|GND|GND|GND||\n\n![config-filesystem-SDSPI](https://user-images.githubusercontent.com/6020549/165686735-21461822-f19e-47d5-aedc-b91401670098.jpg)\n\n__You can change it to any pin using menuconfig.__   \n\nNote:   \nThis project doesn't utilize card detect (CD) and write protect (WP) signals from SD card slot.   \n\nClick [here](https://github.com/espressif/esp-idf/tree/master/examples/storage/sd_card/sdspi) for details.   \n\n# Using FATFS on SD card with SDMMC Interface\n\nOn ESP32, SDMMC peripheral is connected to specific GPIO pins using the IO MUX.   \n__GPIO pins cannot be customized.__   \nGPIO2 and GPIO12 cannot be changed.   \nSince these GPIOs are BootStrap, it is very tricky to use 4-line SD mode with ESP32.   \nClick [here](https://github.com/espressif/esp-idf/tree/master/examples/storage/sd_card/sdmmc) for details.\n\n|ESP32 pin|SD card pin|Notes|\n|:-:|:-:|:--|\n|GPIO14|CLK|10k pullup|\n|GPIO15|CMD|10k pullup|\n|GPIO2|D0|10k pullup or connect to GPIO0|\n|GPIO4|D1|not used in 1-line SD mode; 10k pullup in 4-line SD mode|\n|GPIO12|D2|not used in 1-line SD mode; 10k pullup in 4-line SD mode|\n|GPIO13|D3|not used in 1-line SD mode, but card's D3 pin must have a 10k pullup\n|N/C|CD|not used in this project|\n|N/C|WP|not used in this project|\n|3.3V|VCC|Don't use 5V supply|\n|GND|GND||\n\n![config-filesystem-SDMMC-ESP32](https://user-images.githubusercontent.com/6020549/222021514-2e6bf65c-ccdb-49a4-b47d-b3c04367a7e3.jpg)\n\n\nOn ESP32-S3, SDMMC peripheral is connected to GPIO pins using GPIO matrix.   \n__This allows arbitrary GPIOs to be used to connect an SD card.__   \nClick [here](https://github.com/espressif/esp-idf/tree/master/examples/storage/sd_card/sdmmc) for details.   \nThe default settings are as follows. But you can change it.   \n\n|ESP32-S3 pin|SD card pin|Notes|\n|:-:|:-:|:--|\n|GPIO36|CLK|10k pullup|\n|GPIO35|CMD|10k pullup|\n|GPIO37|D0|10k pullup|\n|GPIO38|D1|not used in 1-line SD mode; 10k pullup in 4-line SD mode|\n|GPIO33|D2|not used in 1-line SD mode; 10k pullup in 4-line SD mode|\n|GPIO34|D3|not used in 1-line SD mode, but card's D3 pin must have a 10k pullup\n|N/C|CD|not used in this project|\n|N/C|WP|not used in this project|\n|3.3V|VCC|Don't use 5V supply|\n|GND|GND||\n\n![config-filesystem-SDMMC-ESP32S3](https://user-images.githubusercontent.com/6020549/222021554-d882563c-5a27-48f7-80c6-8caf1c41c544.jpg)\n\n# Using long file name support   \nBy default, FATFS file names can be up to 8 characters long.   \nIf you use filenames longer than 8 characters, you need to change the values below.   \n![config_long_file_name_support-1](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/dbae8910-74c9-4702-bdd4-881246e3fb95)\n![config_long_file_name_support-2](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/75d1ea99-86ff-40c0-8ffc-8bd30b9fc32e)\n![config_long_file_name_support-3](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/6e381627-e6f4-494d-ad40-04a73b49727b)\n\nLong File Name on FLASH.   \n![config_long_file_name_support-4](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/9fad16b1-0be4-4394-9bf0-347cd408152c)\n\nLong File Name on SDCARD.    \n![config_long_file_name_support-5](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/7a5912ae-c6e5-4fcd-8466-421d331d38f3)\n\nShort File Name on SDCARD\n![config_long_file_name_support-6](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/078c40fd-3ed2-44ec-9bf6-cfcc24bf1265)\n\n# Changing sector size when using wear levelling library   \nBy default, 4096-byte sectors are used.   \nYou can change it to 512-byte sectors using menuconfig.   \nThe 512-byte sector has Performance mode and Safety mode.   \n\n![config-serctor-seize-1](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/a3b6bfe8-8f54-4b5b-9521-54f81391efcf)\n![config-serctor-seize-2](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/57806d78-0cb5-4f16-bdc0-0b72f28e0acf)\n![config-serctor-seize-3](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/31ca5556-b3bf-41ab-b566-17849acd2837)\n![config-serctor-seize-4](https://github.com/nopnop2002/esp-idf-ftpServer/assets/6020549/5bc89f87-16b6-487d-a400-ebcb0fb94573)\n\n# Performance of each mode   \nUsing ESP32-CAM board and SanDisk Ultra 16GB Micro SD CARD.   \nEnable Long filename support (Long filename buffer in heap).   \n|File Syetem|Sector Size|Mode|Write Speed|Read Speed|\n|:-:|:-:|:-:|:-:|:-:|\n|LittlsFS on Builtin SPI Flash Memory|||51 kB/s|1678 kB/s|\n|FATFS on Builtin SPI Flash Memory|512|Safety|2 kB/s|1735 kB/s|\n|FATFS on Builtin SPI Flash Memory|512|Performance|5 kB/s|1735 kB/s|\n|FATFS on Builtin SPI Flash Memory|4096||46 kB/s|2625 kB/s|\n|FATFS on SD card with SDSPI Interface|4096||398 kB/s|610 kB/s|\n|FATFS on SD card with SDMMC Interface|4096|1Line|499 kB/s|875kB/s|\n|FATFS on SD card with SDMMC Interface|4096|4Line|572 kB/s|1190 kB/s|\n\n\n# Limitations   \n- The server does not support multiple connections.   \n- The server does not support active connection.    \n __Only passive connections are supported.__   \n Unfortunately, Windows standard ftp.exe does not allow passive mode (PASV) connections.   \n If you have to make a passive mode connection On Windows, you need to use another software such as FFFTP / WinSCP / FileZilla to connect in passive mode.   \n- The server can only process these commands.\n   * SYST\n   * CDUP\n   * CWD\n   * PWD\n   * XPWD(Same as PWD)\n   * SIZE\n   * MDTM(Always GMT)\n   * TYPE\n   * USER\n   * PASS\n   * PASV\n   * LIST\n   * RETR\n   * STOR\n   * DELE\n   * RMD\n   * MKD\n   * RNFR(Rename From)\n   * RNTO(Rename To)\n   * NOOP\n   * QUIT\n   * APPE\n   * NLST\n\n# Using LilyGo ESP32-S2\nThe LilyGo ESP32-S2 development board has a micro SD card slot on the board.   \nIt is connected to the ESP32 by SPI, and the peripheral power is supplied from GPIO14.   \nWith this, you can easily build an FTP server.   \n__No equipment other than the development board is required.__   \nIt works very stably.   \n\n![LilyGo-esp32-s2-1](https://user-images.githubusercontent.com/6020549/107864770-00f96100-6ea3-11eb-8549-6885ae398111.JPG)\n![LilyGo-esp32-s2-2](https://user-images.githubusercontent.com/6020549/127941181-63e48570-88ab-4d5b-8be7-343168079c4a.jpg)\n\n# Windows ftp client\nI tested these client.   \n__You need to set the connection type to Passive Mode.__   \n- WinSCP   \n![WinScp](https://github.com/user-attachments/assets/c3e26311-74ee-42a7-a316-c100a8575434)\n\n- FileZilla   \nYou need to make this setting when using FileZilla.\n![FileZilla-2](https://user-images.githubusercontent.com/6020549/131819541-0ad0aacb-ed79-45c3-a536-bd239463ef02.jpg)\n![FileZilla-1](https://github.com/user-attachments/assets/686a10ba-ef2d-4b15-be0f-80d321991f71)\n\n- FFFTP   \n![ffftp](https://github.com/user-attachments/assets/37ea0130-6847-4e93-8d83-669b4774be28)\n\n- Windows standard ftp.exe   \nUnfortunately, Windows standard ftp.exe does not allow passive mode (PASV) connections. \n\n# Troubleshooting   \nI sometimes get this error when using external SPI SD card readers.   \nRequires a PullUp resistor.   \n![sd-card-1](https://user-images.githubusercontent.com/6020549/107848058-fe135780-6e33-11eb-9eac-7ce160571276.jpg)\n\n\nYou can see all the logging on the server side by commenting it out here.   \n```\nvoid ftp_task (void *pvParameters)\n{\n  ESP_LOGI(FTP_TAG, \"ftp_task start\");\n  //esp_log_level_set(FTP_TAG, ESP_LOG_WARN); ------------\u003e Comment out\n  strcpy(ftp_user, CONFIG_FTP_USER);\n  strcpy(ftp_pass, CONFIG_FTP_PASSWORD);\n  ESP_LOGI(FTP_TAG, \"ftp_user:[%s] ftp_pass:[%s]\", ftp_user, ftp_pass);\n```\n\n\n# Reference\nhttps://github.com/nopnop2002/esp-idf-ftpClient\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-ftpserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fesp-idf-ftpserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-ftpserver/lists"}