mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 13:25:03 +01:00
remove network from activation phase
This commit is contained in:
@@ -22,14 +22,12 @@ Network* WiFiNet::init() {
|
||||
return this;
|
||||
}
|
||||
int WiFiNet::connect(){
|
||||
if(config.valid){
|
||||
WiFi.hostname(config.hostname);
|
||||
Serial.println("Hostname: " + config.hostname);
|
||||
if(!connectStation()) {
|
||||
createAccessPoint();
|
||||
}
|
||||
startDNS();
|
||||
WiFi.hostname(config.hostname);
|
||||
Serial.println("Hostname: " + config.hostname);
|
||||
if(!connectStation()) {
|
||||
createAccessPoint();
|
||||
}
|
||||
startDNS();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -41,6 +39,7 @@ int WiFiNet::connectStation(){
|
||||
WiFi.begin(config.stationSSID.c_str(), config.stationPassword.c_str());
|
||||
Serial.println("connect to " + config.stationSSID);
|
||||
|
||||
// TODO use tasks
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
|
||||
Reference in New Issue
Block a user