From e40b37579d56da4f8e03e8aa7699549cc1443e5b Mon Sep 17 00:00:00 2001
From: Hieromon Ikasamo By default, AutoConnect saves the credentials of the established connection in EEPROM. You can disable it with the autoSave parameter specified by AutoConnectConfig. AutoConnect will activate SoftAP at failed initial WiFi.Begin. It SoftAP settings are stored in AutoConnectConfig as the following parameters. The sketch could be configured SoftAP using these parameters, refer the AutoConnectConfig API for details. AutoConnect will activate SoftAP at failed the first WiFi.begin. It SoftAP settings are stored in AutoConnectConfig as the following parameters. The sketch could be configured SoftAP using these parameters, refer the AutoConnectConfig API for details. A home path of AutoConnect is /_ac by default. You can access from the browser with http://IPADDRESS/_ac. You can change the home path by revising AUTOCONNECT_URI macro in the include header file as AutoConnect.h. It is also possible to assign static IP Address to ESP8266 in STA mode. By default DHCP is enabled and it becomes the IP address assigned by the DHCP server with WiFi.begin.1 To assign a static IP Address, specify it in the AutoConnectConfig parameter. In the case of assigning a static IP Address, specify the gateway, subnet mask, and DNS server is needed. Static IP address assignment is available from version 0.9.3. ↩ How do I choose Channel Espressif Systems had announced the application note about Wi-Fi channel selection. Set primary DNS server address when using static IP address.
+AutoConnect Portal;
AutoConnectConfig Config;
-Config.autoSave = AC_SAVECREDENTIAL_NEVER;
+Config.autoSave = AC_SAVECREDENTIAL_NEVER;f
Portal.config(Config);
Portal.begin();
Configuration functions¶
Configuration for Soft AP¶
-
@@ -952,6 +987,20 @@
channel
+
+
+ #define AUTOCONNECT_URI "/_ac"
Static IP assignment¶
+AutoConnect portal;
+AutoConnectConfig Config;
+Config.staip = IPAddress(192,168,1,10);
+Config.staGateway = IPAddress(192,168,1,1);
+Config.staNetmask = IPAddress(255,255,255,0);
+Config.dns1 = IPAddress(192,168,1,1);
+portal.config(Config);
+portal.begin();
+
+
+
+dns1¶
+
+
Set secondary DNS server address when using static IP address. +
Sets gateway address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this.
Set a static IP address. The IP will behave with STA mode. +
Set the gateway address when using static IP address. +
Set the subnetmask when using static IP address. +
AutoConenct Portal; AutoConenctConfig Config("", "passpass"); // SoftAp name is determined at runtime @@ -1295,6 +1395,10 @@ The default value is 0. Config.autoSave = AC_SAVECREDENTIAL_NEVER; // No save credential COnfig.boundaryOffet = 64; // Reserve 64 bytes for the user data in EEPROM. Config.homeUri = "/index.html" // Sets home path of the sketch application +Config.staip = IPAddress(192,168,10,10); // Sets static IP +Config.staGateway = IPAddress(192,168,10,1); // Sets WiFi router address +Config.staNetmask = IPAddress(255,255,255,0); // Sets WLAN scope +Config.dns1 = IPAddress(192,168,10,1); // Sets primary DNS address Portal.config(Config); // Configure AutoConnect Portal.begin(); // Starts and behaves captive portal