Moderator: igrr
boolean 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");
}
Arduino Uno
Raspberry pi 2
ESP8266-01
ESP8266-12E
if(((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)