File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
Firmware/GPAD_API/GPAD_API Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -488,7 +488,10 @@ void setup()
488488 // We call this a second time to get the MAC on the screen
489489 // clearLCD();
490490 // req for Wifi Man and OTA
491- WiFiMan ();
491+ char setupSsid[20 ] = " Krake_\0 " ;
492+ strcat (setupSsid, macAddressString);
493+
494+ WiFiMan (setupSsid);
492495 initLittleFS ();
493496 server.begin (); // Start server web socket to render pages
494497 ElegantOTA.begin (&server);
Original file line number Diff line number Diff line change 11#include " WiFiManagerOTA.h"
22#include < LittleFS.h>
33
4- const char *default_ssid = " ESP32-Setup" ; // Default AP Name
4+ const char *DEFAULT_SSID = " ESP32-Setup" ; // Default AP Name
55String ssid_wf = " " ;
66String password_wf = " " ;
77String ledState = " " ;
@@ -42,13 +42,24 @@ bool loadCredentials()
4242 return true ;
4343}
4444
45- void WiFiMan ()
45+ void WiFiMan (const char *accessPointSsid )
4646{
4747 WiFiManager wifiManager;
4848
4949 if (!loadCredentials ())
5050 {
51- if (!wifiManager.autoConnect (default_ssid))
51+ boolean connectSuccess = false ;
52+
53+ if (accessPointSsid == " " )
54+ {
55+ connectSuccess = wifiManager.autoConnect (DEFAULT_SSID);
56+ }
57+ else
58+ {
59+ connectSuccess = wifiManager.autoConnect (accessPointSsid);
60+ }
61+
62+ if (!connectSuccess)
5263 {
5364 Serial.println (" Failed to connect. Restarting..." );
5465 ESP.restart ();
Original file line number Diff line number Diff line change 77#include <FS.h>
88#include <LittleFS.h>
99
10- extern const char * default_ssid ;
10+ extern const char * DEFAULT_SSID ;
1111// extern String ssid;
1212// extern String password;
1313extern String ledState ;
1414extern int WiFiLed ;
1515
1616void saveCredentials (const char * ssid , const char * password );
1717bool loadCredentials ();
18- void WiFiMan ();
18+ void WiFiMan (const char * accessPointSsid );
1919void initLittleFS ();
2020void initWiFi ();
2121String processor (const String & var );
You can’t perform that action at this time.
0 commit comments