I made project contain esp8266(server) and multi esp(stations) and connect theme with "wifi.h" and "syncwebserver" libraries. now i want change network password between esps. How say to station that changed password? I change password in server but station dont know new password to connect esp(server)
I have idea that save new password in server and until all modules doesnt update password(check periodic with asyncwebServer) dont change network password But in this case if one of theme dont reachable network never will not update at all.
What you are trying to do would really only work if all clients when they connect, get sent the new credentials, and some future date/time when those credentials should be used.
The cut-over to the new credentials all has to happen at the same time... both server and clients.
So with that in mind if you publish the new credentials with some advance warning (say 7 days), then provided a client connected within 7 days they would get the new credentials... any that didn't would need to be updated by some other mechanism.
depending on what amount of data you want to exchange ESP-NOW might be an option
maybe in case a station has missed updating the password looses WiFi-connection and then is sending a request over ESP-NOW for the new password.
Sending over ESP-NOW would only happen if a station has missed the regular password-update.
ESP-NOW can be encrypted too. And as it happends only so rarely there is almost no chance to sniff the ESP-NOW-traffic