|
|
@@ -69,7 +69,13 @@
|
|
|
const char* hostname = "modulos-dsp";
|
|
|
const char* version = "VER: 260304_13";
|
|
|
|
|
|
-// Runtime WiFi credentials — loaded from NVS at boot
|
|
|
+// Compile-time default credentials — used when NVS has no saved credentials.
|
|
|
+// Change these before flashing. If NVS credentials are saved (via the config
|
|
|
+// portal) they take priority over these on subsequent boots.
|
|
|
+static const char DEFAULT_SSID[] = "alfred";
|
|
|
+static const char DEFAULT_PASS[] = "alfred16";
|
|
|
+
|
|
|
+// Runtime WiFi credentials — populated from NVS or defaults at boot
|
|
|
static char s_ssid[64] = "";
|
|
|
static char s_pass[64] = "";
|
|
|
|
|
|
@@ -710,8 +716,11 @@ void setup() {
|
|
|
Serial.printf("Reset reason: %d\n", (int)esp_reset_reason());
|
|
|
|
|
|
if (!loadWifiCreds()) {
|
|
|
- Serial.println("No WiFi credentials stored — entering setup mode");
|
|
|
- startConfigAP(); // never returns
|
|
|
+ // NVS empty — fall back to compile-time defaults so an unattended
|
|
|
+ // device can reach the network without needing the config portal.
|
|
|
+ strlcpy(s_ssid, DEFAULT_SSID, sizeof(s_ssid));
|
|
|
+ strlcpy(s_pass, DEFAULT_PASS, sizeof(s_pass));
|
|
|
+ Serial.println("No NVS credentials — using defaults");
|
|
|
}
|
|
|
|
|
|
Serial.printf("Connecting to %s", s_ssid);
|