Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3873

Raspberry Pi OS • Debian Bookworm AP+STA setup fragile

$
0
0
I'm having issues on my pi 4B when trying to use the wifi adapter as both an access point and a wifi network at the same time. Connecting to wifi fails after a short wile, with the pi not able to list any SSIDs on the network. I have tried many things, apart from using hostapd + dnsmasq, below is my configuration using NetworkManager, on a fresh system install.

Code:

iw dev wlan0 interface add ap0 type __apip link set dev ap0 address e4:5f:01:1a:bd:92nmcli connection add type wifi ifname ap0 con-name 'AccessPoint' ssid 'AccessPoint' mode apnmcli connection modify 'AccessPoint' wifi-sec.key-mgmt wpa-psknmcli connection modify 'AccessPoint' wifi-sec.psk '**********'nmcli connection modify 'AccessPoint' ipv4.method sharednmcli connection modify 'AccessPoint' ipv4.addresses 88.88.88.1/24nmcli connection modify 'AccessPoint' ipv4.gateway 88.88.88.1nmcli connection modify 'AccessPoint' wifi.powersave 0nmcli con up AccessPointnmcli connection add type wifi ifname wlan0 con-name 'WiFi' ssid 'xikinet'nmcli connection modify 'WiFi' wifi-sec.key-mgmt wpa-psknmcli connection modify 'WiFi' wifi-sec.psk '**********'nmcli connection modify 'WiFi' wifi.powersave 0nmcli con up WiFi
With this configuration I have a working setup.

Code:

root@server:~# nmcli conNAME                UUID                                  TYPE      DEVICEAccessPoint         1f285150-9d9c-4a1e-b1c4-0feb705578a4  wifi      ap0Wired connection 1  ece470e7-c73e-3716-be8f-d24e398477c8  ethernet  eth0lo                  0c58dda7-cc35-4eea-9b1d-9b381bfb13bd  loopback  loWiFi                42c3ff64-7295-4a71-a613-2d5e53250b99  wifi      wlan0root@server:~# nmcli devDEVICE         TYPE      STATE                   CONNECTIONap0            wifi      connected               AccessPointeth0           ethernet  connected               Wired connection 1lo             loopback  connected (externally)  lowlan0          wifi      connected               WiFip2p-dev-ap0    wifi-p2p  disconnected            --p2p-dev-wlan0  wifi-p2p  disconnected            --
But this only works on first setup. If I enter the wrong wifi password and try again, I won't be able to connect to wifi network again, or just simply putting the wifi down and up again.

Code:

root@server:~# nmcli con down WiFiConnection 'WiFi' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)root@server:~# nmcli con up WiFiError: Connection activation failed: The Wi-Fi network could not be foundHint: use 'journalctl -xe NM_CONNECTION=42c3ff64-7295-4a71-a613-2d5e53250b99 + NM_DEVICE=wlan0' to get more details.root@server:~# ip a....3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DORMANT group default qlen 1000    link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff4: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000    link/ether e4:5f:01:1a:bd:92 brd ff:ff:ff:ff:ff:ff permaddr e6:5f:01:ba:bd:91    inet 88.88.88.1/24 brd 88.88.88.255 scope global noprefixroute ap0       valid_lft forever preferred_lft forever    inet6 fe80::3e3d:94ac:4fd9:6a48/64 scope link noprefixroute       valid_lft forever preferred_lft foreverroot@server:~# journalctl -u wpa_supplicant -f...       Oct 21 06:13:53 server wpa_supplicant[1121]: wlan0: CTRL-EVENT-SCAN-FAILED ret=-52 retry=1Oct 21 06:13:53 server wpa_supplicant[1121]: wlan0: CTRL-EVENT-DSCP-POLICY clear_allOct 21 06:13:53 server wpa_supplicant[1121]: wlan0: CTRL-EVENT-SCAN-FAILED ret=-52root@server:~# nmcli dev wifi rescan ifname wlan0root@server:~# nmcli dev wifi list ifname wlan0IN-USE  BSSID  SSID  MODE  CHAN  RATE  SIGNAL  BARS  SECURITY

Statistics: Posted by xiki808 — Mon Oct 21, 2024 5:19 am



Viewing all articles
Browse latest Browse all 3873

Trending Articles