---
title: "W5500-EVB-picoを使用してftpserverを構築したい。ファイルシステムはLitterFSが使いたい"
url: "https://maker.wiznet.io/gemma/projects/w5500-evb-pico%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6ftpserver%E3%82%92%E6%A7%8B%E7%AF%89%E3%81%97%E3%81%9F%E3%81%84%E3%80%82%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%81%AFlitterfs%E3%81%8C%E4%BD%BF%E3%81%84%E3%81%9F%E3%81%84/"
markdown_url: "https://maker.wiznet.io/gemma/projects/w5500-evb-pico%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6ftpserver%E3%82%92%E6%A7%8B%E7%AF%89%E3%81%97%E3%81%9F%E3%81%84%E3%80%82%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%81%AFlitterfs%E3%81%8C%E4%BD%BF%E3%81%84%E3%81%9F%E3%81%84/md"
type: "UCC: User Created Content"
author: "ToolsBox"
author_url: "https://www.toolsbox.biz/nonsense/RP2040/ftpserver.html"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "ToolsBox"
original_url: "https://www.toolsbox.biz/nonsense/RP2040/ftpserver.html"
published: "2023-06-02"
language: "ja"
hardware: ["WIZnet W5500-EVB-Pico"]
likes: 0
views: 184
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# W5500-EVB-picoを使用してftpserverを構築したい。ファイルシステムはLitterFSが使いたい

> I want to build an ftpserver using W5500-EVB-pico. I want to use LitterFS as the file system

Original author: ToolsBox (source: https://www.toolsbox.biz/nonsense/RP2040/ftpserver.html)

## Components

- **WIZnet W5500-EVB-Pico** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/w5500-evb-pico))

## Article

The RP2040 can equip 2MB to 16MB of flash memory. Of the flash memory, 1MB is used for sketches, and the rest can be used as a file system. I wanted to build an FTPSERVER so that I can read and write about this file system with FTP. However, I can't find the appropriate example and feel that the departure is quite high.
I want to keep this construction process as a record.

First of all, it is known that using flash memory as a file system can be realized by using the Earl Library Littlefs.
Since W5500-EVB-PICO has a 2MB flash, select a 1MB file system of 1MB file system in the Arduinoide1.x environment> FlashSize. It seems to be formatted each time you write a sketch

For the time being, the compilation came through the library combination that passed, but when I executed it, the ping did not pass. It is strange. It is likely to be a try and error for a while.
* Arduinoide1.x is difficult to debug, but Arduinoide2.x is still less flexible as Arduinoide1.x. For a while, it seems that I will have to challenge with Arduinoide1.8.19.
* It will break the serial driver quite a bit. UF2 files for initialization must be prepared in advance.

Although it is a FTPSERVER library, there is a similar thing called SimpleFtpserver.h and SimpleFtpserver.h. First of all, I used SimpleFtpserver.h,

- The compilation passed.

- After automatically transferring the file, open the serial monitor
  15: 12: 12.500-> Server is at 192.168.0.208
  15: 12: 12.534-> Littlefs Opened!
  SETUP passed properly

- The LED of the pico board has flashed. I confirmed that LOOP () was entered.

- Run ping 192.168.0.208 from the console
  192.168.0.208 Ping is sending 32 byte data:
  Response from 192.168.0.208: Number of bytes = 32 hours &lt;1ms TTL = 128
  Response from 192.168.0.208: Number of bytes = 32 hours &lt;1ms TTL = 128
  Response from 192.168.0.208: Number of bytes = 32 hours &lt;1ms TTL = 128
  Response from 192.168.0.208: Number of bytes = 32 hours &lt;1ms TTL = 128

- 192.168.0.208 ping statistics:
  Number of packets: transmission = 4, reception = 4, loss = 0 (0% loss),
  Estimated round trip time (milliseconds):
  Small = 0ms, maximum = 0ms, average = 0ms

- No problem.

- I accessed it from the FTP client. I accessed Port 21 with the file transfer tool of the homepage builder, but an error occurred and it did not work well. This tool does not have an error code. Let's change the tool.

- FFFTP had a history remaining, so I wondered why I could not connect, so I did it.
  -----
  The communication is not encrypted.
  A third party may intercept your password and content.
  It is connected to the host 192.168.0.208 (192.168.0.208:21).
  I can't connect.

- You can also access Windows Explorer.
  ftp: // User name: password @ip address/
  I will access.
  I did it and saw it. The result was unable to connect to the server.

- The executed source is as follows.

- I changed the library of the FTPSERVER to SimpleFtpserver.h, but this is not compiled. It's a bit of a hand.

I want to build FTPSERVER using W5500-EVB-PICO. It has not been realized at this time. I will cool my head and consider another solution.

If you want to see full code, refer to this [link](https://www.toolsbox.biz/nonsense/RP2040/ftpserver.html).

This code is an example code written in CHATGPT. Please refer to the unproven code.

```cpp
#include <SPI.h>
#include <Ethernet2.h>
#include <LittleFS.h>
#include <ESP8266FtpServer.h>

#define FTP_USER "your_username"
#define FTP_PASS "your_password"

EthernetServer server(21);
ESP8266FtpServer ftpSrv;

void setup() {
  Serial.begin(115200);

  // Initialize Ethernet and FTP server
  Ethernet.begin(mac);
  LittleFS.begin();
  server.begin();
  ftpSrv.begin(FTP_USER, FTP_PASS);
  
  Serial.println("FTP server started.");
}

void loop() {
  // Handle FTP server client connections
  ftpSrv.handleFTP();

  // Additional code for your sketch
}
```

---

Source: https://maker.wiznet.io/gemma/projects/w5500-evb-pico%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6ftpserver%E3%82%92%E6%A7%8B%E7%AF%89%E3%81%97%E3%81%9F%E3%81%84%E3%80%82%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%81%AFlitterfs%E3%81%8C%E4%BD%BF%E3%81%84%E3%81%9F%E3%81%84/
