I have a ESP8266-12F setup to send data to thingspeak. It connects to my AP and does a http post to a rest service where it stores the measured light intensity and the battery voltage. That looks like this:
It does an update every minute. Between updates it goes in deep sleep mode. After a one minute timeout it wakes up and reboots and does a new post. But it sometimes seems to miss one or more updates. I have no idea if it simply doesn't wake up from the sleep cycle, if it is unable to connect to the AP or if the webservice refuses connection. Does anyone else have the same problem?
I have the same problem with my ESP-01 but I think this is because GP0 and GP2 aren't in the right status during the reset!
Maybe have a look with this idea
If you are using EasyIoT Cloud and MQTT: we added security feature - if there are too many login attempts with incorrect password your IP address is banned for some period of time and you are unable to connect to EasyIoT Cloud.
I might have an idea to help you.
I think there is a problem with the sketch, because I had a similar problem.
When the esp restarts in my case, it immediately tries to connect to the WiFi.
In the beginning of the code we write WiFi.begin(storage.ssid, storage.pwd);
After debugging I found that sometimes after restart esp connected in the background immediately to WiFi before the code reaches WiFi.begin! Strange and odd! And after the code reaches WiFi.begin, it is already connected, so the connection fails and goes to AP mode
I inserted a statement if (WiFi.status() != WL_CONNECTED) before WiFi.begin and now I don't have a single connection failure.