Re: Different HTML on AP and STATION address.
Posted: Tue May 31, 2016 8:11 pm
Oh ! that seems even simpler since you don't need to verify remoteIP() against subnets ...
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
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");
}
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
}