bportaluri / WiFiEsp

Arduino WiFi library for ESP8266 modules
GNU General Public License v3.0
550 stars 210 forks source link

Erros After Connect WIFI #191

Open moahrs opened 4 years ago

moahrs commented 4 years ago

The module Connect as well, withou problem, but, when i will communicate with him, with a firefox or chrome, in the serial, the errors below, using latest version fro this github:

RESPONSE SERIAL: [WiFiEsp] Initializing ESP module [WiFiEsp] Initilization successful - 2.0.0 [WiFiEsp] IP address set 192.168.0.189 [WiFiEsp] Connected to XXXXXXXXXXX [WiFiEsp] Server started on port 80 [WiFiEsp] New client 0 [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] Data packet send error (1) [WiFiEsp] Failed to write to socket 0 [WiFiEsp] Disconnecting 0 [WiFiEsp] Disconnecting 0

My CODE: `void wifiConnect() { if (!wifiConnected) { wifiConnected = 1;

printStr("Connecting Wifi...\n");

WiFi.init(&esp8266); //INICIALIZA A COMUNICAÇÃO SERIAL COM O ESP8266
WiFi.config(IPAddress(192,168,0,189)); //COLOQUE UMA FAIXA DE IP DISPONÍVEL DO SEU ROTEADOR

//INÍCIO - VERIFICA SE O ESP8266 ESTÁ CONECTADO AO ARDUINO, CONECTA A REDE SEM FIO E INICIA O WEBSERVER
if(WiFi.status() == WL_NO_SHIELD){
  printStr("WF Error."); 
  wifiConnected = 0;
}
while(status != WL_CONNECTED){
  status = WiFi.begin(ssid, pass);
}
server.begin();
//FIM - VERIFICA SE O ESP8266 ESTÁ CONECTADO AO ARDUINO, CONECTA A REDE SEM FIO E INICIA O WEBSERVER  

}

if (wifiConnected) printStr("IP: 192.168.0.189\n"); } `

JAndrassy commented 4 years ago

use 9600 baud to communicate with the AT firmware. do not forget to set the baud rate on the firmware side too