Add WiFiManager
This commit is contained in:
parent
37736012d4
commit
a6622975e3
11
src/main.cpp
11
src/main.cpp
|
@ -3,6 +3,7 @@
|
|||
#include <Arduino_JSON.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include <ESPAsyncWiFiManager.h>
|
||||
#include <LittleFS.h>
|
||||
#include <SPI.h>
|
||||
#include <pinout.h>
|
||||
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in a new issue