M
M
Maikesteps2016-03-16 21:31:30
Arduino
Maikesteps, 2016-03-16 21:31:30

How to make ftp client on ESP8266?

I can't find information on the internet. Preferably with arduino ide.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex_Gramm, 2016-03-21
@Alex_Gramm

You need to manually handle connections and send commands.
The list of commands is described here www.nsftools.com/tips/RawFTP.htm
For example, you can try the protocol through telnet. Here is an example of communicating with ftp.debian.org: pastebin.com/Cweysg4C
On an ESP it will be more convenient to use passive mode. To do this, before using the LIST RETR commands and some others, you need to send the PASV command, in response you will receive data for the second connection.
227 Entering Passive Mode (a1,a2,a3,a4,p1,p2)
where a1.a2.a3.a4 is the IP address and p1*256+p2 is the connection port.
For example, to get the contents of the debian folder:
send "PASV" to the answer comes
227 Entering Passive Mode (130,89,148,12,68,176).
Open a second connection on 130.89.148.12 on port 17584 (68*256+176)
After sending the "LIST debian" command in the first connection, the second will receive the answer
-rw-rw-r-- 1 1176 1176 1063 Mar 01 22:03 README
- rw-rw-r-- 1 1176 1176 1290 Jun 26 2010 README.CD-manufacture
-rw-rw-r-- 1 1176 1176 2591 Mar 01 22:03 README.html
....
drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools
Similar to receiving a file, its content will be sent to the second connection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question