MkLHX / AP_STA_RPI_SAME_WIFI_CHIP

Configures simultaneous AP and Managed Mode Wifi on Raspberry Pi with the same wifi chip
https://mklhx.github.io/AP_STA_RPI_SAME_WIFI_CHIP/
GNU General Public License v3.0
38 stars 14 forks source link

Reconfiguring wlan0 for new WiFi connection #15

Closed ImanolGo closed 1 year ago

ImanolGo commented 2 years ago

I've tried the ap_sta_config2.sh on a Raspberry Pi 4 with Raspberry Pi OS Bullseye.

It doesn't work out of the box, but after a couple of tweaks, it's able to configure the device and after reboot, the AP is created as well as the internet bridge with the STA.

However, if you would like to reconfiguring wlan0 for new WiFi connection, ie, using:

wpa_cli -i wlan0 reconfigure
sleep 10
ifconfig wlan0 down # better way for docker
sleep 2
ifconfig wlan0 up # better way for docker 

It looses completely the wlan0 connection. Anyway, using:

wpa_cli -i wlan0 reconfigure
sleep 10
ip link set wlan0 down
sleep 2
ip link set wlan0 up

Seems to be working. Is this something that you have tested?

github-actions[bot] commented 2 years ago

Message that will be displayed on users' first issue

S3phe commented 1 year ago

@ImanolGo : Could you please tell which changes you made to make it work?

I am trying to use the script on a Raspi4 with Debian 11.5 (bullseye) and the script seems to work, but in AP+STA my new AP is not visible.

RPi4 is connected via LAN cable.

./ap_sta_config.sh--ap NewWiFi newwifipassword --client ExistingWiFi wifipassword --country DE --no-internet

AP + STA configurations are finished!

--> You MUST REBOOT for the new AP changes to take effect.

After Reboot: ifconfig `ap@wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet6 fe80::dea6:32ff:fe46:54c2 prefixlen 64 scopeid 0x20 ether dc:a6:32:46:54:c2 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1 bytes 90 (90.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.131 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::8576:634:2f85:496e prefixlen 64 scopeid 0x20 ether dc:a6:32:46:54:c1 txqueuelen 1000 (Ethernet) RX packets 107 bytes 14883 (14.5 KiB) RX errors 0 dropped 10 overruns 0 frame 0 TX packets 58 bytes 9294 (9.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 10 bytes 1594 (1.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 10 bytes 1594 (1.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::4db5:165e:a73c:6fa7 prefixlen 64 scopeid 0x20 ether dc:a6:32:46:54:c2 txqueuelen 1000 (Ethernet) RX packets 22 bytes 3339 (3.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 14 bytes 1692 (1.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0`

dmesg [ 7.765082] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 7.772753] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Nov 1 2021 00:37:25 version 7.45.241 (1a2f2fa CY) FWID 01-703fd60 [ 8.920748] 8021q: 802.1Q VLAN Support v1.8 [ 9.043038] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SSFS [ 9.297347] IPv6: ADDRCONF(NETDEV_CHANGE): ap@wlan0: link becomes ready [ 9.355005] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled [ 9.594675] bcmgenet fd580000.ethernet: configuring instance for external RGMII (RX delay) [ 9.595382] bcmgenet fd580000.ethernet eth0: Link is Down [ 10.025354] ieee80211 phy0: brcmf_cfg80211_stop_ap: setting AP mode failed -52 [ 13.667995] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off [ 13.668038] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 19.683829] ieee80211 phy0: brcmf_escan_timeout: timer expired [ 22.334970] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 23.965237] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled [ 30.769972] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled [ 33.763842] cam-dummy-reg: disabling

github-actions[bot] commented 1 year ago

Stale issue message