#include "theSecrets.h" #include "WiFi.h" #include "esp32Firewall.hpp" const char *esp_ip_address; esp32Firewall *firewall; void setup_wifi() { uint8_t max_retries = 5; uint8_t retries = 1; log_i("Attempting to connect to WPA SSID: %s", ssid); WiFi.mode(WIFI_STA); WiFi.begin(ssid, psk); while (WiFi.status() != WL_CONNECTED && retries <= max_retries) { delay(2000); log_d("Connecting... (%i/%i)", retries++, max_retries); } esp_ip_address = WiFi.localIP().toString().c_str(); log_i("Connected, IP Address: %s", esp_ip_address); } void setup() { setup_wifi(); firewall = new esp32Firewall; } void loop() { firewall->handle_firewall_api_clients(); }