move Wifi credentials outside
This commit is contained in:
parent
8622090cf8
commit
4e1696bb65
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
|||||||
.vscode/c_cpp_properties.json
|
.vscode/c_cpp_properties.json
|
||||||
.vscode/launch.json
|
.vscode/launch.json
|
||||||
.vscode/ipch
|
.vscode/ipch
|
||||||
|
credentials.h
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
#include <ESP8266WiFiMulti.h>
|
#include <ESP8266WiFiMulti.h>
|
||||||
#include <ESP8266mDNS.h>
|
#include <ESP8266mDNS.h>
|
||||||
|
#include "credentials.h"
|
||||||
|
|
||||||
namespace Wifi {
|
namespace Wifi {
|
||||||
|
|
||||||
@ -18,8 +19,9 @@ namespace Wifi {
|
|||||||
WiFi.hostname("esp-clock");
|
WiFi.hostname("esp-clock");
|
||||||
|
|
||||||
ESP8266WiFiMulti wifiMulti;
|
ESP8266WiFiMulti wifiMulti;
|
||||||
wifiMulti.addAP("OpenWrt", "***REMOVED***");
|
for (int i = 0; i < sizeof(credentials)/sizeof(WifiCredentials); i++) {
|
||||||
wifiMulti.addAP("Miracle", "***REMOVED***");
|
wifiMulti.addAP(credentials[i].ssid, credentials[i].password);
|
||||||
|
}
|
||||||
|
|
||||||
Serial.println("Connecting to WiFi netowrk.");
|
Serial.println("Connecting to WiFi netowrk.");
|
||||||
while (wifiMulti.run() != WL_CONNECTED) {
|
while (wifiMulti.run() != WL_CONNECTED) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user