You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.
Symptom:
Taking for example the code in Async_ConfigOnSwitch.ino you will find
#define HTTP_PORT 80
If any port other than 80 is used, the captive portal fails to connect.
Reproduce:
Using the example code, change HTTP_PORT to 81, Activate the captive port by pressing the button. Attempt to connect to http://192.168.4.1:81
Cause:
The code in ESPAsync_WiFiManager-Impl.h has a method "bool ESPAsync_WiFiManager::isIp(String str)" which is called from "bool ESPAsync_WiFiManager::captivePortal(AsyncWebServerRequest *request)" The "isIp" method parses the URL and if anything other than numbers and '.' character are found then the rewrite rule in "captivePortal" will be executed to redirect the request to the captive portal IP address but without the port number because "isIp" returns false while parsing something like "http://192.168.4.1:8080" due to the ':' character.
Suggested Remedy:
The "isIp" method should be adjusted as follows:
Old: if (c != '.' && (c < '0' || c > '9'))
New: if (c != '.' && c != ':' && (c < '0' || c > '9'))
The suggested remedy was tested locally and found to correct the issue.
This issue would exist regardless of platform or version however for the sake of including the required info:
Arduino IDE 1.8.15
ESP32 Core Version ??
OS: Windows 7 Ultimate 64 bit
The text was updated successfully, but these errors were encountered:
Even this the real bug, the actual problem is a little bit different
The Captive Portal always redirects to port 80.
When you use different port, e.g. 81, and you specify 192.168.4.1:81, the isIP() detects the invalid IP and initiates the Captive Portal to connect to default port 80 as 192.168.4.1:80. Therefore you can't connect because the HTTP server is actually at port 81.
With the fix, whenever you select 192.168.4.1:81, the fixed isIP() sees this is the valid IP, therefore permitting you to connect to 192.168.4.1:81 and you're OK. No Captive Portal is involved.
### Releases v1.7.8
1. To permit using HTTP port different from 80. Check [WiFiManager works only on port 80 #75](khoih-prog/ESPAsync_WiFiManager#75)
2. Fix bug returning IP `255.255.255.255` in core v2.0.0+ when using `hostname`
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Symptom:
Taking for example the code in Async_ConfigOnSwitch.ino you will find
#define HTTP_PORT 80
If any port other than 80 is used, the captive portal fails to connect.
Reproduce:
Using the example code, change HTTP_PORT to 81, Activate the captive port by pressing the button. Attempt to connect to http://192.168.4.1:81
Cause:
The code in ESPAsync_WiFiManager-Impl.h has a method "bool ESPAsync_WiFiManager::isIp(String str)" which is called from "bool ESPAsync_WiFiManager::captivePortal(AsyncWebServerRequest *request)" The "isIp" method parses the URL and if anything other than numbers and '.' character are found then the rewrite rule in "captivePortal" will be executed to redirect the request to the captive portal IP address but without the port number because "isIp" returns false while parsing something like "http://192.168.4.1:8080" due to the ':' character.
Suggested Remedy:
The "isIp" method should be adjusted as follows:
Old: if (c != '.' && (c < '0' || c > '9'))
New: if (c != '.' && c != ':' && (c < '0' || c > '9'))
The suggested remedy was tested locally and found to correct the issue.
This issue would exist regardless of platform or version however for the sake of including the required info:
Arduino IDE 1.8.15
ESP32 Core Version ??
OS: Windows 7 Ultimate 64 bit
The text was updated successfully, but these errors were encountered: