As the title says... Chat on...

User avatar
By mhogan
#21295 Hello, I've built my "Hello World" app using (mostly) the demo HTTP server code. My simple circuit turns on and off two LEDs via a browser. When I first run the code everything is fine. Then it stops being visible on the network. HTTP, ping, etc. stop working. If I wait a while (no pattern to the time required) then everything starts working again. I've moved my proto board to make sure I've got good WiFi coverage. I can find no repro steps or any type of pattern to the issue. Does anyone have any ideas what I can try next?

UPDATE: I should mention that although the WiFi doesn't work, the unit still responds to commands via the serial interface. The only problem is that it loses network connectivity.
User avatar
By TerryE
#21559 how long in time is your longest running callback routine? E.g. tmr.delay() calls or big loops? Espressif guidelines are <10 mSec or the wifi drops out.
User avatar
By mhogan
#21783 Thanks for your reply. I appreciate the help.

When a button on the Web page is pressed, GPIO 5 is held HIGH for 10 minutes, then it returns to LOW (I'm controlling a water pump).

Here's my code:
gpio.write(5, gpio.HIGH);
tmr.alarm(0, 600000, 1, function() tmr.stop(0); gpio.write(5, gpio.LOW); node.restart(); end)

This is the only timer I'm using. I am not using tmr.delay(). I'm happy to post all of the code if you think it would be helpful.

I added the node.restart() at the end to force a reset in an attempt to hide the disconnect problem. I do not believe that this has made any difference.

When I noticed the problem earlier today, I used Fing on my phone to map my network. The device was not being detected. But, after a couple of refreshes, it appeared. Either that's a really big coincidence or the network scan somehow brought the connection back online. I'm waiting for it to fail again so I can make another observation.

UPDATE: I just witnessed another failure. After three network scans using the Fing app the device reappeared on the network map and started working again.

2nd UPDATE: Same thing. I notice a failure and scan for a network map. After the third scan the device reappears and all is well. I've looked at other similar posts and I don't believe that this observation has been made by anyone before. Hopefully it will help point someone toward a solution.
User avatar
By mhogan
#22276 OK. Here's what I know for sure.

1. The device periodically goes into a state where it does not respond to pings, HTTP requests, etc.
2. But, it WILL respond to some sort of wake up call that is broadcast on the network when a 3rd party application attempts to build a network device map.
3. From this, we can infer that the ESP8266 is NOT frozen or disconnected from the network but rather is in some sort of suspended state waiting for a wake-up call.

I've tried different settings of node.dsleep() and have pulled up GPIO0 and GPIO2 with 4.7k resistors. Neither seem to have had any impact.

I'm honestly at a loss here and would appreciate any kind of help. I'm using the device as-is but on occasion need to "wake it up" by drawing a network map. Obviously this isn't ideal.