Reduce power consumption while monitoring wifi packets

4rzael
Posts: 1
Joined: Thu Apr 18, 2019 10:42 am

Reduce power consumption while monitoring wifi packets

Postby 4rzael » Thu Apr 18, 2019 10:47 am

Hello,

I am currently working on a project using an ESP32 to monitor wifi packets (using promiscuous mode). Currently, I am using arduino for ESP32 (but can change to esp-idf if necessary), and am able to perform the monitoring correctly.

When monitoring, I get a current consumption of around 100/102mA. (with core frequency of 80MHz). I am looking to reduce this power consumption a bit. How could I do so ?

This is a simplified version of my code:

Code: Select all

void wifi_promiscuous(void* buff, wifi_promiscuous_pkt_type_t type) {
// store the packet in memory
}

void setup() {
  esp_bt_controller_disable();
  nvs_flash_init();
  tcpip_adapter_init();
  wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
  ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL)); // event_handler does nothing
  ESP_ERROR_CHECK(esp_wifi_init(&cfg));
  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_wifi_set_max_tx_power(-4); // reduce tx power, as we only receive
  esp_wifi_set_channel(ch, WIFI_SECOND_CHAN_NONE);

  esp_wifi_set_promiscuous_rx_cb(&wifi_promiscuous);
  esp_wifi_set_promiscuous(true);

  vTaskDelay(1000L * (MEASUREMENT_DURATION) / portTICK_PERIOD_MS);
  // Do something with the measurement, then get turned off externally.
}
Thanks !

Who is online

Users browsing this forum: No registered users and 118 guests