Seeking Advice on Displaying Sensor Data from SD Card on ESP8266 Webserver

Hello everyone,

I am currently working on a project that involves an ESP8266, an Arduino Mega, and various sensors. My ESP8266 is running a webserver, and it is connected to the Arduino Mega via a serial port. My sensors and an SD card are connected to the Arduino Mega, and the sensor readings are being recorded in a CSV file on the SD card.

The challenge I am facing is that I would like to display graphs on the ESP8266 webserver using the data stored on the SD card. While I have been successful in reading real-time sensor data, forming a JSON string from them, and sending this data to the ESP8266 via the serial port, I am struggling with reading and transferring the data from the CSV file.

I have tried passing data line by line from the CSV file, and also tried sending the entire JSON object, but in both cases, the ESP8266 throws a memory error. I should note that I'm not working with large amounts of data - I'm encountering issues even when trying to transfer just 60 lines (approximately 8 kilobytes) from the file.

I would appreciate any guidance or advice on the following:

  1. What is the best way to transfer data from the SD card to the ESP8266?
  2. How should I format the data for this transfer?
  3. How can I avoid memory errors on the ESP8266 during this process?

Thank you in advance for your help!

The one you understand.

To avoid memory problems on the Mega I would transfer the data as stored on the card and do the processing on the ESP.

By avoiding memory errors in your program. As you failed to post your code we cannot tell you where these may be.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.