cotestatnt / esp-fs-webserver

ESP32/ESP8266 webserver, WiFi manager and web editor Arduino library
MIT License
105 stars 27 forks source link

Connect to WIFI that doesn't require a password #44

Closed Nickhofr closed 4 months ago

Nickhofr commented 4 months ago

Hi our community WIFI network does not require a password. Yet I am required to input a password when I try and connect to Wifi.

cotestatnt commented 4 months ago

Hi @Nickhofr The function for connecting to WiFi is integrated into the setup page.

To do what you need you could simply make your own custom copy without verifying the password field and associate your function with the connection button by removing the default one.

For example:

myWebServer.addJavascript(custom_wifi_conenction, "wifi");
Nickhofr commented 4 months ago

Hi thank you I appreciate your help. Forgive me but this is a little new for me. Could you give me more of a step by step instructions. Which file to edit, where to put code? I see there are a number of files in the setup folder. TIA.

Nickhofr commented 4 months ago

My persistence has payed off! I was able to copy your code of the function doConnection and replace the code from the app.js file. I followed the instructions from the readme.md file to run node minify.js in cmd. The issue that took me a while to resolve was that the compiler made a "static const unsigned char SETUP_HTML[] PROGMEM =" in the setup_htm.h rather then "static const unsigned char _acsetup_min_htm[] =". That resulted in an error when I tried sending the program to the esp32 in the arduino program. Eventually I renamed the heading in the setup_htm.h. It worked. Connected to WIFI without having to issue a Password. Huge thanks!

Nickhofr commented 4 months ago

I would say my issue is now it won't store my SSID. Every time I restart my Esp32 It sets up an AP rather then connect to the last WIFI SSID that I connected to.

Nickhofr commented 4 months ago

Hi can you help me this? I have tried a few things and can't get it to store my Wifi SSID.