Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic open browser after connect to AP to load index.html saved on the SPIFFS #53

Closed
williamesp2015 opened this issue Mar 30, 2019 · 4 comments
Labels
question Further information is requested

Comments

@williamesp2015
Copy link

I really having difficulty to have a automatic loading index.html saved on the SPIFFS. I need to automatically open index.html without user require open browser and type the IP.

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
Serial.println("/");
Serial.println("redirecting to /index.html");
request->redirect("/index.html");
});
#if ESP8266
if(!SPIFFS.begin()){
Serial.println("SPIFFS Mount Failed");
}
#endif
#if ESP32
if(!SPIFFS.begin(true)){
Serial.println("SPIFFS Mount Failed on ..");
}
#endif

listDir(SPIFFS, "/", 0);
server.serveStatic("/", SPIFFS, "/").setCacheControl("max-age=600").setDefaultFile("index.html");
server.begin();
Thank you

@Hieromon
Copy link
Owner

Hieromon commented Mar 30, 2019

I can not understand your issue. What's the problem and what you want to do?
Or is this some requirement?, if so why do you present an example of AsyncWebServer? AutoConnect is not based on AyncWebServer.

@williamesp2015
Copy link
Author

Thanks @Hieromon . Non of AutoConnect Examples is able to automatically load index.html once connected to SoftAP so I am looking for help and I can ignore AsyncWebserver and use WebServer. I want simplify procedure for the user to just open SSID and automatically index.html pops like Airport webpage without typing the IP and load index.html file from SPIFFS.

@Hieromon Hieromon added the question Further information is requested label Mar 30, 2019
@Hieromon
Copy link
Owner

Hieromon commented Mar 30, 2019

I still cannot understand your request well.

I want simplify procedure for the user to just open SSID and automatically index.html pops

It is just using to the captive portal and You can mimic the DNS example of ESP8266.
Or do you want to pop up after ESP8266/ESP32 connecting to some AP as a station? Even so, you can still use the client device-side Capty Portal Detection, which has nothing to do with AutoConnect.

@Hieromon
Copy link
Owner

There is no response and the topic has no relation with AutoConnect. Close.

Repository owner locked as off-topic and limited conversation to collaborators Mar 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants