|
|
|
@ -13,6 +13,11 @@
|
|
|
|
|
#include <WebSocketsClient.h>
|
|
|
|
|
#include <Preferences.h>
|
|
|
|
|
|
|
|
|
|
// Hardcode WiFi credentials and server if needed
|
|
|
|
|
const String WIFI_NAME="Lynn Street Rugs";
|
|
|
|
|
const String WIFI_PASSWORD="7TuftWork9!";
|
|
|
|
|
const String SERVER_URL="http://192.168.0.55:10101";
|
|
|
|
|
|
|
|
|
|
Preferences preferences;
|
|
|
|
|
|
|
|
|
|
String server_domain = "";
|
|
|
|
@ -541,7 +546,6 @@ void tryReconnectWiFi() {
|
|
|
|
|
}
|
|
|
|
|
void tryReconnectToServer() {
|
|
|
|
|
preferences.begin("network", true); // Open Preferences with the "network" namespace in ReadOnly mode
|
|
|
|
|
const String SERVER_URL="SERVER URL HERE";
|
|
|
|
|
String serverURL = SERVER_URL; // Get stored server URL, if any
|
|
|
|
|
// String serverURL = preferences.getString("server_url", ""); // Get stored server URL, if any
|
|
|
|
|
preferences.end(); // Close the Preferences
|
|
|
|
@ -793,8 +797,6 @@ void setup() {
|
|
|
|
|
Serial.setTxBufferSize(1024); // Set the transmit buffer size for the Serial object.
|
|
|
|
|
|
|
|
|
|
WiFi.mode(WIFI_AP_STA); // Set WiFi mode to both AP and STA.
|
|
|
|
|
const String WIFI_NAME="WIFI NAME HERE";
|
|
|
|
|
const String WIFI_PASSWORD="WIFI PASSWORD HERE";
|
|
|
|
|
// delay(100); // Short delay to ensure mode change takes effect
|
|
|
|
|
// WiFi.softAPConfig(localIP, gatewayIP, subnetMask);
|
|
|
|
|
// WiFi.softAP(ssid, password);
|
|
|
|
@ -878,4 +880,4 @@ void loop()
|
|
|
|
|
M5.update();
|
|
|
|
|
webSocket.loop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|