I would like to setup an access point using the esp32 that logs any/failed access attempts
i have looked through some source files, and came across esp_event.h, which seems to allow registering an event handler, i wonder if this could be used to do the logging.
#include <WiFi.h>
const char* ssid = "tmp-AP";
const char* password = "123456789";
static void all_event_handler(void* handler_args, esp_event_base_t base, int32_t id, void* event_data){
Serial.println("all_event_handler");
}
void setup() {
delay(3000);
Serial.begin(9600);
Serial.println("test started...");
auto result = esp_event_handler_register(ESP_EVENT_ANY_BASE, ESP_EVENT_ANY_ID, all_event_handler,NULL);
Serial.print("result : ");
Serial.printlnprintf("result : %d - 0x%04x\n",result,result);
Serial.println("Setting up AP ...");
WiFi.softAP(ssid, password);
IPAddress IP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(IP);
}
void loop(){
}
the code compiles
esp_event_handler_register returns 259 for me, the handler is never called
i have cobbled together this code from :
arduino-esp32/libraries/WiFi/src/
i guess i would like to hook into at least NOT_AUTHED, 802_1X_AUTH_FAILED from