Code: Select all
esp_wifi_set_storage(WIFI_STORAGE_RAM)
Code: Select all
esp_wifi_set_storage(WIFI_STORAGE_RAM)
Thanks. I'll enable flash and see if there's enough difference. So if I understand correctly, this information is stored as blobs etc. with the nvs_set_str() etc. It would be nice to know how much space this takes. I use NVS for some storage as well. Is there a function to return available space on nvs partition?boarchuz wrote: ↑Sun Mar 07, 2021 3:56 amWhen you initialise WiFi with esp_wifi_init, there is a "nvs_enable" field (most of the time this is determined by CONFIG_ESP32_WIFI_NVS_ENABLED).
If enabled, the WiFi driver will restore a lot of data on initialisation and save as things change, including the current mode, STA config, and AP config.
You can change this later - without having to deinit/reinit with a different nvs_enable value - by using esp_wifi_set_storage, but it will have no effect if WiFi was originally initialised with nvs_enable==0.
It significantly speeds up connection times (a bit over my head but I think it does this by storing the crypto stuff, which can take a long time to compute).
I guess the examples typically set this to RAM so that, regardless of the config, nothing will be unexpectedly saved to flash.
Users browsing this forum: Google [Bot] and 193 guests