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:
- What is the best way to transfer data from the SD card to the ESP8266?
- How should I format the data for this transfer?
- How can I avoid memory errors on the ESP8266 during this process?
Thank you in advance for your help!