Using and ESP8266 and Arduino and SD Card

Looking to get some guidance on a project.

Project is to collect data from more than one sensor, store that data to an SD card. From there I would like to set up an FTP server on an ESP8266-01. So from what i can gather there might be some several ways that this can be accomplished.

First method:

SD Card connected to Arduino. An ESP8266 running a FTP Server. Use the Serial connection to communicate via the Arduino and ESP8266 allowing the the Arduino to pass the SD card infromation to the ESP8266 and the FTP Server. Is this possible to do this, I've looked at the Wire library and the Software Serial Library, but not totally sure if can work that way.

Second Method:

Connect the SD card module to both the Arduino and the ESP8266 and allow both Mirco-Controllers to use the one SD Card

I can not change the hardware due to space contrasts, so im not looking for one board solutions.

Thanks in advance

The first method is the way to go with a couple of exceptions. Use a software serial port to transfer the data from Arduino to ESP. That way you have the hardware serial for monitoring and troublshooting. The SD card uses SPI (not Wire) and the SD or SDFAT library.

groundfungus:
The first method is the way to go with a couple of exceptions. Use a software serial port to transfer the data from Arduino to ESP. That way you have the hardware serial for monitoring and troubleshooting. The SD card uses SPI (not Wire) and the SD or SDFAT library.

So going further into the rabbit hole with method one. Would I have transfer the file into the buffer of the ESP8266, and when the FTP is initialized the file is then transfered? If that is the case, im afraid that some of my files will be to large for the buffer to handle. Would there be good way to essentially stream the data from the sd card though the Arduino on to the ESP8266 on command from the FTP request?

Thanks

One comment about software serial and the ESP8266. I bought one to evaluate, and I discovered its baud rate defaulted, with each startup, to 115,200. The SW serial on a 16 MHz. arduino won't go that fast.

So here's the dilemma. You can reset the ESP8266 via a separate terminal program to a lower baud rate. But now if you power it down to put it in your intended circuit, it comes up at 115,200. But your circuit cannot now talk to it at that rate, so you are dead in the water. I solved my problem by moving to a Mega, with several hardware serial ports.

jrdoner:
One comment about software serial and the ESP8266. I bought one to evaluate, and I discovered its baud rate defaulted, with each startup, to 115,200. The SW serial on a 16 MHz. arduino won't go that fast.

So here's the dilemma. You can reset the ESP8266 via a separate terminal program to a lower baud rate. But now if you power it down to put it in your intended circuit, it comes up at 115,200. But your circuit cannot now talk to it at that rate, so you are dead in the water. I solved my problem by moving to a Mega, with several hardware serial ports.

Well the uC will be a teensy 3.2, but im using Arduino IDE to code it. So with being said the Teensy clocks at 96 Mhz. (thats overclocked), so it screaming :slight_smile:

I guess being fairly new to uC, im just not sure how to execute the transfer from the SD though the Teensy (uC) to the ESP via SW serial.

I found ESP-Link ( GitHub - jeelabs/esp-link: esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer), still digging in to what it is and how it works.

I guess how did you end up transferring the data to the ESP, (assuming you created a web Server/client).