Hi,
I'm building a captive portal for ESP12 to get user input. I've come up with an HTML code, but I'm wondering how to associate it with the ESP. Really appreciate if someone could guide/ advice me on the libraries to use or any websites I could refer to get an idea on this.
which particular ESP12 board do you have?
could you give some more details of the proposed project, e.g. do you wish ro run an Access Point on the device or just a webserver?
I assume you have loaded the ESP8266 libraries etc for the Arduino IDE
experiment with some of the code examples, e.g. click File>Examples to see a list of sample programs for the ESP8266. this should give you ideas where to start your project.
Hi @horace ,
Sorry I didn't mention earlier. I'm working with an ESP12F devkit. I'm to develop a captive portal for the ESP to connect to WiFi based on the SSID and password given by the user. The ESP is required to run as both an AP and a station, but mostly as a station. So I've already created the HTML code and figured how to connect to WiFi using ESP8266WiFi.h library. I'm lost on how to connect the two parts; the HTML web page and the ESP12 code.
And yes, I have downloaded quite a few libraries such as ESPAsyncTCP.h and ESPAsyncWebServer.h. I've tried some different codes which take inputs from a web page and run based on it using these libraries, but unfortunately, it gives me an error saying "Error compiling for board NodeMCU 0.9 (ESP-12 Module)".
And yes @horace , @kolaha , I tried the "Captive Portal Advanced" example given for DNSServer. It's almost the code I've been looking for. Although, when I try to connect to a nearby WiFi through it, I'm not sure if the ESP12F has connected to it (the serial monitor stays blank), and I couldn't see any message that says I have connected to the nearby WiFi.
Explaining the scenario further on, after uploading the CaptivePortalAdvanced code to the ESP, through my computer (on the computer's Network & internet settings) I see a WiFi option named ESP_ap. And I assume the ESP acts as an AP here. When I enter the password given by the code itself, it redirects me to a webpage, which mentions:
"You are connected through the soft AP: ESP_ap. You may want to config wifi".
When I click on 'config wifi', it redirects me to a page which lets me enter a nearby WiFi's SSID and pw. And I assume this lets the ESP switch to act as a station. But when I submit the details of the WiFi, I can't figure out if the ESP is connected to the wifi or not, since the serial monitor nor the web page doesn't indicate that the ESP has connected to a WiFi net. I'm pretty confused about this, and I'm not sure if my assumptions are correct.
I really apologize for my lack of knowledge, but hope you could explain what how I could figure out if the ESP is connected to the WiFi.