Access Point: Connect to wireless network "vulpes" and point your browser to URL http://192.168.0.1 (http, not https)
- Existing Network (advanced): Connect to the same existing network and use the proper IP address (useful if you have access to the router or a serial connection).
+ Existing Network (advanced): Connect to the same existing network and use the proper IP address (useful if you have access to the router or a serial connection).
+ If an existing network can't be connected to, an access point will be set up.
@@ -406,10 +407,13 @@ void setup() {
const char* password_char = yourInputPassword.c_str();
WiFi.begin(ssid_char, password_char);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
- Serial.println("WiFi Failed!");
+ Serial.println("WiFi Failed! Setting up access point 'vulpes'...");
// If you fail to connect, act as new access point
+ WiFi.disconnect(true);
WiFi.softAPConfig(local_ip, gateway, subnet);
WiFi.softAP(ssid_ap, password_ap);
+ // update the file so the webform is right
+ writeFile(SPIFFS, "/inputNetwork.txt", "0");
//return;
}
Serial.print("IP Address: ");