Wemos d1 mini OTA Wifi update

Hey there
I run wemos devices on deep sleep, they wake up every hour for a few seconds to send data to a database.(mysql). Lets say the user changes his wifi settings then the wemos cant send the data any more. Is there a way it can update it self with the new wifi settings without making the user wait for the exact wakeup time of the device?

Thank you

Is there a way it can update it self with the new wifi settings without making the user wait for the exact wakeup time of the device?

The easiest way is to disable sleeping if the device cannot connect to the WiFi network or at least wait much longer before going to sleep again.

marcnau:
Lets say the user changes his wifi settings then the wemos cant send the data any more. Is there a way it can update it self with the new wifi settings without making the user wait for the exact wakeup time of the device?

I cannot see how this is possible, the Wemos will need the new Wifi credentials to connect to be able to retrieve the new credentials.
Unless you know what the new credentials will be in advance of them being changed and can send them to the Wemos so when it wakes it can try the current credentials and if that fails then switch to the new credentials.

Riva:
I
Unless you know what the new credentials will be in advance of them being changed and can send them to the Wemos so when it wakes it can try the current credentials and if that fails then switch to the new credentials.

Thank you!
Exactly this would be my idea. i`d like to let the user update his wifi information on my webpage bevor he changes his wifi settings of his home network... This information is stored in a MySQLi Database. On the next wakeup i would like to let the wemos get the new info and if its waking up the next time connect with the new network information. How do i get the info from the database to the device?

marcnau:
How do i get the info from the database to the device?

If the user has already changed the SSID/password on the router and your database before your device wakes from sleep to get new credentials then it will never be able to connect to retrieve them.
Maybe you can have your device go into AP mode if it cannot connect to WiFi so the user can connect to it using a web browser to setup the new credentials.

Riva:
Maybe you can have your device go into AP mode if it cannot connect to WiFi so the user can connect to it using a web browser to setup the new credentials.

Aaa nice idea, i will try this. Thank you