SpejsNode: Delay WiFi connection
parent
21bf526897
commit
012bdd0735
|
@ -19,9 +19,14 @@ void SpejsNode::init(bool debug) {
|
||||||
|
|
||||||
debugf("*** SpejsNode init, runnning on: %s, current rom: %d", deviceID.c_str(), currentSlot);
|
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);
|
WifiAccessPoint.enable(false);
|
||||||
WifiStation.enable(true);
|
WifiStation.enable(true);
|
||||||
WifiStation.config(WIFI_SSID, WIFI_PWD);
|
WifiStation.config(wifiSSID, wifiPassword);
|
||||||
|
WifiStation.connect();
|
||||||
|
|
||||||
WifiEvents.onStationGotIP(StationGotIPDelegate(&SpejsNode::gotIP, this));
|
WifiEvents.onStationGotIP(StationGotIPDelegate(&SpejsNode::gotIP, this));
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,13 @@ protected:
|
||||||
void otaUpdateCallback(bool result);
|
void otaUpdateCallback(bool result);
|
||||||
void httpFile(HttpRequest &request, HttpResponse &response);
|
void httpFile(HttpRequest &request, HttpResponse &response);
|
||||||
void httpIndex(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:
|
public:
|
||||||
MqttClient mqtt;
|
MqttClient mqtt;
|
||||||
HttpServer http;
|
HttpServer http;
|
||||||
|
|
Loading…
Reference in New Issue