Nicholas3388 / LuaNode

Lua sdk for Esp32/Esp32c2/Esp32c3/Esp32c6/Esp8266/STM32L4
Other
1.1k stars 286 forks source link

nvs_open fails #23

Open jeffsauer opened 6 years ago

jeffsauer commented 6 years ago

When compiling using the esp-idf v2.1, I was getting an error saying that nvs_open() failed. Looks like one needs to first initialize NVS now, apparently in previous version the WiFi init did that, but no longer. So, I edited main.c and added the following include:

include "nvs_flash.h"

and then inside of initialise_wifi() I added:

nvs_flash_init();

just before the call to tcpip_adapter_init();

Nicholas3388 commented 6 years ago

@jeffsauer Hi, before open nvs, you need to call nvs_flash_init() first.