Notifications
Clear all

WiFiManager Tutorial Doesn't Seem to Work

24 Posts
3 Users
0 Likes
1,541 Views
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

Hi All!

I am running an esp32 in arduino framework.  I am using PlatformIO as my IDE.  I haven't had any issues with any of the other tutorials so I am fairly certain my installation is fine.  When I tried to follow the tutorial on WiFi manager, I got an error on compiling the sketch.  While <WiFiManager.h> is installed, the header file for WiFiManager also contains:

#include<ESP8266WiFi.h>
#include<ESP8266WebServer.h>
 
and on compiling it says "fatal error: ESP8266WiFi.h: No such file or directory"
 
I assumed that when I installed WiFiManager either these dependencies would be included or they would be included in the board setup for the esp32.  
I found this: https://github.com/esp8266/Arduino but I assume that is part of <Arduino.h>  which I have included in my project.  
 
Any help is appreciated.
 
Fish

   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

Posted by: @fishbone

Hi All!

I am running an esp32 in arduino framework.  I am using PlatformIO as my IDE.  I haven't had any issues with any of the other tutorials so I am fairly certain my installation is fine.  When I tried to follow the tutorial on WiFi manager, I got an error on compiling the sketch.  While <WiFiManager.h> is installed, the header file for WiFiManager also contains:

#include<ESP8266WiFi.h>
#include<ESP8266WebServer.h>
 
and on compiling it says "fatal error: ESP8266WiFi.h: No such file or directory"
 
I assumed that when I installed WiFiManager either these dependencies would be included or they would be included in the board setup for the esp32.  
I found this: https://github.com/esp8266/Arduino but I assume that is part of <Arduino.h>  which I have included in my project.  
 
Any help is appreciated.
 
Fish

I am looking at wifimgr.h and what it says is 

#ifdef ESP8266

extern "C" {
#include "user_interface.h"
}
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>

#ifdef WM_MDNS
#include <ESP8266mDNS.h>
#endif

#define WIFI_getChipId() ESP.getChipId()
#define WM_WIFIOPEN ENC_TYPE_NONE

Then it does a similar check for esp32.

Have you installed the esp8266 board file into the IDE (I have no idea how to do that in PlatformIO, even with over a half century of experience that beast is just too much) Here is the IDE entry, it goes in the same place as the esp32.

https://arduino.esp8266.com/stable/package_esp8266com_index.json

Here is a screen grab showing all my board files

Screenshot 2023 07 08 at 16.47.13

Does that help?

BTW, do NOT touch that github entry, that is something totally different and will mess you up totally.

 

 

 

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

.@fishbone Can you post the url of the sketch you are having trouble with, I need to check something

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Posted by: @fishbone

Hi All!

I am running an esp32 in arduino framework.  I am using PlatformIO as my IDE.  I haven't had any issues with any of the other tutorials so I am fairly certain my installation is fine.  When I tried to follow the tutorial on WiFi manager, I got an error on compiling the sketch.  While <WiFiManager.h> is installed, the header file for WiFiManager also contains:

#include<ESP8266WiFi.h>
#include<ESP8266WebServer.h>
 
and on compiling it says "fatal error: ESP8266WiFi.h: No such file or directory"
 
I assumed that when I installed WiFiManager either these dependencies would be included or they would be included in the board setup for the esp32.  
I found this: https://github.com/esp8266/Arduino but I assume that is part of <Arduino.h>  which I have included in my project.  
 
Any help is appreciated.
 
Fish

The first clue is... if you're actually on an ESP32, ESP8266 files are NOT compatible.

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@inq @fishbone My quick read of the header file I thought told me it used 8266 wifi headers as well, but if @Inq says no, then it's NO for sure. My suspicion now is that he has specified an 8266 board but has not entered the boards URL into the Additional Boards Manager.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@zander, @fishbone

There is nobody in this world that wishes they were compatible more than I.  🤣 

Since I have a WiFi manager built into my library, I've never used the one quoted, but I do recognize:

#include<ESP8266WiFi.h>
#include<ESP8266WebServer.h>
 
... and they are a part of the ESP8266 Boards library that will only run on ESP8266 hardware.  The fact that it says they are missing is consistent that they are not part of the ESP32 Boards library.  I don't know where you got the WiFi manager, but if you do a Google search for ESP32 WiFi Manager, you might find a library that will work with your  environment.
 
Good luck.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@zander@fishbone,

I think I found the Drone Bot Workshop tutorial.  And it does say it works on both.  It forward me to https://github.com/tzapu/WiFiManager .  There are two version on there, ESP8266 and ESP32.  You'll just need to load the right one for your hardware.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@inq I really hate to disagree with you, but I just compiled the WiFiMgr simple example with both boards. The library itself is a single thing with ifdef's for esp32 and esp8266. When I downloaded it many moons ago it was a single zip. If you want, I can provide screen grabs of both compiles and of the single library folder.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@zander,

I didn't say it couldn't be made to work with both if properly #ifdef'd, but it is apparent to me the one he's using either doesn't support both or the environment is not providing the proper flag to trigger the #ifdef correctly.  He also mentioned that he's not using the Arduino IDE, so it could be the environment or the library.  The one referenced in Bill tutorial has this:

image

... two different libraries.  I didn't download them, but the naming is described as WiFiManager, while yours is WiFiMgr.  Maybe, we're talking about two different libraries.  Maybe, he just needs to use yours or download the ESP32 one under the WiFiManager... his choice.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@inq The github remarks are either old or badly worded. The two hardware environments are managed with standard #ifdef 8266 etc. Here come the screen grabs. Sorry I don't know how to comment each one, but they should be fairly obvious. The 1st shows the Library entry, notice it says supports both esp8266 and esp32. The next two show successful compiles of each board. The next few show the single library and then the contents of the hdr file with a few ifdef's for esp8266 and esp32. Does that help?

Screenshot 2023 07 08 at 17.49.16
Screenshot 2023 07 08 at 17.48.43
Screenshot 2023 07 08 at 17.47.07
Screenshot 2023 07 08 at 17.49.48
Screenshot 2023 07 08 at 17.51.51
Screenshot 2023 07 08 at 17.50.27
Screenshot 2023 07 08 at 17.50.16

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

Posted by: @inq

@zander,

I didn't say it couldn't be made to work with both if properly #ifdef'd, but it is apparent to me the one he's using either doesn't support both or the environment is not providing the proper flag to trigger the #ifdef correctly.  He also mentioned that he's not using the Arduino IDE, so it could be the environment or the library.  The one referenced in Bill tutorial has this:

-- attachment is not available --

... two different libraries.  I didn't download them, but the naming is described as WiFiManager, while yours is WiFiMgr.  Maybe, we're talking about two different libraries.  Maybe, he just needs to use yours or download the ESP32 one under the WiFiManager... his choice.

I don't know what those other github entries are, but there is only one entry in the library manager, there is only one zip file to download. I have been using this library for a couple years for both esp8266 and esp32. I showed proof. 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@inq Here is a screen shot from Bill's WiFiManager article, it only mentions the one that I have used for years. If you look carefully you will see the following (pic of out of date) and then clicking the Known Issues (see pic) then clicking the 500 (see pic). Now back to the Arduino Library Manager and click the version drop down box. Note the change to version of 2.x.x that was previously 0.16.

Screenshot 2023 07 08 at 18.33.21
Screenshot 2023 07 08 at 18.37.48
Screenshot 2023 07 08 at 18.42.09
Screenshot 2023 07 08 at 18.35.56

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

Wow...you guys are good.  Sorry for the silence since I posted.  So here is what I found.  You guys were right.  Apparently the library registry in PlatformIO for WiFiManager had not been updated in 3 years!  I will take the blame for not checking on that.  Anyway, I guess 3 years ago it only referenced the Arduino library for use with esp8266.  Anyway, I installed the latest revision of WiFiManager library and it works for esp32.  I guess it is something I learned about PlatformIO...because it is used for so many different platforms, it may not necessarily have the latest libraries.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Posted by: @fishbone

Wow...you guys are good.  Sorry for the silence since I posted.  So here is what I found.  You guys were right.  Apparently the library registry in PlatformIO for WiFiManager had not been updated in 3 years!  I will take the blame for not checking on that.  Anyway, I guess 3 years ago it only referenced the Arduino library for use with esp8266.  Anyway, I installed the latest revision of WiFiManager library and it works for esp32.  I guess it is something I learned about PlatformIO...because it is used for so many different platforms, it may not necessarily have the latest libraries.

I have to hand it to you.  I found the PlatformIO system a real challenge.  I wanted to use the native version (not the Arduino based version) on ESP8266.  I got it working, but I finally abandoned it because I wanted my library to be accessible to the Arduino crowd directly.  It's a far bigger population than the ones in PlatformIO.  

Good luck on your project.

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@fishbone Good to hear you got it straightened away. You might want to hunt around for a setting that causes library and board updates to be applied automatically. At the moment, we are still seeing rp2040 (if you have that board configured) updates almost daily, that might be a clue.

I will have a quick peek, but like Inq, I find it a bit intimidating so don't use it since the ArduinoIDE handles everything I use (Arduino, esp8266, esp32, RaspberryPi PICO, rp2040, Teensy 4.1)

OOPS, I don't have PlatformIO installed anymore so I can't help with that part.

If you don't actually need multi-hardware targeting, why not just use the simpler easy-to-use Arduino IDE?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 2