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.
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.
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.
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>
$ 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