I am trying to create an AP which has a http server and stores data on the SD card. I am having an issue where i can’t get both to work in the same sketch. In the below sketch the SD card works if i comment out the WiFi includes. Any Suggestions ? ( APinfo.html is an arbitrary file on the SD card. Card is 8 GB formatted with FAT32.
Output when code fails:
Initializing SD card…initialization done.
//--------Start of Sketch -------
#include <Seeed_FS.h>
#include "SD/Seeed_SD.h"
#include <AtWiFi.h> // Remove these two lines and File System works
#include <WiFiClient.h> //
//#include <SPI.h>
File myFile; //Intialise the file Class and named it myFile
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial) {
}
Serial.print("Initializing SD card...");
if (!SD.begin(SDCARD_SS_PIN, SDCARD_SPI)) {
Serial.println("SD initialization failed!");
while (1);
}
Serial.println("initialization done.");
Serial.println();
myFile = SD.open("APinfo.html", FILE_READ); //Read Mode
if (myFile)
{
Serial.println("APinfo.html:");
// read from the file until there's nothing else in it:
while (myFile.available())
{
Serial.write(myFile.read());
}
// close the file:
myFile.close();
}
else
{
// if the file didn't open, print an error:
Serial.println("Error APinfo.html");
}
}
void loop() {
// put your main code here, to run repeatedly:
}