wireless deactivates after sleep / hibernation

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
xaol
Posts: 311
Joined: Wed Mar 03, 2021 8:30 am

Re: wireless deactivates after sleep / hibernation

#21 Post by xaol »

i could have been way more clear with my previous question. what i was wondering was if you gathered similar data after running the post-sleep command like you had been trying. the one in /etc/pm/sleep.d if i recall correctly. this (or a version like it):

Code: Select all

#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
  thaw|resume)
    date >> /tmp/sleeper
    echo "in resume selection" >> /tmp/sleeper
    sleep 10
    service network-manager restart >> /tmp/sleeper 2>&1
    ip address show  dev wlan0 >> /tmp/sleeper
    date >> /tmp/sleeper
    ;;
esac
date >> /tmp/sleeper
echo "now outside case block" >> /tmp/sleeper
sleep 10
ip address show  dev wlan0 >> /tmp/sleeper
date >> /tmp/sleeper 
this is a section from wireless-deactivating-on-open:

Code: Select all

2024-01-31T14:02:47.596862+10:30 phil-envy wpa_supplicant[2494]: wlan0: CTRL-EVENT-DISCONNECTED bssid=5c:a6:e6:55:27:e5 reason=3 locally_generated=1
2024-01-31T14:02:47.596872+10:30 phil-envy wpa_supplicant[2494]: wlan0: Auto connect enabled: try to reconnect (wps=0/0 wpa_state=9)
2024-01-31T14:02:47.596880+10:30 phil-envy wpa_supplicant[2494]: wlan0: Setting scan request: 0.100000 sec
2024-01-31T14:02:47.596889+10:30 phil-envy wpa_supplicant[2494]: Added BSSID 5c:a6:e6:55:27:e5 into ignore list, ignoring for 10 seconds
2024-01-31T14:02:47.596934+10:30 phil-envy wpa_supplicant[2494]: wlan0: Consecutive connection failures: 1 --> request scan in 100 ms
2024-01-31T14:02:47.596961+10:30 phil-envy wpa_supplicant[2494]: wlan0: Ignore new scan request for 0.100000 sec since an earlier request is scheduled to trigger sooner
it looks like there only one failed attempt to reconnect and then the bssid got added to an ignore list very shortly thereafter. when running

Code: Select all

sudo wpa_cli
in interactive mode, after issuing the help command all of the other subcommands are shown. two that look like they might be of interest are

Code: Select all

bssid_ignore = display the list of temporarily ignored BSSID's
bssid_ignore clear = clear the list of temporarily ignored BSSID's
if you try running that post-sleep code, maybe sending the output of

Code: Select all

wpa_cli bssid_ignore
to your temp file will help show if it has been added to an ignore list.

i couldn't find much about an ignore list. this is older, but mentions a blacklist: https://superuser.com/questions/1371134 ... supplicant

regarding the reconnect attempt, maybe it is possible to get more than one before failing like it did. some autoconnect info from my ssid as shown by nmcli:

Code: Select all

nmcli con show <ssid> | grep -i autoconnect
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.autoconnect-slaves:          -1 (default)

VictorRotha
Posts: 13
Joined: Fri Jan 19, 2024 3:32 am

Re: wireless deactivates after sleep / hibernation

#22 Post by VictorRotha »

sigh, so I reinstated the 99-wiki script and it didn't run. It turned out hibernation wasn't working - does this require swap space? Anyway, I switched to sleep mode, the script started working and the interface comes up every time now. When I switched to simple 'turn the screen off' mode when closing the lid, the wireless was deactivated again. So still a problem there but I've reverted to sleep mode again. We've spent enough time on this, I think and I'm happy to leave it there unless you think a bug report would be in order.

xaol
Posts: 311
Joined: Wed Mar 03, 2021 8:30 am

Re: wireless deactivates after sleep / hibernation

#23 Post by xaol »

i believe hibernation does require swap space. it has been a while since i looked into it. i usually just use suspend. the debian wiki looked a bit outdated in the hibernate department. i did find this: https://forums.debian.net/viewtopic.php ... b5#p745883
this isn't debian, but looks similar enough that seems like the above might work: https://ubuntuhandbook.org/index.php/20 ... ntu-21-10/

i'm glad to hear that sleep mode at least does what you want. i didn't realize the disconnect was happening when just turning the screen off. that does seem odd and probably frustrating on your end. i know you aren't just asking me, but i don't know if that is something for a bug report. i tend to live with minor workarounds if they aren't too disruptive.

i set up a system with linux mint for a friend. closing the lid to suspend sometimes didn't work as expected. for some reason choosing suspend from the menu worked just as expected every time so we went with that.

VictorRotha
Posts: 13
Joined: Fri Jan 19, 2024 3:32 am

Re: wireless deactivates after sleep / hibernation

#24 Post by VictorRotha »

Thanks. Yes, I live w workarounds as well. But as this is a new distribution, I think it is important to actually fix these niggling issues so that newbies don't have to deal with them. Anyway, thanks very much for your help (and Charlie Brown for his).

xaol
Posts: 311
Joined: Wed Mar 03, 2021 8:30 am

Re: wireless deactivates after sleep / hibernation

#25 Post by xaol »

you're quite welcome. understood about wanting a newly installed distribution to work better than just ok. i do get that. i believe part of my thought process on that was i wasn't sure what else to try. i hope you get to a place where you feel comfortable with your setup.

Charlie Brown

Re: wireless deactivates after sleep / hibernation

#26 Post by Charlie Brown »

VictorRotha wrote: Thu Feb 01, 2024 8:40 pm... It turned out hibernation wasn't working - does this require swap space?..
xaol wrote: Thu Feb 01, 2024 9:17 pm... i believe hibernation does require swap space...
Yes.

Hibernation => to Disk
Suspend => to Ram

Hybrid Sleep => to both

You have a swap "file" (suggested by default during installation, beginning with MX-23) :

swap-1 type: file size: 3 GiB ... file: /swap/swap

However there's also an option (checkbox) during installation to enable hibernation or not (unchecked by default) ..


Shortly, that would do it automatically: You need to arrange a boot parameter "resume=uuid=xxxx" to enable manually (also the size to >= Ram ) , which's another subject ...

punhan
Posts: 42
Joined: Thu Dec 19, 2024 1:38 pm

Re: wireless deactivates after sleep / hibernation

#27 Post by punhan »

Charlie Brown wrote: Sat Jan 20, 2024 12:02 pm
  • Code: Select all

    sudo tee /etc/pm/config.d/config <<!
    HOOK_BLACKLIST="wireless"
    SUSPEND_MODULES="rtw88_8822ce"
    SUSPEND_MODULES=”rtw_8822ce”
    !
  • Code: Select all

    sudo tee /etc/NetworkManager/conf.d/disable-random-mac.conf <<!
    [device]
    wifi.scan-rand-mac-address=no
    !
Reboot.


P.S. It's normal that the terminal warns you about security when you paste and press Enter, just go on, click "paste" and press Enter.

Thank you very much Charles, it worked in my case.

Post Reply

Return to “MX Help”