SHA256
BUGFIX:WiFi-Handler
This commit is contained in:
1 parent
058aa39b9c
commit
9c21611c81
3 files changed
+8
-1
No files matched your search
@@ -4,6 +4,9 @@
|
|||||||
#include "Network.h"
|
#include "Network.h"
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern volatile bool websocket_connected;
|
||||||
|
|
||||||
class wifi_conf {
|
class wifi_conf {
|
||||||
private:
|
private:
|
||||||
const char* _ssid;
|
const char* _ssid;
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
#include "WiFiConf.h"
|
#include "WiFiConf.h"
|
||||||
|
|
||||||
|
extern volatile bool websocket_connected;
|
||||||
|
|
||||||
void wifi_conf::handler_WiFi(arduino_event_id_t event, arduino_event_info_t info) {
|
void wifi_conf::handler_WiFi(arduino_event_id_t event, arduino_event_info_t info) {
|
||||||
|
|
||||||
switch(event){
|
switch(event){
|
||||||
|
|
||||||
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
|
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
|
||||||
|
websocket_connected = true;
|
||||||
Serial.printf("Wi-Fi conectado\n");
|
Serial.printf("Wi-Fi conectado\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -13,6 +16,7 @@ void wifi_conf::handler_WiFi(arduino_event_id_t event, arduino_event_info_t info
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
||||||
|
websocket_connected = false;
|
||||||
Serial.printf("WiFi: Desconectado\n");
|
Serial.printf("WiFi: Desconectado\n");
|
||||||
Serial.printf("DEBUG: Reconectando...\n");
|
Serial.printf("DEBUG: Reconectando...\n");
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ IPAddress gateway(192,168,0,1);
|
|||||||
IPAddress subnet(255,255,255,0);
|
IPAddress subnet(255,255,255,0);
|
||||||
IPAddress dns1(192,168,0,100);
|
IPAddress dns1(192,168,0,100);
|
||||||
IPAddress dns2(1,1,1,1);
|
IPAddress dns2(1,1,1,1);
|
||||||
|
volatile bool websocket_connected = false;
|
||||||
|
|
||||||
wifi_conf sta_esp32;
|
wifi_conf sta_esp32;
|
||||||
WebSocketsServer webSocket(81);
|
WebSocketsServer webSocket(81);
|
||||||
|
|||||||
Reference in new issue
Block a user