You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every10-15 time the ESP stops answering to my smartphone. Debugging on Android says "connection refused". Then, after 1-2min it starts spamming connection info to the serial port and answering to phone and after maybe 10s works normally. I am also getting wifi evt: 7 - WIFI_EVENT_SOFTAPMODE_PROBEREQRECVED on serial port.
According to #2735 - it's a "[AP]err on recieved request"
... New data every 300ms ... evt: 7 ... Then updates very fast (every 50ms, not 300) for a moment.
#include<ESP8266WiFi.h>//#include <Ticker.h>//#include <Wire.h>//#include "PCF8574.h"//#include <ESP8266WiFiGratuitous.h>constchar* ssid = "testwifi2";
constchar* password = "esp8266";
IPAddress ip(192,168,0,1);
IPAddress gateway(192,168,0,1);
IPAddress subnet(255,255,255,0);
WiFiServer server(80);
//Ticker timer;const byte interruptPin = 13;
int czas2 = 0;
int czas = 0;
int a=1;
boolean auto_manual = 0;
unsignedlong currentTime=0;
unsignedlong previousTime=0;
constlong Timeout=200;
//PCF8574 PCF_01(0x20);voidsetup()
{
delay(10);
//pinMode(interruptPin, INPUT_PULLUP);//attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt, FALLING);
Serial.begin(115200);
Serial.println();
//PCF_01.begin();
WiFi.softAPConfig(ip,gateway,subnet);
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password,10,true,1);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.begin();
//experimental::ESP8266WiFiGratuitous::stationKeepAliveSetIntervalMs();//timer.attach_ms(1,zegar);
}
// prepare a web page to be send to a client (web browser)
String prepareAnswer()
{
String htmlPage;
htmlPage.reserve(1024); // prevent ram fragmentation
htmlPage = F("HTTP/1.1 200 OK\r\n""Content-Type: text/html\r\n""Connection: close\r\n"// the connection will be closed after completion of the response"\r\n""<!DOCTYPE HTML>""<html>");
htmlPage += F("@""300""#""200""$");
htmlPage += F("</html>""\r\n");
return htmlPage;
}
voidloop()
{
WiFiClient client = server.available();
// wait for a client (web browser) to connectif (client)
{
Serial.println("\n[Client connected]");
while (client.connected())
{
yield();
// read line by line what the client (web browser) is requestingif (client.available())
{
String line = client.readStringUntil('\r');
Serial.print(line);
// wait for end of client's request, that is marked with an empty lineif (line.length() == 1 && line[0] == '\n')
{
client.println(prepareAnswer());
break;
}
}
}
while (client.available()) {
// but first, let client finish its request// that's diplomatic compliance to protocols// (and otherwise some clients may complain, like curl)// (that is an example, prefer using a proper webserver library)
client.read();
yield();
}
// close the connection:
client.stop();
Serial.println("[Client disconnected]");
}
}
As there is only part of the program here, it is hard to simulate.
A lot of problems show in the INCLUDE section and global setups.
It is hard to simulate your problem
Platform
Settings in IDE
Problem Description
Every10-15 time the ESP stops answering to my smartphone. Debugging on Android says "connection refused". Then, after 1-2min it starts spamming connection info to the serial port and answering to phone and after maybe 10s works normally. I am also getting wifi evt: 7 - WIFI_EVENT_SOFTAPMODE_PROBEREQRECVED on serial port.
According to #2735 - it's a "[AP]err on recieved request"
... New data every 300ms ... evt: 7 ... Then updates very fast (every 50ms, not 300) for a moment.
The ESP is in AP mode.
Newest libraries.
MCVE Sketch
Debug Messages
All program now. I have changed it, but still the same problem. I know only, that wifi ext 7 isnt connected with this lag.
The text was updated successfully, but these errors were encountered: