Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFi sniffer: change channel #11

Open
Quatrus opened this issue May 6, 2020 · 1 comment
Open

WiFi sniffer: change channel #11

Quatrus opened this issue May 6, 2020 · 1 comment

Comments

@Quatrus
Copy link

Quatrus commented May 6, 2020

Hi,
While testing the example from esp-idf/examples/wifi/simple_sniffer I found that esp_wifi_set_channel(...) did not work. One of the reasons was a missing call to esp_wifi_start();
One could see the following warning and the channel would not be changed!

W (592) wifi: STA is scanning or connecting, or AP has connected with external STAs, cannot set channel

This is fixed in your code but seems there is a second problem to get the capturing all the packets working.

Working on the same ESP-IDF example I had to use ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); to capture not only the broadcast messages but also ARP, DNS, DHCP, TCP, HTTP frames.

@risinek
Copy link

risinek commented Oct 17, 2020

Working on the same ESP-IDF example I had to use ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); to capture not only the broadcast messages but also ARP, DNS, DHCP, TCP, HTTP frames.

Also be aware of the condition on line 107 that will effectively skip all non management packets

if (type != WIFI_PKT_MGMT)
return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants