Wifi-AP an NetworkManager

Hi, I’m using Ubuntu Core and I’m new to Snappy.

I’m using the snap package “wifi-ap” to enable Access Point. I’m also using “NetworkManager” when I want to use Station mode.

I’m struggling to switch from AccessPoint to Station and vis versa.
Currently the only way I found to switch between modes is to enable or disable wifi-ap with :
sudo wifi-ap.config set disabled=false
or
sudo wifi-ap.config set disabled=true
and then restart the system.

Do you know if there is a procedure documented somewhere ?

If not I can give more details about what I tried and what errors I got.

Thanks

What you are doing is the correct way to switch between Station and AP mode, and in general you should not need to reboot. But, depending on your HW you might need to reload the corresponding kernel module, or even reboot as you have done for the moment.

Which wifi HW / kernel module are you using?

Hi and thanks for your reply,

I’m working with a Dell Edge Gateway 3003 (https://topics-cdn.dell.com/pdf/dell-edge-gateway-3000-series_users-guide3_en-us.pdf) and the chip is an RS9113 from Alpine.

I’m sorry but I’m not sure about how to know wich module I’m using.
When I run lshw I got driver=RSI-SDIO. Is is what you are asking ?
And when I run lspci I can’t see my Wireless controller.

Thanks

The Alpine wifi has different modes that are selected by editing a number in /etc/modprobe.d/rs9113.conf. The modes you are probably interested in are:

13 -> WiFi STA + BT DUAL
14 -> WiFi AP + BT

But you need to reboot every time you change the file, as depending on the number the firmware that gets loaded to the wifi is different.

Hi,
Yes I know about the different modes and I already edited rs9113.conf to use mode 1 (AP + STA and no BT).
I will not modify it anymore because I don’t need BT, I just want to switch between AP and STA without rebooting.

For example if I want to switch from AP to STA I do the following :

$ sudo wifi-ap.config set disabled=true
$ sudo wifi-ap.status restart-ap
$ nmcli con up <con_nam>
Error : Connection activation failed

I looked at the logs and it looks like the process fails at the wpa_supplicant step :

Network Manager logs :

device (wlan0): supplicant interface state: associating -> 4-way handshake
sup-iface[0x2681890,wlan0] : connection disconnected (reason -3)
device (wlan0): supplicant interface state: 4-way handshake -> disconnected
device (wlan0): Activation: (wifi) disconnected during association, asking for new key
device (wlan0): state change: config -> need-auth (reason 'supplicant-disconnect') [50 60 8]
device (wlan0): No agents were available for this request
device (wlan0): state change: need-auth -> failed (reason 'no-secrets') [60 120 7]
device (wlan0): Activation: failed for connection <con_name>

wpa_supplicant logs :

Authentication with <bssid> timed out.
CTRL-EVENT-DISCONNECTED bssid=<bssid> reason=3 localy_generated=1
WPA: 4-Wat Handshake failed - pre-shared key may be incorrect
CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid=<ssid> auth_failures=1 duration=10 reason=WRONG_KEY
CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid=<ssid> auth_failures=2 duration=20 reason=CONN_FAILED

But if I disable the AP, reboot then connect the same way I did it works perfectly.

I would try then to reload the wifi kernel module, maybe that will help.

And I I try to switch from STA to AP :

$ sudo nmcli con down <con_name>
$ sudo snap stop wpa-supplicant.wpa
$ sudo wifi-ap.config set disabled=false
$ sudo wifi-ap.status restart-ap

After that I can see the Access Point but when I try to connect to it, it just fails.
Here are the logs from wifi-ap :

wifi-ap.management-service[7956]: wlan0: STA <MAC_ADDR> IEEE 802.11: authenticated 
hostapd[8055]: wlan0: STA <MAC_ADDR> IEEE 802.11: authenticated
wifi-ap.management-service[7956]: wlan0: STA <MAC_ADDR> IEEE 802.11: associated (aid1) 
hostapd[8055]: wlan0: STA <MAC_ADDR> IEEE 802.11: associated (aid1)
wifi-ap.management-service[7956]: wlan0: STA <MAC_ADDR> IEEE 802.11: deauthenticated due to local deauth request
hostapd[8055]: wlan0: STA <MAC_ADDR> IEEE 802.11: deauthenticated due to local deauth request
....
....
wifi-ap.management-service[7956]: wlan0: INTERFACE-DISABLED
wifi-ap.management-service[7956]: rfkill: WLAN hard blocked

As you can see after multiple fails the WLAN interface is hard blocked

I tried to reload the kernel module and it worked !

$ sudo modprobe -r ven_rsi_sdio
$ sudo modprobe ven_rsi_sdio

Thank you very much !