[GH-ISSUE #1093] ESP32 Compatible? #933

Closed
opened 2026-02-28 01:27:44 +03:00 by kerem · 4 comments
Owner

Originally created by @ZebNZ on GitHub (Jul 9, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1093

Hi all,

I see in the .cpp file it has:
#if defined(ESP8266) || defined(ESP32)
My question is can this work with an ESP32? If ti can what do I need to do?

I know I would need to use different libraries.....
#include <ESP8266WiFi.h>
replace with:
#include <WiFi.h>

#include <ESP8266WebServer.h>
replace with:
#include <WebServer.h>

#include <WiFiManager.h>

Thanks,

Zeb

Originally created by @ZebNZ on GitHub (Jul 9, 2020). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1093 Hi all, I see in the .cpp file it has: #if defined(ESP8266) || defined(ESP32) My question is can this work with an ESP32? If ti can what do I need to do? I know I would need to use different libraries..... #include <ESP8266WiFi.h> replace with: #include <WiFi.h> #include <ESP8266WebServer.h> replace with: #include <WebServer.h> #include <WiFiManager.h> Thanks, Zeb
kerem closed this issue 2026-02-28 01:27:44 +03:00
Author
Owner

@ZebNZ commented on GitHub (Jul 9, 2020):

It looks like in the library it decides what libraries to use based on what you define (ESP8266 or ESP32), so I would only need to change the libraries in the .ino file.

So how do you define what board you're using?

<!-- gh-comment-id:655963087 --> @ZebNZ commented on GitHub (Jul 9, 2020): It looks like in the library it decides what libraries to use based on what you define (ESP8266 or ESP32), so I would only need to change the libraries in the .ino file. So how do you define what board you're using?
Author
Owner

@ZebNZ commented on GitHub (Jul 9, 2020):

All working :)

Just initialize your libraries at the top of the .ino file like this:
#include <FS.h>
#include "SPIFFS.h"
#include <WebServer.h>
#include <DNSServer.h>
#include <WiFi.h>
#include <WiFiManager.h>
#include <ArduinoJson.h>

And you might need to add this at the top of the setup()

  bool begin(bool formatOnFail=true, const char * basePath="/spiffs", uint8_t maxOpenFiles=10);
  SPIFFS.begin(true); //if it has started

Thanks,

Zeb

<!-- gh-comment-id:656005814 --> @ZebNZ commented on GitHub (Jul 9, 2020): All working :) Just initialize your libraries at the top of the .ino file like this: #include <FS.h> #include "SPIFFS.h" #include <WebServer.h> #include <DNSServer.h> #include <WiFi.h> #include <WiFiManager.h> #include <ArduinoJson.h> And you might need to add this at the top of the setup() ``` bool begin(bool formatOnFail=true, const char * basePath="/spiffs", uint8_t maxOpenFiles=10); SPIFFS.begin(true); //if it has started ``` Thanks, Zeb
Author
Owner

@tablatronix commented on GitHub (Jul 9, 2020):

The development branch fully supports both esp8266 and esp32, there is nothing you should need to do special
You should only have to include libs you are using not the rest

#include <FS.h>
#include "SPIFFS.h"
#include <WiFiManager.h>
#include <ArduinoJson.h>

<!-- gh-comment-id:656155169 --> @tablatronix commented on GitHub (Jul 9, 2020): The development branch fully supports both esp8266 and esp32, there is nothing you should need to do special You should only have to include libs you are using not the rest #include <FS.h> #include "SPIFFS.h" #include <WiFiManager.h> #include <ArduinoJson.h>
Author
Owner

@ZebNZ commented on GitHub (Jul 9, 2020):

@tablatronix that's awesome! Thanks for your help!

<!-- gh-comment-id:656327329 --> @ZebNZ commented on GitHub (Jul 9, 2020): @tablatronix that's awesome! Thanks for your help!
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#933
No description provided.