Skip to content

Commit 1223def

Browse files
committed
stopped using WifiMulti for connection to networks
1 parent ce4ea6d commit 1223def

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/WifiConnection.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
#pragma once
22

33
#include <WiFi.h>
4-
#include <WiFiMulti.h>
54

6-
namespace WifiConnection {
7-
WiFiMulti wifiMulti;
8-
5+
namespace WifiConnection {
96
// Sets wifi mode to STA and tries to connect to a network
107
void tryConnect(String ssid, String pass) {
118
WiFi.mode(WIFI_STA);
12-
wifiMulti.addAP(ssid.c_str(), pass.c_str());
9+
WiFi.begin(ssid.c_str(), pass.c_str());
1310
}
1411

1512
// Method for checking if currently connected to wifi
1613
boolean isConnected() {
17-
return wifiMulti.run() == WL_CONNECTED;
14+
return WiFi.status() == WL_CONNECTED;
1815
}
1916
};

0 commit comments

Comments
 (0)