Skip to content

feat: Auto-init nvs in wifi if wifi nvs storage enabled in config#617

Merged
finger563 merged 4 commits into
mainfrom
feat/wifi-nvs-enabled
May 25, 2026
Merged

feat: Auto-init nvs in wifi if wifi nvs storage enabled in config#617
finger563 merged 4 commits into
mainfrom
feat/wifi-nvs-enabled

Conversation

@finger563
Copy link
Copy Markdown
Contributor

@finger563 finger563 commented May 24, 2026

Description

  • Update wifi component to initialize nvs subsystem if wifi storage into nvs is configured in menuconfig
  • Update docs to remove note about manual init, since it's automatic now
  • Update example to remove explicit nvs init code

Motivation and Context

Simplifies wifi usage and cleans up boilerplate code some.

How has this been tested?

Build and run wifi example on esp32

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Copilot AI review requested due to automatic review settings May 24, 2026 02:56
@github-actions
Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the wifi component to automatically initialize NVS when WiFi NVS storage is enabled, aiming to remove the need for callers/examples to explicitly initialize NVS before using WiFi.

Changes:

  • Auto-initialize NVS from the espp::Wifi singleton constructor when CONFIG_ESP32_WIFI_NVS_ENABLED is set.
  • Add an espp::Nvs member to Wifi to perform the initialization.
  • Update the wifi component’s CMake REQUIRES dependencies to include the nvs component.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
components/wifi/include/wifi.hpp Adds conditional NVS include + initializes NVS in Wifi constructor; introduces espp::Nvs member.
components/wifi/CMakeLists.txt Switches dependency from nvs_flash to the nvs component.

Comment thread components/wifi/include/wifi.hpp
Comment thread components/wifi/include/wifi.hpp
Comment thread components/wifi/include/wifi.hpp Outdated
Comment thread components/wifi/CMakeLists.txt
finger563 and others added 2 commits May 23, 2026 22:10
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@finger563 finger563 self-assigned this May 24, 2026
@finger563 finger563 added enhancement New feature or request wifi labels May 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@finger563 finger563 merged commit 03908a8 into main May 25, 2026
106 of 107 checks passed
@finger563 finger563 deleted the feat/wifi-nvs-enabled branch May 25, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request wifi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants