Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By elveax
#74125 Hello -

I'm having a heck of a time getting connected to my ESP8266's for any length of time and I'm sort of at a loss.
The connectivity is spotty and inconsistent if it works at all, even in the best of conditions. Here are the details:

1. I'm using a few different models to test - a NodeMCU v 0.9, a Lua CH340G v 0.1, and an ESP-12F connected with an ESP socket programmer.

2. I'm using a very simple sketch, basically just invoking SoftAP and then waiting for clients. Here's a link:
https://github.com/esp8266/Arduino/blob ... sPoint.ino

3. I did a fresh install of the Arudino IDE and downloaded the board files (which downloaded the ESP and WiFi libraries fresh as well) yesterday.

And here are the symptoms I'm experiencing:

1. I transfer the sketch to the ESP and the AP appears in my WiFi AP list on my device. I try to connect, and about 2/3 of the time it fails, saying either 'Incorrect Password' or 'Out of range'.

2. About 1/3 of the time it connects, but I end up with an APIPA address (169.254.X.X).

3. Very rarely I'll get a real address (192.168.X.X) but when I try to navigate to the ESP web page at 192.168.4.1) the link crashes and I can't reconnect to the AP.

I've tried connecting to the AP with my phone (iPhone SE) and my laptop (Samsung Chromebook). The behavior is the same regardless of the device I'm using or the ESP I am using.

So, I'm kind of at a loss! If the ESP isn't the problem (because I've tried several), and the code isn't the problem (because it's so simple and demonstrated to be working by others), and my devices aren't the problem (because I've tried several of those), what could the problem be?

Thanks in advance!
User avatar
By elveax
#74133 Disregard - I figured it out. In my case, I had to add

ESP.eraseConfig();

into setup(). It must have been something in an old configuration that was not getting erased during the flash.

Also, for what it's worth, I found I had to add ESP.wdtFeed(); into my subs/functions to keep the ESP from soft-crashing because of the software watchdog. Hope that helps somewhere!
User avatar
By mrburnette
#74144 elveax:

If your loop() is cycling faster than 50mS (some say 30mS is a good ceiling), then feeding the watchdog should not be necessary in the Arduino code. What is necessary for stability is to ensure that the RF section has some of the cpu before the RF stack goes stale and causes the watchdog to bite you.
If you are having to tickle the watchdog, you maybe should try to use yield() or delay(0) to force nonOS task switcher to give some time to the Espressif code. With only one core, everyone needs to play nicely.

Ray