Hi,
I'm creating a device with an ESP32 that needs some setup parameters which the user must enter through a web server:
if no parameters are available at startup the ESP32 must go in AP mode, wait for the user to connect from a dekstop and display a setup page on the desktop. After the user set the parameters the ESP32 leaves AP-mode and starts it's normal tasks. If the user doesn't set the parameters the ESP32 shuts down.
if parameters are available at startup (the user has defined them in a previous session) the ESP32 must also go in AP-mode. If the user connects from the desktop within (say) 60 seconds, the setup page must be shown so the user can alter the parameters. After the user set the parameters the ESP32 leaves the AP-mode and starts it's normal tasks.
If the user doesn't connect within the first 60 seconds the ESP32 leaves the AP-mode and start it's normal tasks.
it is doubtful if there is code which does exactly what you require
try a web search for esp32 access point webserver - you will get plenty of links to give you a starting point
also for storing information have a look at esp32 preferences
I'm afraid you'll have to program it yourself. It looks like you want to configure WiFi credentials while in AP mode and then switch to STA mode for normal use? If so here are some ideas:
write WiFi credentials into configuration file and read them when ESP32 starts up.
if they are not set go directly to AP mode.
if they are already set, start WiFi in both AP and STA modes and turn AP mode off after 60 seconds.
a web server can check where the requests come from (AP or STA - by checking the client's IP address) and return the appropriate page accordingly.