Open phylax2020 opened 4 months ago
Further research into this issue yielded the following results:
If there is no traffic over WLAN for a long period of time, the system decides to interrupt the WLAN0 connection. The connection remains interrupted and is not reactivated automatically. The minimum WLAN idle time is exactly 12 hours. The only way to get out of this state is to restart the NetworkManager.
In order to make this effect visible, I used a bash script that periodically checks the status of the WLAN connection every 2 minutes via crontab. If the WLAN connection is interrupted, a message is written to the journal and the NetworkManager is restarted.
#!/bin/bash
# restart NetworkManager when wlan0 disappeared
if [ "$(nmcli -g GENERAL.STATE dev show wlan0)" = "30 (disconnected)" ]; then
echo "wlan0 disconnected" | systemd-cat
systemctl restart NetworkManager
fi
Does anyone know where in the OS there is a timeout of exactly 12 hours that leads to this problem? As already reported, the WLAN power management is switched off and is therefore not a possible cause.
I'm experiencing the same problem.
However, it seems that I don't have to restart NetworkManager. I can just
sudo ifconfig wlan0 down
then
sudo ifconfig wlan0 up
And everything comes back and works properly again...until next time.
EDIT: To clarify, I haven't set up any access point or virtual WLANs or anything like that. Just a run of the mill install/setup. It just keeps randomly disconnecting.
I haven't been able to verify whether it's on a routine 12-hour cycle, or anything like that.
I know it's not quite what you're asking about (and I'm afraid I've never used AP-STA mode myself), but FYI https://www.raspberrypi.com/tutorials/host-a-hotel-wifi-hotspot/ suggests using a separate USB WiFi dongle in addition to the built-in WiFi interface.
The commands: sudo ifconfig wlan0 down followed by sudo ifconfig wlan0 up don't work, wlan0 keeps disconnected:
However, my workaround with restarting NetworkManager works perfectly. The test was now also carried out with the following kernel version:
Linux pi-ager 6.1.73-v8+ #1726 SMP PREEMPT Wed Jan 24 15:02:30 GMT 2024 aarch64 GNU/Linux
I would be very interested to know whether the problem is in the Linux kernel or in modules in the kernel environment.
There is an intersting thread that sheds some light on the problem with concurrent STA and AP mode on the RPi 5. The RPi 5 uses the Infinon CYW43455 wireless chip and in that thread is shown, when STA mode fails after a while outputting the same error messages seen on my Raspberry Pi 5 system. In summary, the firmware for this wireless chip is faulty:
Not just WIFI. I have my pi5 connected to a router via Ethernet and get the same disconnect after a period and of inactivity. I use the pi to run a remote observatory so this is very unacceptable as I now have to go to the observatory to restart the pi each night. Looks like I need to revert back to a pi4.
@Clownfish33 Is it possible that your problem is with your router, or some kind of incompatibility between your router and your Pi? I've had a Pi 5 connected via Ethernet for several months (using a simple Netgear gigabit switch), and never had a single connectivity problem.
@Clownfish33 “Is it possible that your problem is with your router, or some kind of incompatibility between your router and your Pi?”
I solved the problem, and it wasn’t the network router or cables. I removed my NVME hat and SSD card and put the normal SD card back in. Voila the disconnect issue after a 12 hour idle went away.
My SSD card was an exact copy of the SD card. I swapped them back again, and the problem returned. It only occurred when I boot from the SSD card.
A common culprit here would be power supply. Although make sure your OS is up to date, there have been improvements in there too.
I have a Raspberry Pi 5b running the latest bookworm version from Raspberry Pi Imager v1.8.4: Pi OS (64-bit) with Raspberry Pi Desktop. I followed the different steps to install the OS with WiFi on a USB memory stick. I also did update the OS with apt update and apt full-upgrade. The current OS version is: Linux RaspberryPi 6.1.0-rpi8-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux
Next I generated a virtual WLAN1 interface on wlan0 and turned off power save in /etc/rc.local:
Next i nstalled an access point on WLAN1 with NetworkManger:
All works fine for few hours or up to several day. Then suddenly the network indicator on the desktop is grayed out and states, that wlan0 is no langer available, the hotspot at IP: 192.168.4.1 is still active. The WLAN router (FRITZBOX 7490) has a strong and stable WLAN signal and is located nearby the RPi 5 and is still connected to other devices in the WLAN network.
Also the access point is still reachable by using smart phones or tablet computers. The log generated by journalctl shows the following errors, when the wlan0 connection disappears:
The problem starts at this point without any external cause:
Feb 25 14:32:56 RaspberryPi wpa_supplicant[866]: wlan0: CTRL-EVENT-DISCONNECTED bssid=c8:0e:14:27:6d:b5 reason=3
The status of NetworkManager is as follows:
The device states with 'nmcli dev' is as follows:
The problem persists until you restart NetworkManager. If I set up the system with the 32Bit OS-Lite version of Bookworm in the same way and run it on a Pi zero 2W, there are no problems.
Does anyone have an idea of what might be causing this error and how to fix it?