Switch from promiscuous to AP mode

vangalvin
Posts: 6
Joined: Tue Oct 08, 2019 5:42 am

Switch from promiscuous to AP mode

Postby vangalvin » Thu Oct 10, 2019 11:13 pm

In my setup I have the following to enable me to scan and see if there is a know MAC address near by. Seems to work quite well.
The goal is if there is a known MAC address the unit will switch in to AP mode however I cant seem to find any information about changing this mode on the fly.

Is it possible to do that or will I need to set up a restart on the ESP32 before switching modes?

In my void setup()

Code: Select all

  /* setup wifi */
  wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
  esp_wifi_init(&cfg);
  esp_wifi_set_storage(WIFI_STORAGE_RAM);
  esp_wifi_set_mode(WIFI_MODE_NULL);
  esp_wifi_start();
  esp_wifi_set_promiscuous(true);
  esp_wifi_set_promiscuous_filter(&filt);
  esp_wifi_set_promiscuous_rx_cb(&sniffer);
  esp_wifi_set_channel(curChannel, WIFI_SECOND_CHAN_NONE);

Who is online

Users browsing this forum: No registered users and 108 guests