From daa0b2e58e64399b3eb9572e5c8114fb30e51785 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Tue, 20 Mar 2018 22:14:43 +0100 Subject: [PATCH] set wifi_init_config NVS flash: disabled --- src/main.cpp | 2 ++ src/main.h | 2 +- src/wifisniffer.cpp | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ec5a8adf..7bbec75b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -326,9 +326,11 @@ void setup() { ESP_LOGI(TAG, "Starting %s %s", PROGNAME, PROGVERSION); +/* tcpip_adapter_init(); // not sure if necessary, but seems needed for TTGOv1 // ESP Event Loop esp_event_loop_init(NULL, NULL); // not sure if necessary -> to be checked +*/ // Print chip information on startup #ifdef VERBOSE diff --git a/src/main.h b/src/main.h index f34a716a..53f8454e 100644 --- a/src/main.h +++ b/src/main.h @@ -1,5 +1,5 @@ // program version -#define PROGVERSION "1.2.1" // use max 10 chars here! +#define PROGVERSION "1.2.2" // use max 10 chars here! #define PROGNAME "PAXCNT" // Verbose enables serial output diff --git a/src/wifisniffer.cpp b/src/wifisniffer.cpp index 3d2e4c18..4cbd4b6b 100644 --- a/src/wifisniffer.cpp +++ b/src/wifisniffer.cpp @@ -13,6 +13,23 @@ #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"; @@ -44,7 +61,7 @@ typedef struct { } wifi_ieee80211_packet_t; void wifi_sniffer_init(void) { - wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + 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) );