- wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
- ESP_ERROR_CHECK(esp_wifi_init(&cfg));
- ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
- ESP_ERROR_CHECK(esp_wifi_start());
- ESP_ERROR_CHECK(esp_wifi_set_promiscuous(true));
- ESP_ERROR_CHECK(esp_wifi_set_promiscuous_rx_cb(&sniffer));
- wifi_promiscuous_filter_t filter = {
- .filter_mask = WIFI_PROMIS_CTRL_FILTER_MASK_ALL|WIFI_PROMIS_FILTER_MASK_DATA|WIFI_PROMIS_FILTER_MASK_CTRL;
- };
- ESP_ERROR_CHECK(esp_wifi_set_promiscuous_filter(&filter));
esp32 wifi promiscuous mode, no control frame captured
esp32 wifi promiscuous mode, no control frame captured
Hi, I'm doing a project to capture WiFi ACK frames under promiscuous mode. These are part of the initialization codes:
I've also tried other combinations of filters, but none of them can capture any control frame. Meanwhile, the Management frames and the Data frames can be captured successfully. Does anyone have some ideas?
Re: esp32 wifi promiscuous mode, no control frame captured
Ok, I solved it. It turns out that the ctrl frame filter needs to be set separately via "esp_wifi_set_promiscuous_ctrl_filter"
Re: esp32 wifi promiscuous mode, no control frame captured
Can you please post a working filtering example? Is esp_wifi_set_promiscuous_filter() still needed, or just esp_wifi_set_promiscuous_ctrl_filter()?
Thanks!
Thanks!
Re: esp32 wifi promiscuous mode, no control frame captured
Sorry for the late reply. Yes, both are needed. One is for enabling the capture of ctrl packets and the other is for specifying the packet type.
- ESP_ERROR_CHECK(esp_wifi_set_promiscuous_rx_cb(&sniffer));
- wifi_promiscuous_filter_t filter = {
- .filter_mask = WIFI_PROMIS_FILTER_MASK_DATA|WIFI_PROMIS_FILTER_MASK_CTRL
- };
- ESP_ERROR_CHECK(esp_wifi_set_promiscuous_filter(&filter));
- wifi_promiscuous_filter_t ctrl_filter = {
- .filter_mask = WIFI_PROMIS_CTRL_FILTER_MASK_ACK
- };
- ESP_ERROR_CHECK(esp_wifi_set_promiscuous_ctrl_filter(&ctrl_filter));
- esp_wifi_get_promiscuous_filter(&filter);
Who is online
Users browsing this forum: kaxx1975 and 153 guests