• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 enduser setup Module aka Captive Portal

Q&A Forum › Category: ESP32 › ESP32 enduser setup Module aka Captive Portal
0 Vote Up Vote Down
Mudassir Tufail asked 2 years ago

Hello,
I see many examples of Captive portal for ESP32 – however none seems to provide me a similar WiFi Setup that we have for esp8266 where portal scans available WiFi and user to select one and input password (https://nodemcu.readthedocs.io/en/dev/modules/enduser-setup/).
I found one at https://hieromon.github.io/AutoConnect/index.html and was very hopeful that it will work with my esp32 / Platformio setup. I installed all required libraries but running into errors such as following. Could some one help me out please, thank you
Compiling .pio\build\nodemcu-32s\libfac\AutoConnect\AutoConnectOTA.cpp.o
*** [.pio\build\nodemcu-32s\src\main.cpp.o] Error 1
*** [.pio\build\nodemcu-32s\libd09\HTTPUpdate\HTTPUpdate.cpp.o] Error 1
In file included from .pio/libdeps/nodemcu-32s/AutoConnect/src/AutoConnectUpdate.h:45,
from .pio/libdeps/nodemcu-32s/AutoConnect/src/AutoConnectExt.hpp:24,
from .pio/libdeps/nodemcu-32s/AutoConnect/src/AutoConnectConfigAux.h:20,
from .pio/libdeps/nodemcu-32s/AutoConnect/src/AutoConnectConfigAux.cpp:14:
C:/Users/mtufa/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src/HTTPUpdate.h:76:29: error: ‘followRedirects_t’ has not been declared
void setFollowRedirects(followRedirects_t follow)
^~~~~~~~~~~~~~~~~
C:/Users/mtufa/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src/HTTPUpdate.h:94:32: error: ‘HTTPClient’ has not been declared
t_httpUpdate_return update(HTTPClient& httpClient,
^~~~~~~~~~
C:/Users/mtufa/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src/HTTPUpdate.h:97:38: error: ‘HTTPClient’ has not been declared
t_httpUpdate_return updateSpiffs(HTTPClient &httpClient, const String &currentVersion = “”);
^~~~~~~~~~
C:/Users/mtufa/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src/HTTPUpdate.h:109:38: error: ‘HTTPClient’ has not been declared
t_httpUpdate_return handleUpdate(HTTPClient& http, const String& currentVersion, bool spiffs = false);
 

Question Tags: platformio
7 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
What libraries and how did you install them?
Can you provide a link to the libraries you installed?
Regards,
Sara

0 Vote Up Vote Down
Mudassir Tufail answered 2 years ago

Thanks Sara for following up, please review the info below and let me know your inputs – many thanks in advance.
Libraries are:

[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
monitor_speed = 115200
lib_deps =
adafruit/Adafruit BME280 Library@^2.2.2
khoih-prog/ESP_WifiManager@^1.12.1
ottowinter/ESPAsyncWebServer-esphome@^3.0.0
arduino-libraries/ArduinoHttpClient@^0.4.0
hieromon/AutoConnect@^1.4.2
hieromon/PageBuilder@^1.5.6
bblanchon/ArduinoJson@^6.21.2

And here is main.cpp file is:

//https://hieromon.github.io/AutoConnect/gettingstarted.html

#include <WiFi.h>          // Replace with WiFi.h for ESP32
#include <WebServer.h>     // Replace with WebServer.h for ESP32
#include <AutoConnect.h>

#include <DNSServer.h>
#include <AsyncTCP.h>
#include “ESPAsyncWebServer.h”
#include “HttpClient.h”

#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include “functions.h”

WebServer Server;          // Replace with WebServer for ESP32
AutoConnect Portal(Server);

void rootPage() {
char content[] = “Hello, world”;
Server.send(200, “text/plain”, content);
}

void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();

Server.on(“/”, rootPage);
if (Portal.begin()) {
Serial.println(“WiFi connected: ” + WiFi.localIP().toString());
}
}

void loop() {
Portal.handleClient();
}

 

though functions.h file has nothing to do with error, I am copying here for reference:

Adafruit_BME280 bme;
float env_Temp()
{
Serial.print(“Temperature = “);
  float Temp = bme.readTemperature();
  Serial.print(Temp);
  Serial.println(“°C”);
  Serial.println();
  return Temp;
  }
float env_Press()
{
    Serial.print(“Pressure = “);
    float Press = bme.readPressure() / 100.0F ;
    Serial.print(Press);
    Serial.println(“hPa”);
    Serial.println();
    return Press;
  }
float env_Humid()
{
    Serial.print(“Humidity = “);
    float Humid = bme.readHumidity();
    Serial.print(Humid);
    Serial.println(“%”);
    Serial.println();
  return Humid;
  }

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
try using platform = espressif32@3.5.0 on your platformio file instead of platform = espressif32
 
let me know if this solves the problem.
 
regards 
Sara

0 Vote Up Vote Down
Mudassir Tufail answered 2 years ago

Hi Sara
I tried, but in vain.
I tested a different portal code (https://iotespresso.com/create-captive-portal-using-esp32/) and that seems to work. I edited it and now captures WiFi name and Password. I was really hoping that user does not have to input WiFi name (code scans all nearby WiFis and provide a list to user to select one). 
As for my original question/issue, it could be board issue. I have ordered another one (ESP32 WROOM) and will retry https://hieromon.github.io/AutoConnect/index.html with the new board. Meantime, if you have suggestions for me, please share.
Amicalement 
Mudassir

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
No, I don’t think it is a problem with the board.
I think it might be an issue with the libraries or dependencies of the configuration of your platformio.ini file.
When creating the Arduino project on VS Code, try selecting the DOIT board instead. Then, test the code again.
Regards,
Sara

0 Vote Up Vote Down
Mudassir Tufail answered 2 years ago

THANK YOU Sarah, I changed to DOIT board and it worked flawlessly. 
Now moving on to adding other functionalities that I need for the project.
Appreciate your help,
Regards
Mudassir

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Great!
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.