Tiny Core Base > Raspberry Pi

Manage wifi (RPi3) with NetworkManager

(1/3) > >>

derjan:
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:


--- Code: ---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)

--- End code ---

Does anyone know how to fix this?

lotte67890:
You need to create a profile for networkmanager to handle your wifi connection:

nmcli con add type wifi con-name MyWifiNetwork ifname wlan0 ip4 192.168.1.50/24 gw4 192.168.1.1

If you search around the internet you will find a lot of examples... e.g. for dhcp configuration.... Also I assume you may run nmcli with sudo

L

Juanito:

--- Quote from: derjan on February 13, 2018, 11:57:40 AM ---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..

--- End quote ---

Don't load the wifi extension - this will load the non-dbus wpa_supplicant extension, which will mess things up.

See below (about 2/3 of the way down the thread) on how to connect to wifi with nmcli:

http://forum.tinycorelinux.net/index.php/topic,21685.0.html

derjan:
Thanks for the reply, but not installing the wifi extension doesn't change the unavailability of wifi. I re-flashed the SD card with piCore 9.0.3 and installed only the firmware-rpi3-wireless and networkmanager extensions. Same error message in /var/log/messages, and I can't bring the wifi interface up with nmcli.

Adding a connection with nmcli c add type wifi ssid MySSID ifname wlan0 works, but nmcli c up wifi-wlan0 fails with Error: Connection activation failed: No suitable device found for this connection..

nmcli d show wlan0 says that GENERAL.STATE: 20 (unavailable).
nmcli c show wifi-wlan0 says that connection.interface-name: wlan0 but nmcli c show only shows -- for the wifi-wlan0 device.

These are the lines from /var/log/messages:


--- Code: ---... daemon.info NetworkManager[1106]: <info>  [12.8484] device (wlan0): driver supports Access Point (AP) mode
... daemon.info NetworkManager[1106]: <info>  [12.8559] manager: (wlan0): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/2)
... daemon.info NetworkManager[1106]: <info>  [12.8643] device (wlan0): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
... daemon.info NetworkManager[1106]: <info>  [13.4262] device (wlan0): set-hw-addr: set MAC address to XX:XX:XX:XX:XX:XX (scanning)
... daemon.warn NetworkManager[1106]: <warn>  [13.4908] 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)

--- End code ---

Is there anything else preventing nmcli from managing the wifi device?

lotte67890:
You may try to also start dbus...

Navigation

[0] Message Index

[#] Next page

Go to full version