I have a problem with connection my esp8266-12e with a server.
my sketch is:
#include <ESP8266WiFi.h>
char* ssidRete;
char* pswRete;
const char* host = "www.google.it";
int count;
void setup() {
WiFi.mode(WIFI_AP_STA);
delay(1000);
Serial.begin(115200);
Serial.println("**********");
ssidRete = "xxxx";
pswRete ="yyyyy";
WiFi.begin(ssidRete, pswRete);
count=0;
}
void loop() {
WiFiClient client;
Serial.println(client.connect(host, 80));
if (!client.connect(host, httpPort)) {
return;
}
if (client.connected()) {
client.stop(); // DISCONNECT FROM THE SERVER
}
count +=1;
Serial.println(count);
Serial.println();
Serial.println("closing connection");
delay(200);
}
it works for 120 request and then crashes with reset esp.
the code of exception is:
Exception (29):
epc1=0x4000e1b2 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: sys
Tanks and sorry for my english