IMPORTANT: Configuration is now stored in NVS, not in the filesystem. This means:
✅ You can freely upload the filesystem without losing WiFi config! ✅ No more captive portal loop during development ✅ Web UI updates don't reset settings
pio run --target uploadChanges to sensors, MQTT, WiFi manager, etc.
cd web
# Set your ESP32's IP address
ESP32_IP=192.168.1.128 npm run devThen open http://localhost:5173
WebSocket will work because proxy is configured!
cd web
npm run build
cd ..
pio run --target uploadfs # Safe now - won't erase WiFi config!Your device is in captive portal mode at 192.168.4.1 because it has no WiFi configured in NVS yet.
- Connect to "SQM-Setup" WiFi network
- Go to http://192.168.4.1
- Select your network and enter password
- It will connect and give you the new IP address
- Your WiFi config is now saved in NVS!
Web Dev:
cd web
ESP32_IP=<your-device-ip> npm run devFirmware Dev:
pio run --target upload # Your WiFi config stays intact!Web UI Updates:
cd web
npm run build
cd ..
pio run --target uploadfs # Your WiFi config stays intact!- Location: Separate NVS partition (20KB at 0x9000)
- Namespace: "sqm"
- Key: "config"
- Survives: Firmware uploads, filesystem uploads, power cycles
- Cleared by: Full chip erase only
To manually clear config (force captive portal):
pio run --target erase
pio run --target upload
pio run --target uploadfsThe vite.config.ts now has proper WebSocket proxy configuration:
{
target: `ws://${ESP32_IP}`,
ws: true,
changeOrigin: true,
}Set ESP32_IP environment variable or update it in vite.config.ts (line 7).