From bd16286da964cc67216b4f704238cbd0ce9d689c Mon Sep 17 00:00:00 2001
From: Hieromon Ikasamo AutoConnectInput input("input", "", "Server", "MQTT broker server");
On the page:
AutoConnectInput(const char* name, const char* value, const char* label, const char* placeholder) +AutoConnectInput(const char* name, const char* value, const char* label, const char* pattern, const char* placeholder)name¶
@@ -1571,6 +1644,26 @@ Only will be displayed if a label is not specifiedIt becomes a string value of the
value
attribute of an HTML<input type="text">
tag. The text entered from the custom Web page will be grouped in the query string of the form submission and the string set before accessing the page will be displayed as the initial value.label¶
A
+label
is an optional string. A label is always arranged on the left side of the input box. Specification of a label will generate an HTML<label>
tag with an id attribute. The input box and the label are connected by the id attribute.pattern¶
+A
+pattern
specifies a regular expression that the AutoConnectInput element's value is checked against on form submission. If it is invalid, the background color will change, but it will be sent even if the data format does not match.
(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}
Email address as characters@characters.domain:[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$
IP address
+Host name of the internet
+Date (MM-DD-YYYY)
+Twitter account:^@?(\w){1,15}$
A placeholder is an option string. Specification of a placeholder will generate a placeholder
attribute for the input tag.
A sketch can access variables of AutoConnectElements in the custom Web page. The value entered into the AutoConnectElements on the page is stored in the member variable of each element by AutoConnect whenever GET/POST transmission occurs.
The following diagram shows the flow of the input values of a custom Web page into a sketch and is the basis for actions to manipulate the values of custom Web pages using sketches.
@@ -1327,8 +1414,10 @@ ESP8266WebServer class will parse the query string and rebuilds its arguments wh portal.begin(); -The AutoConnectAux::loadElement function overwrites its value when loading an AutoConnectElement. If the loadElement function wields an element with an input value, the previous value will be lost by the loaded value. If you need to preserve input values even during page transition operations, we recommend that you load parameters only once at an early stage in the setup()
of sketches.
The transition of the custom Web page follows the URI of the page, but the ESP8266WebServer class does not know the URI of an AutoConnectAux page. (Registering a custom Web page does not use the ESP8266WebServer::on/WebServer::on function.) Therefore ESP8266WebServer class does not detect its URI access. If you want to detect an http request to AutoConnectAux's custom Web page, you need to register its URI with the AutoConnectAux::on function.
diff --git a/docs/acintro.html b/docs/acintro.html index e0971c7..006ffda 100644 --- a/docs/acintro.html +++ b/docs/acintro.html @@ -264,6 +264,17 @@ + + +If your sketch is handling your own web page, you can call that page from the AutoConnect menu. Unlike the custom Web pages by AutoConnectAux, this allows AutoConnect menu to legacy web pages registered by ESP8266WebServer::on/WebServer::on function.
-To implement this with your sketch, use only the AutoConnectAux constructed with the URI of that page. AutoConnectElements is not required. The basic procedure for this as follows. The FSBrowser menu as the below has Edit and List item, which are implemented according to this basic procedure.
+To implement this with your sketch, use only the AutoConnectAux constructed with the URI of that page. AutoConnectElements is not required. The basic procedure for this as follows.
ESP8266WebServer Server; -AutoConnect Portal(Server); -// Declare for menu item for legacy pages -AutoConnectAux FSBedit("/edit", "Edit"); -AutoConnectAux FSBlist("/list?dir=\"/\"", "List"); - -// /edit page handler -Void handleEdit() { - ... -} - -// /list page handler -void handleList() { - ... -} - -void setup() { - // Register legacy page handler to WebServer - Server.on("/edit", handleEdit); - Server.on("/list", handleList); - // Insert the menu items for legacy pages - Portal.join({ FSBedit, FSBlist }); - // Start portal - portal.begin(); -} - -void loop() { - Portal.handleClient(); -} -
For details see the Constructing menu section of Examples page.
Although the default menu title is AutoConnect, you can change the title by setting AutoConnectConfig::title. To set the menu title properly, you must set before calling AutoConnect::begin.
AutoConnect Portal; diff --git a/docs/api.html b/docs/api.html index 9f85a77..af75009 100644 --- a/docs/api.html +++ b/docs/api.html @@ -264,6 +264,17 @@ + + +
AutoConnectInput(const char* name = "", const char* value = "", const char* label = "", const char* placeholder = "") +AutoConnectInput(const char* name = "", const char* value = "", const char* label = "", const char* pattern = "", const char* placeholder = "")
A pattern specifies a regular expression that the input-box's value is checked against on form submission. +
A placeholder is an option string. Specification of a placeholder will generate a placeholder
attribute for the input tag.
It consumes about 2K bytes in the static and about 12K bytes are consumed at the moment when menu executed.
Because AutoConnect does not send a login success response to the captive portal requests from the smartphone. The login success response varies iOS, Android and Windows. By analyzing the request URL of different login success inquiries for each OS, the correct behavior can be implemented, but not yet. Please resets ESP8266 from the AutoConnect menu.
+JSON parse error
If AutoConnect behavior is not stable with your sketch, you can try the following measures.