Hi guys,
I test the new wifi-shield of Arduino. The web server loses connection to the router for several hours and is no longer accessible.
After I inserted the line if (WiFi.begin(ssid, pass) != WL_CONNECTED) connectToWifi()
I can not connect to wifi Shield
void loop() {
//if (WiFi.begin(ssid, pass) != WL_CONNECTED) connectToWifi(); //lose the the connection
Serial.print(status);
Serial.println();
if (mustReadRFID) readRFID(); //isr Read RFID
if (mustSwitchDoorBuzzer) do_door_buzzer(); // Web request
// listen for incoming clients
WiFiClient client = server.available();
if (client) {
Serial.println("if (client)");
while (client.connected()) {
if (client.available()) {
if( client.find("GET /")) { // search for 'GET'
char ch = client.read(); //read one byte this ?
memset(action, 0, 11);
for (int i=0; i<12; i++) {
action[i] = client.read();
}
action[12] = 0;
printHeader(client);
if ( memcmp(who_i_am, action, 11) == 0) {
client.print("door_buzzer,door_opener");
}
else if (memcmp(door_buzzer, action, 11) == 0){
mustSwitchDoorBuzzer = true;
client.print("Action door buzzer");
}
else if (memcmp(door_opener, action, 11) == 0){
client.print("Action door opener");
}
else client.print("Unknown Action");
client.println("
");
break;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
//Serial.println("client disonnected");
}
}
Thanks to all. :-))