7#include <ESPAsyncWebServer.h>
8#include <ESPAsyncWiFiManager.h>
59 WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP);
62 WiFiEvent_t::ARDUINO_EVENT_WIFI_AP_START);
65 WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
68 WiFiEvent_t::ARDUINO_EVENT_WIFI_AP_STOP);
72 debugI(
"Connected to wifi, SSID: %s (signal: %d)",
WiFi.SSID().c_str(),
74 debugI(
"IP address of Device: %s",
WiFi.localIP().toString().c_str());
75 debugI(
"Default route: %s",
WiFi.gatewayIP().toString().c_str());
76 debugI(
"DNS server: %s",
WiFi.dnsIP().toString().c_str());
81 debugI(
"WiFi Access Point enabled, SSID: %s",
WiFi.softAPSSID().c_str());
82 debugI(
"IP address of Device: %s",
WiFi.softAPIP().toString().c_str());
87 ReactESP::app->onDelay(
92 debugI(
"Disconnected from wifi.");
109 virtual void start()
override;
110 virtual void reset()
override;
141 bool wifi_manager_enabled_ =
true;
145 bool ap_mode_ =
false;
154 String wifi_manager_ap_ssid_ =
"";
156 String preset_password =
"";
157 String preset_hostname =
"";
161 String default_hostname =
"";
165 const char* wifi_manager_password_;
An object that is capable of having configuration data that can be set remotely using a RESTful API,...
Manages the ESP's connection to the Wifi network.
virtual void reset() override
virtual void get_configuration(JsonObject &doc) override final
void activate_wifi_manager()
void setup_wifi_manager()
Start WiFi using WiFi Manager.
virtual String get_config_schema() override
void set_wifi_manager_ap_ssid(String ssid)
void enable_wifi_manager(bool state)
void setup_saved_ssid()
Start WiFi using preset SSID and password.
virtual bool set_configuration(const JsonObject &config) override final
virtual void start() override
void wifi_station_connected()
void set_ap_mode(bool state)
Automatic calling of the reset() method when the device needs to be reset.
Automatic calling of the start() method at startup.
A base class for any sensor or piece of code that outputs a value for consumption elsewhere.
void emit(WiFiState new_value)
Provide information about the current WiFi state.
static WiFiStateProducer * instance_
void setup_wifi_callbacks()
void wifi_station_connected()
static WiFiStateProducer * get_singleton()
Get the singleton instance of the WiFiStateProducer.
virtual void start() override
void operator=(const WiFiStateProducer &)=delete
WiFiStateProducer(WiFiStateProducer &other)=delete