SpejsNode: Delay WiFi connection

settings
informatic 2019-05-08 14:24:33 +02:00
parent 21bf526897
commit 012bdd0735
2 changed files with 13 additions and 1 deletions

View File

@ -19,9 +19,14 @@ void SpejsNode::init(bool debug) {
debugf("*** SpejsNode init, runnning on: %s, current rom: %d", deviceID.c_str(), currentSlot);
System.onReady(SystemReadyDelegate(&SpejsNode::systemReady, this));
}
void SpejsNode::systemReady() {
WifiAccessPoint.enable(false);
WifiStation.enable(true);
WifiStation.config(WIFI_SSID, WIFI_PWD);
WifiStation.config(wifiSSID, wifiPassword);
WifiStation.connect();
WifiEvents.onStationGotIP(StationGotIPDelegate(&SpejsNode::gotIP, this));

View File

@ -69,6 +69,13 @@ protected:
void otaUpdateCallback(bool result);
void httpFile(HttpRequest &request, HttpResponse &response);
void httpIndex(HttpRequest &request, HttpResponse &response);
void systemReady(void);
String wifiSSID = WIFI_SSID;
String wifiPassword = WIFI_PWD;
bool brokerUseTLS = false;
public:
MqttClient mqtt;
HttpServer http;