Page 1 of 1

Promiscuous mode and connected at the same time

Posted: Tue Jun 20, 2017 9:01 pm
by dsiganos
Is it possible to be connected to an access point as a station and also be in promiscuous mode?

For example, could this code remain connected to the access point even after the call to esp_wifi_set_promiscuous(1)?

Code: Select all

    tcpip_adapter_init();
    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&cfg));
    wifi_config_t wifi_config = {
        .sta = {
            .ssid = DEFAULT_SSID,
            .password = DEFAULT_PWD
        },
    };
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
    ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config));
    ESP_ERROR_CHECK(esp_wifi_start());

    ESP_ERROR_CHECK(esp_wifi_set_promiscuous_rx_cb(sniffcb));
    ESP_ERROR_CHECK(esp_wifi_set_promiscuous(1));