From 825943c2e5ebaf160f81f15d6974fbb70684afd0 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Tue, 20 Mar 2018 22:58:51 +0100 Subject: [PATCH] wifisniffer.cpp: settings changed --- src/main.h | 2 +- src/wifisniffer.cpp | 32 ++++++++------------------------ 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/main.h b/src/main.h index 53f8454e..2a3fd2f2 100644 --- a/src/main.h +++ b/src/main.h @@ -1,5 +1,5 @@ // program version -#define PROGVERSION "1.2.2" // use max 10 chars here! +#define PROGVERSION "1.2.21" // use max 10 chars here! #define PROGNAME "PAXCNT" // Verbose enables serial output diff --git a/src/wifisniffer.cpp b/src/wifisniffer.cpp index 4cbd4b6b..56ed9060 100644 --- a/src/wifisniffer.cpp +++ b/src/wifisniffer.cpp @@ -13,23 +13,6 @@ #include #include -#define WIFI_INIT_CONFIG_PAXCOUNTER() { \ - .event_handler = &esp_event_send, \ - .wpa_crypto_funcs = g_wifi_default_wpa_crypto_funcs, \ - .static_rx_buf_num = CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM,\ - .dynamic_rx_buf_num = CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM,\ - .tx_buf_type = CONFIG_ESP32_WIFI_TX_BUFFER_TYPE,\ - .static_tx_buf_num = WIFI_STATIC_TX_BUFFER_NUM,\ - .dynamic_tx_buf_num = WIFI_DYNAMIC_TX_BUFFER_NUM,\ - .ampdu_rx_enable = WIFI_AMPDU_RX_ENABLED,\ - .ampdu_tx_enable = WIFI_AMPDU_TX_ENABLED,\ - .nvs_enable = 0,\ - .nano_enable = WIFI_NANO_FORMAT_ENABLED,\ - .tx_ba_win = WIFI_DEFAULT_TX_BA_WIN,\ - .rx_ba_win = WIFI_DEFAULT_RX_BA_WIN,\ - .magic = WIFI_INIT_CONFIG_MAGIC\ -}; - // Local logging tag static const char *TAG = "wifisniffer"; @@ -61,13 +44,14 @@ typedef struct { } wifi_ieee80211_packet_t; void wifi_sniffer_init(void) { - wifi_init_config_t cfg = WIFI_INIT_CONFIG_PAXCOUNTER(); - ESP_ERROR_CHECK( esp_wifi_init(&cfg) ); - ESP_ERROR_CHECK( esp_wifi_set_country(&wifi_country) ); - ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) ); - ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_NULL) ); - ESP_ERROR_CHECK( esp_wifi_start() ); - ESP_ERROR_CHECK( esp_wifi_set_max_tx_power(-128) ); // we don't need to TX, so we use lowest power level to save energy + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + cfg.nvs_enable = 0; // we don't want wifi settings from NVRAM + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + ESP_ERROR_CHECK(esp_wifi_set_country(&wifi_country)); + //ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) ); + //ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_NULL) ); + //ESP_ERROR_CHECK( esp_wifi_start() ); + //ESP_ERROR_CHECK( esp_wifi_set_max_tx_power(-128) ); // we don't need to TX, so we use lowest power level to save energy wifi_promiscuous_filter_t filter = {.filter_mask = WIFI_PROMIS_FILTER_MASK_MGMT}; // we need only MGMT frames ESP_ERROR_CHECK(esp_wifi_set_promiscuous_filter(&filter)); // set MAC frame filter ESP_ERROR_CHECK(esp_wifi_set_promiscuous_rx_cb(&wifi_sniffer_packet_handler));