I'm trying to build a headless Raspberry Pi 3 with wired, wifi, and 3G network access that configures itself automatically based on what's available. Obviously, wired > wifi > 3G. Out of the box it doesn't even recognise when I pull the network cable (ifconfig still shows the DHCP IP address) so I guess I need some kind of network manager which monitors the connections and updates IP addresses, routes, and nameservers.
After installing firmware-rpi3-wireless, wifi, and networkmanager and adding /usr/local/etc/init.d/dbus restart and /usr/local/etc/init.d/networkmanager start to /opt/bootlocal.sh networkmanager seems to manage the wired connection out of the box.
However, I can't get it to manage the wifi connection. Using the wifi.sh script I can connect to my wireless network, and nmcli r shows WIFI enabled. But nmcli d says the wifi status is unavailable, nmcli d wifi list is empty and nmcli d wifi rescan fails with Error: Scanning not allowed while unavailable or activating..
There is an error message in /var/log/messages saying:
daemon.warn NetworkManager[1448]: <warn> [1518538553.0895] supplicant: failed to acquire wpa_supplicant proxy: Wi-Fi and 802.1x will not be available (Error calling StartServiceByName for fi.w1.wpa_supplicant1: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program fi.w1.wpa_supplicant1: Permission denied)
Does anyone know how to fix this?