espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.26k stars 1.56k forks source link

Allow WiFi sniffer to dump frames with wrong FCS (GIT8266O-573) #996

Open doragasu opened 3 years ago

doragasu commented 3 years ago

Environment

Problem Description

I have been testing the WiFi Sniffer using the example code. I got it to start and I can see frames with correct FCS (Frame Check Sequence), but I am not able to see frames with wrong FCS. I need to be able to monitor packets with incorrect FCS for my application. This can be achieved on a Linux PC with compatible drivers with command: # iw dev <radio_device> set monitor fcsfail. But it seems there is no way to do this on ESP8266/ESP32

Expected Behavior

WiFi Sniffer allows to dump packets with wrong FCS. This could be disabled by default, but enabled with an API call, like e.g.: esp_wifi_set_fcsfail(boolean enable)

Actual Behavior

WiFi Sniffer does not show packets with wrong FCS, only packets with valid FCS field are dumped. It seems there is no API call to enable these packets to be dumped.

Steps to repropduce

  1. Build, flash and start (monitor) the sniffer example.
  2. On a PC, generate WiFi frames with invalid FCS. Make sure they are generated on the same WiFi channel the sniffer is configured in.
  3. Browse the frames captured by the sniffer. The frames with incorrect FCS will not be shown.
dawidchyrzynski commented 3 years ago

@doragasu Have you found any workaround for this? I need to count packets with invalid FCS but it doesn't seem to be possible.

doragasu commented 3 years ago

Hi,

I did not find a workaround using an ESP8266, but this was finally implemented for ESP32 chips. Setting up the filter might be a bit tricky, but works. You can see more info in this issue: https://github.com/espressif/esp-idf/issues/6473