@@ -119,7 +119,6 @@ void check_status()
119
119
120
120
// KH
121
121
#define HEARTBEAT_INTERVAL 5000L
122
-
123
122
// Print WiFi hearbeat, Publish MQTT Topic every HEARTBEAT_INTERVAL (5) seconds.
124
123
if ((millis () > checkstatus_timeout) || (checkstatus_timeout == 0 ))
125
124
{
@@ -290,16 +289,15 @@ void MQTT_connect()
290
289
}
291
290
292
291
#if USING_CUSTOMS_STYLE
293
- const char NewCustomsStyle[] /* PROGMEM*/ =
294
- " <style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
295
- button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>" ;
292
+ const char NewCustomsStyle[] PROGMEM =
293
+ " <style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}" \
294
+ " button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>" ;
296
295
#endif
297
296
298
297
void setup ()
299
298
{
300
299
// Debug console
301
300
Serial.begin (115200 );
302
-
303
301
while (!Serial);
304
302
305
303
pinMode (LED_PIN, OUTPUT);
@@ -320,6 +318,12 @@ void setup()
320
318
321
319
ESPAsync_WiFiManager = new ESPAsync_WiFiManager_Lite ();
322
320
321
+ String AP_SSID = " your_customized_ssid" ;
322
+ String AP_PWD = " your_customized_pwd" ;
323
+
324
+ // Set customized AP SSID and PWD
325
+ ESPAsync_WiFiManager->setConfigPortal (AP_SSID, AP_PWD);
326
+
323
327
// Optional to change default AP IP(192.168.4.1) and channel(10)
324
328
// ESPAsync_WiFiManager->setConfigPortalIP(IPAddress(192, 168, 120, 1));
325
329
ESPAsync_WiFiManager->setConfigPortalChannel (0 );
@@ -329,16 +333,16 @@ void setup()
329
333
#endif
330
334
331
335
#if USING_CUSTOMS_HEAD_ELEMENT
332
- ESPAsync_WiFiManager->setCustomsHeadElement (" <style>html{filter: invert(10%);}</style>" );
336
+ ESPAsync_WiFiManager->setCustomsHeadElement (PSTR ( " <style>html{filter: invert(10%);}</style>" ) );
333
337
#endif
334
338
335
339
#if USING_CORS_FEATURE
336
- ESPAsync_WiFiManager->setCORSHeader (" Your Access-Control-Allow-Origin" );
340
+ ESPAsync_WiFiManager->setCORSHeader (PSTR ( " Your Access-Control-Allow-Origin" ) );
337
341
#endif
338
342
339
343
// Set customized DHCP HostName
340
344
ESPAsync_WiFiManager->begin (HOST_NAME);
341
- // Or use default Hostname "ESP-WiFiNINA-XXXXXX "
345
+ // Or use default Hostname "ESP_XXXXXX "
342
346
// ESPAsync_WiFiManager->begin();
343
347
}
344
348
0 commit comments