Chat freely about anything...

User avatar
By Dave S
#13363 Has anyone encountered this?

I have forked off a web server from the SDK IoT_Demo example. Upon a reset, the ESP8266 server responds to GET requests from a browser using an URL with a DDNS domain and a specified port that the ESP8266 server is set to listen on. My router is properly configured to port forward (I have several other MPUs, many cameras and other "Things" configured this way, which have been working for years).

Problem is that the ESP8266 appears to stop recognizing the requests after a minute or so. I have some debug code setup to provide some info to the serial port using the ESP8266 timer, that shows that the ESP8266 is still running when it stops responding to the GET request.

I thought that this was a same-origin policy issue as I noticed the ESP8266 continues to respond to Get requests using it's static IP:port as the browser URL even after the port forwarding URL stopped getting a reply.

So I added "Access-Control-Allow-Origin: *" to the response header but this did not help since the ESP8266 did not appear to recognize the GET request; it did not trigger a callback from the server listen.

Very strange that it starts working normally after a reset, but then stops - for cross-domain requests.

Next step will be to sniff the packets with Wireshark, but I am not sure if that will lead to a root cause.

It's not on the internet if the "thing" is under house arrest in the local network!

I am using SDK Version 1.0.0

Any insight would be appreciated...
User avatar
By Dave S
#14116 Analyzing the wire traffic with Wireshark, I noticed that when the network access stopped working, my router starts to send ARP requests to the ESP8266. The ESP8266 does not respond.

I tried to spoof the ARP response with a packet generator but that did not satisfy the router and the network access remained blocked.

The network connectivity is always restored by resetting the ESP8266. That is probably because the WIFI connection and IP/MAC relationship with the router is established at that time. It seems that there is a timeout period after ESP8266 connection to my WIFI network. After that timeout period, the router wants to renew or refresh it's ARP cache by sending an ARP request to the ESP8266.

I have seen others experience similar issues, and it seems that all routers do not present this as a problem. I did set up a DHCP reservation for my ESP8266 in the router, but that did not resolve the problem.

Does anyone have experience running an ESP8266 application compiled with the SDK (not using lwip_lib) that did not have this problem. Such that remote internet access is maintained for a long period of time (days)?

If so, what router are you using?

Thanks...

Similar Issues:

viewtopic.php?f=6&t=511
viewtopic.php?f=6&t=1633
User avatar
By Dave S
#14487 I tried to use the recently released ESP8266 Arduino IDE (https://github.com/esp8266/arduino) to test out the Web Server.

After customizing the "WifiWebServer" example sketch for my environment and GET requests, I found that the Web Server continued to respond to requests indefinitely (tested for about 3 hours).

Conclusion: The Arduino IDE must be handling the TCP connection and callbacks differently than the SDK. It would be great to understand what the differences are as the SDK offers much more control and flexibility than the Arduino IDE. I really would prefer to use the SDK.

But until this issue is resolved, I plan to move forward using the Arduino IDE. The web server connection is simply more reliable at this point.

But the Arduino IDE is not the holy grail either, yet. I have found a few issues so far:

1. It is immature at this point and libraries and examples are limited.
2. Adding some libraries that are part of the core SDK blows the available memory (For me, this happened with a JSON encoding library)
3. Importing the Adafruit_bmp085 library would not compile properly. It could not find the pow function from the core math.h library. And adding the -lm linker option to the platform.txt causes an out of memory failure. This is not a large library!
User avatar
By wizard23
#19327 > After customizing the "WifiWebServer" example sketch for my environment and GET requests, I found that the Web Server > continued to respond to requests indefinitely (tested for about 3 hours).

I have a very similar phenomenon with the "WifiWebServer" using the arduino ide comiled from github as of 2.6.2015
For me a get request seems to stop the execution of the loop() function for several seconds. the webserver still responds correctly but the code in loop() does not get executed for a while. after some seconds the loop() gets called again.

I will report reults of my further research :)