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:
}
It seems to hang in the SD_open call. Enclosed is the screenshot of the Serial Monitor.
If it works for you, the only thing i can think of is library versions.
I am using WiFi Release 1.2.7
SD 1.2.4 , but i also tried the version that was modified 2 days ago for a 4K sector size, but it did not make a difference.
All other libraries were loaded last week. Without the SD card libraries, the WiFi works fine for me.
Thanks for your help, Blane
Just had a look, seems like there is bug in the latest commit. We will look into this FS running with Wi-Fi. For now, you can roll back the previous commit and they work together.
Hi @ansonhe97
I updated the WiFi library, SD card library, etc. to the latest version.
It is not possible to use SD and WiFi at the same time. Wio Terminal freezes.
please check.
I used the example of the first post by @blanee
I want to save a file while connecting to WiFi.
PS: Of course, I already had this problem that I had to downgrade to Seeed_Arduino_FS-1.0.0.
Year 2024, Seeed_Arduino_FS 2.1.1, when I added rpcWifi, (sibling’s library), SD/card/ wio terminal freezes ( blue light blnking 3 times…
Any new ideas?