[GH-ISSUE #1247] Using WiFiManager with SPIFFS #1068

Closed
opened 2026-02-28 01:28:23 +03:00 by kerem · 6 comments
Owner

Originally created by @Schwenkner on GitHub (May 6, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1247

I've had a look into the samples using SPIFFS for saving additional parameters.
But I cannot getting it properly work for me. May be I'm doing something wrong.

Since I want to be able to access the config page also when the application is running, I'm doing
if (wifiManager.autoConnect("TestAP")) { wifiManager.startWebPortal(); }
It works fine, I get an AP, when nothing is configured and afterwards I get a connection. And I also can access the config page afterwards.

But when I include SPIFFS.begin(); into my code (doing this at the very beginning of setup every time an AP is created and tit does not connect to previously configured STA.
Sometimes, when I connect, then to the AP shows me that I'm connected. And in that case I can access the server with the AP as well as with STA. But almost only an AP is established.

Removing SPIFFS.begin() from my code, all works correct after I have configured ma STA again.
Without SPIFFS.begin() tried to read/write a config file, all fails.

Any ideas, what I may doing wrong?

Originally created by @Schwenkner on GitHub (May 6, 2021). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1247 I've had a look into the samples using SPIFFS for saving additional parameters. But I cannot getting it properly work for me. May be I'm doing something wrong. Since I want to be able to access the config page also when the application is running, I'm doing ` if (wifiManager.autoConnect("TestAP")) { wifiManager.startWebPortal(); } ` It works fine, I get an AP, when nothing is configured and afterwards I get a connection. And I also can access the config page afterwards. But when I include SPIFFS.begin(); into my code (doing this at the very beginning of setup every time an AP is created and tit does not connect to previously configured STA. Sometimes, when I connect, then to the AP shows me that I'm connected. And in that case I can access the server with the AP as well as with STA. But almost only an AP is established. Removing SPIFFS.begin() from my code, all works correct after I have configured ma STA again. Without SPIFFS.begin() tried to read/write a config file, all fails. Any ideas, what I may doing wrong?
kerem closed this issue 2026-02-28 01:28:23 +03:00
Author
Owner

@Schwenkner commented on GitHub (May 6, 2021):

I have played a bit more and installed the "AutoConnectWithFSParameters.ino" sample.
It behaves the same. Everytime I start the program new, an AP is established and no STA.

Further in the example logs I see:
mounting FS...
but no
mounted file system
which should be the next.

And when trying to save the parameters, I get:

saving config
failed to open config file for writing
{
  "mqtt_server": "192.168.178.80",
  "mqtt_port": "1883",
  "api_token": ""
}

<!-- gh-comment-id:833464034 --> @Schwenkner commented on GitHub (May 6, 2021): I have played a bit more and installed the "AutoConnectWithFSParameters.ino" sample. It behaves the same. Everytime I start the program new, an AP is established and no STA. Further in the example logs I see: `mounting FS...` but no `mounted file system` which should be the next. And when trying to save the parameters, I get: ``` saving config failed to open config file for writing { "mqtt_server": "192.168.178.80", "mqtt_port": "1883", "api_token": "" } ```
Author
Owner

@Schwenkner commented on GitHub (May 6, 2021):

Can it be that the WiFiManager uses SPIFFS for the netwaork credentials whe I include SPIFFS and otherwise EEPROM?
I've wrote a small test program for SPIFFS and it does not mount the file system.
May be then, that is the reason for my issues.

What could be the reason for the SPIFFS error?

<!-- gh-comment-id:833498794 --> @Schwenkner commented on GitHub (May 6, 2021): Can it be that the WiFiManager uses SPIFFS for the netwaork credentials whe I include SPIFFS and otherwise EEPROM? I've wrote a small test program for SPIFFS and it does not mount the file system. May be then, that is the reason for my issues. What could be the reason for the SPIFFS error?
Author
Owner

@Schwenkner commented on GitHub (May 6, 2021):

I've read something more about SPIFFS and Wemos D1 Mini.
I have the Pro version and it seems to have problems with SPIFFS.

After I switched to Mini R2 (not pro) I coud get SPIFFS working and also the WiFiManager.
Do not still understand all, but a bit more.

<!-- gh-comment-id:833528060 --> @Schwenkner commented on GitHub (May 6, 2021): I've read something more about SPIFFS and Wemos D1 Mini. I have the Pro version and it seems to have problems with SPIFFS. After I switched to Mini R2 (not pro) I coud get SPIFFS working and also the WiFiManager. Do not still understand all, but a bit more.
Author
Owner

@tablatronix commented on GitHub (May 6, 2021):

You should be using littlefs, spiffs is deprecated, WM does not save anything, esp lib does the credential saving for us

<!-- gh-comment-id:833725037 --> @tablatronix commented on GitHub (May 6, 2021): You should be using littlefs, spiffs is deprecated, WM does not save anything, esp lib does the credential saving for us
Author
Owner

@ji3g4m6zo6 commented on GitHub (Apr 10, 2022):

This work for me.

// Format SPIFFS if failed
SPIFFS.begin(true);
<!-- gh-comment-id:1094195674 --> @ji3g4m6zo6 commented on GitHub (Apr 10, 2022): This work for me. ``` // Format SPIFFS if failed SPIFFS.begin(true); ```
Author
Owner

@xelfe commented on GitHub (Apr 18, 2022):

This work for me.

// Format SPIFFS if failed
SPIFFS.begin(true);

It's work for me too but the static ip is not save. At reboot my node take the default IP (10, 0, 1, 99) instead of the one I entered into the portal.

<!-- gh-comment-id:1101408679 --> @xelfe commented on GitHub (Apr 18, 2022): > This work for me. > > ``` > // Format SPIFFS if failed > SPIFFS.begin(true); > ``` It's work for me too but the static ip is not save. At reboot my node take the default IP (10, 0, 1, 99) instead of the one I entered into the portal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1068
No description provided.