With Arduino/ESP8266 it is just a matter of include a Library (WiFiManager). I need this functionality:
- when the Raspi starts up, it sets it up in Station mode and tries to connect to a previously saved Access Point;
- if this is unsuccessful (or no previous network saved) it moves the Raspi into Access Point mode and spins up a DNS and WebServer (captive portal);
- using any wifi enabled device with a browser (computer, phone, tablet) connect to the newly created Access Point
- because of the Captive Portal and the DNS server you will either get a 'Join to network' type of popup or get any domain you try to access redirected to the configuration portal;
- choose one of the access points scanned, enter password, click save
- Raspberry will try to connect (without rebooting). If successful, it relinquishes control back to your app. If not, reconnect to AP and reconfigure.
Thanks for any tip