Unstable ESP8266-NodeMCU

Hi,

I want to develop a local webserver using ESP8266-NodeMCU, however even a simple program is very unstable.
Sometimes when connecting to the ESP web server using an android phone, the latter gets IP address in 3-4 seconds, but sometimes it fails and Android phone connects to the last successfully connected WiFi instead of my server. Some times the android phone shows “Obtaining IP address” and then times out.

Attached is the simple code I am using.

#include <ESP8266WiFi.h>

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  WiFi.softAP("TestSSID", "12345678");
  Serial.println("AP started");
}

void loop() {}

I tried different NodeMCUs and even put external power adapter but nothing has solved the problem yet.

Thanks and Regards,
WI

what versino of esp8266 arduino core packege you have? try to erase the flash with esptool to clean radio setting of older SDK version and then upload and test

I flashed blank_1MB.bin file from this link http://www.pratikpanda.com/completely-format-erase-esp8266-flash-memory/. Flashed it 4 times using esptool to addresses 0x000000, 0x100000, 0x200000 and 0x300000.

The problem still remains.

use esptool erase command

I erased and reflashed the code and it worked. Tried 10 times without any issues. Thanks a lot Juraj.

For other reader's benefit, here is the command (replace com port and provide correct path of esptool.exe executable).

esptool.exe -vv -cd nodemcu -cb 115200 -cp COM6 -ca 0x00000 -ce

I think that writing the 1_MB bin to this nice address with zeros didn't help, because it doesn't cover the flash completely. One real MB is 1048576 bytes and the setting are saved on 'real' MB upper boundary