Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Subhajit Das
#48361 You can also set a flag variable at wifi setup stage. Simpler and faster as no addition method call to detect ip configuration. Like this:

Code: Select allboolean WifiConnected = true;  // <- global variable
void setupWifi() {
  WiFi.mode(WIFI_STA);

  // starting wifi
  String esid ="ssid";
  String epass = "pass";

  if ( esid.length() > 2 ) {
    if ( epass.length() > 2 ) {
      WiFi.begin(esid.c_str(), epass.c_str());
    } else {
      WiFi.begin(esid.c_str());
    }
    if (WiFiAvailable()) {
      return;
    }
  }

  WiFi.disconnect();
  WifiConnected = false;  // <- this point
  WiFi.mode(WIFI_AP);
  WiFi.softAP("Web Remote Receiver");
}
User avatar
By Me-no-dev
#48403 the proper way to check if a given client belongs to particular side of the network in pseudo C code:
Code: Select allif(((uint32_t)client.ip & (uint32_t)ap.mask) == ((uint32_t)ap.ip & (uint32_t)ap.mask)){
  //this client is AP client
} else {
  //this client is on the STA side
}

the Host header is actually the name of the address that you typed to get to the page. It can be IP or DNS name. It is used in virtual hosting to decide which virtual server is this request for (when you host more than one site on the same server)