Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get only Request redirected to captive portal #883

Open
4 of 10 tasks
GvLente opened this issue May 10, 2019 · 8 comments
Open
4 of 10 tasks

get only Request redirected to captive portal #883

GvLente opened this issue May 10, 2019 · 8 comments
Labels
Incomplete Did not use form or provide enough information

Comments

@GvLente
Copy link

GvLente commented May 10, 2019

Basic Infos

Hardware

WiFimanager Branch/Release:

  • Master
  • Development

Esp8266/Esp32:

  • ESP8266
  • ESP32

Hardware: ESP-12e, esp01, esp25

  • ESP01
  • ESP12 E/F/S (nodemcu, wemos, feather)
  • Other

ESP Core Version: 2.4.0, staging

  • 2.3.0
  • 2.4.0
  • staging (master/dev)

Description

Problem description

I get only Request redirected to captive portal serveral times after connection and more when i refresh the blanc html page

File Not Found
URI: /
Method: GET
Arguments : 0

Settings in IDE

Module: NodeMcu, Wemos D1 R2

17:09:17.123 -> *WM:
17:09:17.157 -> *WM: AutoConnect
17:09:17.157 -> *WM: Connecting as wifi client...
17:09:17.157 -> *WM: Using last saved values, should be faster
17:09:17.157 -> *WM: Connection result:
17:09:17.157 -> *WM: 0
17:09:17.157 -> *WM:
17:09:17.157 -> *WM: Configuring access point...
17:09:17.157 -> *WM: ESP8266
17:09:17.157 -> *WM: password
17:09:17.638 -> *WM: AP IP address:
17:09:17.638 -> *WM: 192.168.4.1
17:09:17.638 -> *WM: HTTP server started
17:09:23.432 -> *WM: Request redirected to captive portal
17:09:23.500 -> *WM: Request redirected to captive portal
17:09:29.368 -> *WM: Request redirected to captive portal
17:09:30.461 -> *WM: Request redirected to captive portal
etc.
etc. each time when i refresh

using Sketch: ESP8266_LED_Control_06_Station_Mode_with_mDNS_and_wifiManager

I dont get the wifimanager main page only get in android and apple a emty page with

File Not Found
URI: /
Method: GET
Arguments : 0

using Sketch: ESP8266_LED_Control_06_Station_Mode_with_mDNS_and_wifiManager

/*

  • Sketch: ESP8266_LED_Control_06_Station_Mode_with_mDNS_and_wifiManager
  • Control an LED from a web browser
  • Intended to be run on an ESP8266
    */

#include <ESP8266WiFi.h>
//#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>

#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>

// change these values to match your network
//char ssid[] = "MyNetwork_SSID"; // your network SSID (name)
//char pass[] = "Newtwork_Password"; // your network password

WiFiServer server(80);

String header = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
String html_1 = "<style>body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}</style><title>LED Control</title>

LED Control

";
String html_2 = "";
String html_4 = "
";

String request = "";
int LED_Pin = D1;

void setup()
{
pinMode(LED_Pin, OUTPUT);

  Serial.begin(115200);
  delay(500);
  Serial.println(F("Serial started at 115200"));
  Serial.println();

  // We start by connecting to a WiFi network
  //Serial.print(F("Connecting to "));  Serial.println(ssid);
  //WiFi.begin(ssid, pass);

  //while (WiFi.status() != WL_CONNECTED) 
  //{
  //    Serial.print(".");    delay(500);
  //}
  //Serial.println("");
  //Serial.println(F("[CONNECTED]"));
  //Serial.print("[IP ");              
  //Serial.print(WiFi.localIP()); 
  //Serial.println("]");

 // WiFiManager
  WiFiManager wifiManager;
  wifiManager.autoConnect("ESP8266","password");


  // or use this for auto generated name ESP + ChipID
  //wifiManager.autoConnect();

  // if you get here you have connected to the WiFi
  Serial.println("Connected.");


  if (!MDNS.begin("esp8266"))   {  Serial.println("Error setting up MDNS responder!");  }
  else                          {  Serial.println("mDNS responder started");  }

  // start a server
  server.begin();
  Serial.println("Server started");

} // void setup()

void loop()
{

// Check if a client has connected
WiFiClient client = server.available();
//if (!client)  {  return;  }

if (client)
{
      // Read the first line of the request
      request = client.readStringUntil('\r');

      Serial.println("request:");
      Serial.println(request);

      if       ( request.indexOf("LEDON") > 0 )  { digitalWrite(LED_Pin, HIGH);  }
      else if  ( request.indexOf("LEDOFF") > 0 ) { digitalWrite(LED_Pin, LOW);   }


      // Get the LED pin status and create the LED status message
      if (digitalRead(LED_Pin) == HIGH) 
      {
          // the LED is on so the button needs to say turn it off
         html_2 = "<form id='F1' action='LEDOFF'><input class='button' type='submit' value='Turn off the LED' ></form><br>";
      }
      else                              
      {
          // the LED is off so the button needs to say turn it on
          html_2 = "<form id='F1' action='LEDON'><input class='button' type='submit' value='Turn on the LED' ></form><br>";
      }


      client.flush();

      client.print( header );
      client.print( html_1 );    
      client.print( html_2 );
      client.print( html_4);

      delay(5);

     // The client will actually be disconnected when the function returns and 'client' object is detroyed

}

} // void loop()

@tablatronix tablatronix added the Incomplete Did not use form or provide enough information label May 10, 2019
@GvLente GvLente closed this as completed May 10, 2019
@GvLente GvLente reopened this May 10, 2019
@GvLente
Copy link
Author

GvLente commented May 10, 2019

sorry i am not familiar with github

@GvLente
Copy link
Author

GvLente commented May 10, 2019

AutoConnectWithTimeout.ino

gives in serial:
20:08:22.105 -> *WM: AutoConnect
20:08:22.105 -> *WM: Connecting as wifi client...
20:08:22.105 -> *WM: Using last saved values, should be faster
20:08:22.105 -> *WM: Connection result:
20:08:22.105 -> *WM: 0
20:08:22.105 -> *WM:
20:08:22.105 -> *WM: Configuring access point...
20:08:22.105 -> *WM: AutoConnectAP
20:08:22.615 -> *WM: AP IP address:
20:08:22.615 -> *WM: 192.168.4.1
20:08:22.615 -> *WM: HTTP server started
20:08:34.265 -> *WM: Request redirected to captive portal
20:08:46.222 -> *WM: Request redirected to captive portal
20:08:47.343 -> *WM: Request redirected to captive portal
20:08:47.411 -> *WM: Request redirected to captive portal

in the browser a blanc page

a refresh gives only more *WM: Request redirected to captive portal

@tablatronix
Copy link
Collaborator

might be a bug that was fixed in development branch already, not sure

@GvLente
Copy link
Author

GvLente commented May 11, 2019

ok, I tryd development 0.14 there was the same result

@dontsovcmc
Copy link
Contributor

It's better to use Wireshark to sniff requests..

I got same infinitive *WM: Request redirected to captive portal when connected to ESP by MacOS with running virtual Windows7. When I turn off Windows7 (Parallels), ESP web server works great. It means there are some unknown requests, that DDOS ESP server.

@tablatronix
Copy link
Collaborator

.14 is not development branch

@tablatronix
Copy link
Collaborator

It is more likely that the host is ignoring the dns responses, but yeah you need to wireshark this to figure it out for sure.

@GvLente
Copy link
Author

GvLente commented May 20, 2019

Which is the development branch?
I will whireshark and see whats going wrong thanks voor the lead and the good work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Incomplete Did not use form or provide enough information
Projects
None yet
Development

No branches or pull requests

3 participants