- NVS, not RAM and not a hardcoded string in firmware. SSID, keys, serial numbers and calibration belong in namespaces you control.
- Wear: do not commit NVS on every packet. Batch writes. Corruption shows up as ‘settings vanished after a brown-out’.
- SPIFFS is for files (pages, tiny logs, certs), not for a handful of keys. Do not mix the two without a reason.
- Erase NVS in factory test when you need a clean unit. Do not ship with lab SSIDs still inside.
Short answer
Where should ESP32 store SSID and calibration so they survive reboot?
中文
短答
SSID 和校准值放哪才能掉电还在?
- 放 NVS,不要放内存,也不要写死在固件字符串里。SSID、密钥、序列号、校准值放在你自己的 namespace。
- 不要每个包都提交 NVS。批量写。欠压后设置消失,往往是写入策略问题。
- SPIFFS 给文件(页面、小日志、证书),不是给几个键值。没有理由不要混用。
- 产测需要干净设备时再擦 NVS。不要带着实验室 SSID 出货。