Arduino Uno + DHT22 + ESP8266 + SD Card as FTP Server

Hello guys.. I think I need some help here..
I'm new at Arduino and i have a project here.
First, I setup ESP8266 with the Arduino UNO and connect to the router.
Meanwhile Arduino UNO read the DHT22 the temperature-Humidity value and then it will save to .txt format to the SD card. I've made it until here.

And the plan & the problem is to use PC as FTP client using FileZilla and get the .txt file and the SD card as the FTP server. Is this possible ? Can anyone give me any tips or guidance?
I've search from the other forum but what i found is using the ethernet (And i dont understand the code).

Thank you :slight_smile:
Sorry for the bad English..

You don't need the Uno nor the SD card.
Just use the ESP8266 to read the sensor, save it to the ESP8266's flash memory, serve the file from an HTTP server running on the ESP.
I don't see the need for an FTP server, you can just use HTTP. Just open the file in your browser or use wget to download it.

Here's a complete example that logs the temperature to a CSV file in the ESP's flash memory, serves a web page that displays a graph of the temperature over time, and you can easily download the CSV file by going to http://esp8266.local/temp.csv. It also uses the Network Time Protocol to correctly timestamp the measurements.
https://tttapa.github.io/ESP8266/Chap16 - Data Logging.html

Pieter

Thank you PieterP ! Sorry for late reply.
I've think about that too.
But the project I'm doing right now is my internship project and the company told me to make the system like they requested. I've been told that they've finished this project before but they used PHP request to get the data if i'm not wrong. But the cons using PHP request is when the connection lost they don't get the whole data. I mean the temp-humidity data is not complete. That's why they asked me to try using the FTP with esp8266.
And SD card is used so they could save the data for a long term because esp8266 flash memory itself is not that big.
:neutral_face: Hope I could get the idea how to do it.

If I were you, I would do the following.

Save the Uno for another project because it is not needed.

Google for an ESP8266 DHT22 example and save the temperature data to the SD card. You do not need an Uno to log temperature data to an SD card. The ESP8266 can do this by itself.

I would use the following hardware. One is an ESP8266 board the other is a datalogger board with SD card slot and battery powered real time clock. Other boards will work but allocate time for wiring them together and for troubleshooting.

Next modify this FTP server to use SD instead of SPIFFS. Or find another ESP8266 FTP server designed to work with SD.

Elektro14:
I've been told that they've finished this project before but they used PHP request to get the data if i'm not wrong. But the cons using PHP request is when the connection lost they don't get the whole data. I mean the temp-humidity data is not complete. That's why they asked me to try using the FTP with esp8266.

Did you mean "HTTP request"?
FTP and HTTP are both based on the underlying TCP protocol. If you lose the connection when the download is 50% complete, you've only received the first half of the file, regardless of the protocol. That's not a valid reason to use FTP over HTTP.
There's nothing to stop you from using FTP of course, but it's easier to use HTTP, and you can use the built-in web server libraries.

Elektro14:
And SD card is used so they could save the data for a long term because esp8266 flash memory itself is not that big.
:neutral_face: Hope I could get the idea how to do it.

Modern ESP8266 dev boards like the NodeMCU and WeMos D1 mini, and newer modules like the ESP-12 have 4 megabytes of flash storage, of which you can use up to 3MB for data storage.
Let's say you want to store a timestamp, a temperature value and a humidity value as comma separated values. A UNIX timestamp is 10 characters wide, depending on how you round the values, the temperature will probably be 4 or 5 characters ("##.##" format) and the humidity 1, 2 or 3 characters. You'll need two separators (e.g. a tab '\t' or a comma ','), and a carriage return + line ending.
The total size of one entry will be about 10+5+3+2+2 characters, or 22 bytes. 3MB = 3145728 bytes, divide that by 22 bytes, and you end up with 142,987 entries. (Ignoring all overhead caused by the file system.)
Let's say you take one measurement every ten minutes. That means that you have enough space for 1,429,870 minutes, or well over 2 years. That's more than enough time to move the gathered data to a server or computer.
If you save the data in a binary format (8 bytes for the timestamp + 2*2 bytes for the values), you could do even better, but you could corrupt all data if you have a framing error.

Of course, there are advantages to an SD card as well, like easy data recovery if the ESP would crash.

Like Gdsports mentioned, you can use the ESP to write to the SD card directly, you don't need an Arduino. It's even easier, because you can connect the SD card to the ESP directly, without any level shifters or additional ICs etc, because they both run at 3.3V.

gdsports:
I would use the following hardware. One is an ESP8266 board the other is a datalogger board with SD card slot and battery powered real time clock.

If the ESP has access to the Internet, you can use NTP to get the time, and you won't really need a real time clock. If you want maximum redundancy, you could always add a RTC module just in case the Internet is down for more than a day or so (but how likely is that, and even if it does happen, it's probably not that big of a deal if the time drifts a couple of seconds per day anyway).

Pieter