diff --git a/src/main.cpp b/src/main.cpp index 6544ae3..edf476c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -15,6 +16,8 @@ Adafruit_MAX31855 thermocoupleB(CS_B); AsyncWebServer server(80); AsyncWebSocket ws("/ws"); +DNSServer dns; +AsyncWiFiManager wm(&server, &dns); JSONVar readings; @@ -109,13 +112,7 @@ void setup() { } WiFi.mode(WIFI_AP_STA); Serial.printf("wifi init\n"); - WiFi.begin("hackerspace.gr", "hsgrwifi"); - Serial.printf("connecting"); - while (WiFi.status() != WL_CONNECTED) { - Serial.printf("."); - delay(500); - } - Serial.printf(".\n"); + wm.autoConnect("therminator"); Serial.printf("connected! ip addr: "); Serial.println(WiFi.localIP());