01-20-2021, 07:21 PM
(This post was last modified: 01-20-2021, 07:24 PM by dcinoz.
Edit Reason: formatting -b since boot
)
(01-20-2021, 05:06 AM)as400 Wrote: I'm sure what we could do, about wifi module, is to reload it (with systemd) everytime you wake up the phone and enter Phosh.
@as400
Here is a script to automatically reload Realtek wifi / BT driver when coming out of sleep / suspend:
Create an executable file here:
Code:
sudo nano /usr/lib/systemd/system-sleep/reload_realtek_driver.sh
sudo chmod +x /usr/lib/systemd/system-sleep/reload_realtek_driver.sh
Content of reload_realtek_driver.sh as an example:
Code:
#!/bin/sh
case $1/$2 in
pre/*)
sudo logger "`date` Phone going to sleep..."
sudo echo "`date` Sleep" >> /home/mobian/reload_realtek_driver.log
;;
post/*)
sudo logger "'date' Reloading Realtek wifi / BT drives as waking up from sleep..."
sudo echo "`date` Waking up and reloading Realtek wifi / BT driver" >> /home/mobian/reload_realtek_driver.log
# reload realtek driver
sudo rmmod 8723cs
sudo modprobe 8723cs
;;
esac
Script does nothing on suspend (pre). Not sure where logger is output, if at all.
Systemd journal log can be seen using the following command:
Code:
sudo journalctl -b -u systemd-suspend
You can comment out the echos to reload_realtek_driver.log in home directory.
To see its logs:
Code:
cat ~/reload_realtek_driver.log
I don't know if there are any undesirable side effects so please let us know.
I don't know if it prevents the intermittent wifi issues but please let us know.
Pinephone v1.2 UBports CE. Adelaide, Australia using Amaysim SIM (Optus network, VoLTE enabled) with Mobian SD card. VoLTE working also with Felix / Vodafone AU and Aldimobile / Telstra AU.
Manjaro Plasma Mobile on EMMC.
Manjaro Plasma Mobile on EMMC.