Closed juanprahamma closed 9 years ago
when you subscribe callback esp.wifiCb.attach(&wifiCb)
it will call wifiCb
everytime wifi status changed. You need to check status like this
void wifiCb(void* response)
{
uint32_t status;
RESPONSE res(response);
if(res.getArgc() == 1) {
res.popArgs((uint8_t*)&status, 4);
if(status == STATION_GOT_IP) {
debugPort.println("WIFI CONNECTED");
wifiConnected = true;
} else {
wifiConnected = false;
}
}
}
i think, i'll set my device to subscribe, just like published status, but i still thinking what is better way for this anyway thank so much mr tuanpmt
dear tuanpmt
my problem is esp8266 didn't connect again if i turn off then turn on my router, i
sorry for my bad english thank you