I have put together a git repository and a script to enable automatic wifi.
It installs hostapd, dnsmasq, php, and libapache2-mod-php
It then creates a couple scripts to facilitate the auto wifi function.
/etc/init.d/autohotspot sets up the ip address on the wlan adapter (currently 10.5.5.5)
/usr/local/sbin/start_hostapd.sh creates the /etc/hostapd config file with the SHARI_(node MAC ADDRESS) and starts hostapd if there are no wifi connections.
The script gives permission to www-data to access the network device and run some commands to setup wifi. I designed this for a hotspot so I would not run it on any servers that have the web interface exposed to the internet.
Then there are a collection of files for the web interface. This includes the page asking for the WiFi credentials and the scripts to scan available WiFi and then to create the NetworkManager files.
The script copies the web files to the web root and configures apache to load the pages when a device attempts to connect to its connectivity check site.
Install process is to install asl3 and configure your node. Open a root console and then clone the git repository. Change into the script directory in that repository and run the install_autohotspot.sh script.
sudo su
apt install git
git clone https ://github.com/pcpackrat/ASL3-AutoHotSpot/tree/main ← space entered to stop the forum from resolving it.
cd ASL3-AutoHotSpot/script
chmod +x install_autohotspot.sh
./install_autohotspot.sh
I have tested this on 3 PI4 SHARI nodes running ASL3 and it seems solid so sharing here now.
I have found that sometimes it requires a few refreshes to get the wifi scan to work the first time in the browser.
Everything is in script format so you can read through it to be sure its not doing anything nefarious.
As with anything on the Internet, use at your own risk.
-Michael N5ZR