So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By PatrickJohn
#61761 How do I display the contents of my ".txt" file from the SD card module to a web browser using the ESP8266-01. I configured the ESP8266 as an AP(Access Point) and tried sending characters and strings to the web browser using the +CIPSEND command. The problem is I that I need to display the data from the SD card to the web browser and have no idea how to access the file using the ESP8266. Note: I am coding in Arduino IDE
User avatar
By g6ejd
#61771 void SD_view() {
if (SD_present) {
File dataFile = SD.open("datalog.txt", FILE_READ); // Now read data from SD Card
if (dataFile) {
if (dataFile.available()) { // If data is available and present
String dataType = "application/octet-stream";
if (server.streamFile(dataFile, dataType) != dataFile.size()) {Serial.print(F("Sent less data than expected!")); }
}
}
dataFile.close(); // close the file:
}
}