Yes, the wifi setup currently used within alpha7 uses
- Systemd-network (configuring the interfaces)
- wpa_supplicant (configuring the wlan)
- hostapd (Wifi ap)
- dnsmasq (dns and resolve
- nginx (redirect / captive portal)
- systemd to manage all above
More information can be found here, but it is a buildroot package.
https://github.com/j1nx/MycroftOS/tree/develop/buildroot-external/package/wifi-ap
And this is the little Python code that uses flask to serve a little webpage that you use to setup your wifi,.
https://github.com/j1nx/MycroftOS/tree/develop/buildroot-external/board/raspberrypi/rootfs-overlay/opt/mycroft/wifisetup
In short it works like this;
- At boot systemd looks for the presence of /etc/wpa_supplicant/wpa_supplicant@wlan0.conf
- If it is not there, the wifi is not configured and will create a virtual wifi device called ap0
- ap@ is brought up in open ap mode via wpa_supplicant and hostapd (again using systemd-network)
- dnsmasq is started on that interface, resolving all ip’s to the ip of the app (this is fake internet connectivity
- ngix is started to redirect all trafic to the flask server with a the right redirect code to act as captive portal, so mobile devices automatically open that page
- The python code scans for SSID’s and shows them in a little webpage where you can select the SSID, insert your password and then writes a proper /etc/wpa_supplicant/wpa_supplicant@wlan0.conf and then reboots the device.
Rebooted it now sees the configured wpa_supplicant file and will there for just bring the wifi up with that information and all above services will not be started.
That is how it now works in alpha7, however working on some changes to remove the reboot and skip or quit above if the internet is or comes online. (LAN connection). Hopefully I am also able to scan for the configured SSID and if not found and therefor wifi can not connect, bring again the wifi setup up again (device is somewhere else, or the SSID is not present anymore or changed)
The little python code only handles the scanning and writing of the wpa_supplicant file. All the rest is handled on the OS level via systemd. Very robust.
For the next version, I will change the webpage to look like the Mycroft mark-1 version and use above framebuffer screens to visualize the process, similar as the mark-2 version.
I have that one on the list to be supported in the future.
It runs armbian, so kernel sources are available. The Rootfs of MycroftOS is all the same, for all devices. Support basically means; Bootloader, Kernel and drivers/firmware support. As soon as the rootfs is mounted and systemd takes over, all different devices run the same.
It is a very nice nifty device, but a bit to expensive for me know to already start cracking at it.
Edit: please read around the spelling mistake. In a hurry and to lazy atm