I have multiple ESP8266 based sensors that use shutdown(), deepSleep() and resumeFromShutdown() to save battery power. They each wake up for a second or two every 5 minutes --- resume WiFi from status in nvram, publish a sensor reading to an MQTT server, then WiFi.shutdown() and deepSleep() for another 5 minutes.
An issue that's been bothering me for months is that randomly, every now and again, an Arduino fails to resume the WiFi connection. I have to manually power it off an on forcing a slow WiFi.begin().
I think I finally figured out what's going on... Right now, it looks like two Arduinos have the same dynamic IP address. And some others have IP numbers that are not currently in the DHCP server's active lease list.
I think the issue is that sleeping Arduinos don't renew their leases on their dynamic IP addresses. They keep using their old IP addresses despite the DHCP server returning those IP addresses to the free pool, potentially to be assigned to another device. Communication stops when two devices have the same IP address.
Moral: If your WiFi connection is mostly shutdown, use a static IP address.
Peter McGavin