Network Connections after wake from sleep

I have woken up my MBP several times after it goes to sleep, and each time I am finding the Network Manager service works fine, Bluetooth is on and connected to my BT keyboard and mouse, but the wifi is dead due to no active connections. I would like to fix that, but I am struggling with the Arch way of doing it. I read one should create a restart service. Not sure that is exactly the solution. My computer stats read as follows from garuda-inxi below. Any hot tips here on what to do so that my Wifi can connect to an Active Connection once I re-awaken the machine?

By Sleep I also mean something overnight happens. If I just use Logout and choose Sleep and then re-awaken the machine, the network connection is fine. It only when I leave the machine for many hours, that this coma happens.

I can save the system status when this happens I suppose and then diff that with this garuda-inxi output to find the culprit?

System:
Kernel: 6.6.8-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
clocksource: tsc available: acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=3ca8b255-f29c-4744-8324-8ca995444357 rw rootflags=subvol=@
quiet resume=UUID=88aa211a-5bdb-49f3-a5f5-d8ac5cf926a3 loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.27.10 tk: Qt v: 5.15.11 wm: kwin_wayland vt: 1
dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Laptop System: Apple product: MacBookPro12,1 v: 1.0
serial: <superuser required> Chassis: type: 9 v: Mac-E43C1C25D4880AD6
serial: <superuser required>
Mobo: Apple model: Mac-E43C1C25D4880AD6 v: MacBookPro12,1
serial: <superuser required> UEFI: Apple v: 486.0.0.0.0 date: 08/03/2023
Battery:
ID-1: BAT0 charge: 58.8 Wh (96.7%) condition: 60.8/74.8 Wh (81.4%)
volts: 12.7 min: 11.4 model: DP bq20z451 type: Li-ion serial: N/A
status: full cycles: 209
Device-1: hidpp_battery_8 model: Logitech MX Master 3 for Mac
serial: <filter> charge: 100% (should be ignored) rechargeable: yes
status: discharging
CPU:
Info: model: Intel Core i5-5287U bits: 64 type: MT MCP arch: Broadwell
gen: core 5 level: v3 note: check built: 2015-18 process: Intel 14nm
family: 6 model-id: 0x3D (61) stepping: 4 microcode: 0x2F
Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache:
L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB
L3: 3 MiB desc: 1x3 MiB
Speed (MHz): avg: 3050 high: 3300 min/max: 500/3300 scaling:
driver: intel_cpufreq governor: performance cores: 1: 3300 2: 2802 3: 3300
4: 2800 bogomips: 23201
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: Intel Iris Graphics 6100 vendor: Apple driver: i915 v: kernel
arch: Gen-8 process: Intel 14nm built: 2014-15 ports: active: HDMI-A-2,eDP-1
empty: DP-1,DP-2,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:162b
class-ID: 0300
Display: wayland server: X.org v: 1.21.1.10 with: Xwayland v: 23.2.3
compositor: kwin_wayland driver: X: loaded: modesetting
alternate: fbdev,intel,vesa dri: iris gpu: i915 d-rect: 3657x1234
display-ID: 0
Monitor-1: HDMI-A-2 pos: right res: 2194x1234 size: N/A modes: N/A
Monitor-2: eDP-1 pos: primary,left res: 1463x914 size: N/A modes: N/A
API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
device: 1 drv: swrast surfaceless: drv: iris wayland: drv: iris x11:
drv: iris inactive: gbm
API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 23.3.1-arch1.1
glx-v: 1.4 direct-render: yes renderer: Mesa Intel Iris Graphics 6100 (BDW
GT3) device-ID: 8086:162b memory: 15.16 GiB unified: yes display-ID: :1.0
API: Vulkan v: 1.3.274 layers: 9 device: 0 type: integrated-gpu name: Intel
Iris Graphics 6100 (BDW GT3) driver: mesa intel v: 23.3.1-arch1.1
device-ID: 8086:162b surfaces: xcb,xlib,wayland device: 1 type: cpu
name: llvmpipe (LLVM 16.0.6 256 bits) driver: mesa llvmpipe
v: 23.3.1-arch1.1 (LLVM 16.0.6) device-ID: 10005:0000
surfaces: xcb,xlib,wayland
Audio:
Device-1: Intel Broadwell-U Audio vendor: Apple driver: snd_hda_intel
v: kernel bus-ID: 00:03.0 chip-ID: 8086:160c class-ID: 0403
Device-2: Intel Wildcat Point-LP High Definition Audio
driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:9ca0
class-ID: 0403
Device-3: Broadcom 720p FaceTime HD Camera driver: N/A pcie: gen: 2
speed: 5 GT/s lanes: 1 bus-ID: 02:00.0 chip-ID: 14e4:1570 class-ID: 0480
API: ALSA v: k6.6.8-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Broadcom BCM43602 802.11ac Wireless LAN SoC vendor: Apple
driver: brcmfmac v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
bus-ID: 03:00.0 chip-ID: 14e4:43ba class-ID: 0280
IF: wlp3s0 state: down mac: <filter>
Bluetooth:
Device-1: Apple Bluetooth Host Controller driver: btusb,hid-generic,usbhid
type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-3:2
chip-ID: 05ac:8290 class-ID: fe01
Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 4.2
lmp-v: 8 status: discoverable: no pairing: no class-ID: 7c0000
Drives:
Local Storage: total: 465.92 GiB used: 21.68 GiB (4.7%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: Apple model: SSD SM0512G
size: 465.92 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: JA0Q scheme: GPT
Partition:
ID-1: / raw-size: 448.54 GiB size: 448.54 GiB (100.00%)
used: 21.68 GiB (4.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 584 KiB (0.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1
ID-3: /home raw-size: 448.54 GiB size: 448.54 GiB (100.00%)
used: 21.68 GiB (4.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-4: /var/log raw-size: 448.54 GiB size: 448.54 GiB (100.00%)
used: 21.68 GiB (4.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-5: /var/tmp raw-size: 448.54 GiB size: 448.54 GiB (100.00%)
used: 21.68 GiB (4.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 15.52 GiB used: 4 KiB (0.0%) priority: 100
comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 4 dev: /dev/zram0
ID-2: swap-2 type: partition size: 17.08 GiB used: 0 KiB (0.0%)
priority: -2 dev: /dev/sda3 maj-min: 8:3
Sensors:
System Temperatures: cpu: 83.0 C pch: 80.0 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Processes: 227 Uptime: 1d 22h 1m wakeups: 7 Memory: total: 16 GiB
available: 15.52 GiB used: 6.11 GiB (39.4%) Init: systemd v: 255
default: graphical tool: systemctl Compilers: gcc: 13.2.1 clang: 16.0.6
Packages: pm: pacman pkgs: 1940 libs: 562 tools: octopi,paru Shell: fish
v: 3.6.4 running-in: konsole inxi: 3.3.31
Garuda (2.6.22-1):
System install date:     2023-12-24
Last full system update: 2023-12-25 ↻
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut
Windows dual boot:       No/Undetected
Failed units:

I think you could try something like this.

For sure you will have to change rtw88_8822ce with brcmfmac. Probably nothing else, but read it through…

3 Likes

Unfortunately this does not work. Service is down and out and not revivable. Even running the network-restart.service from the command line does not revive the list of available network connections.

Something else must be responsible for killing the listing and not reviving it. So far, only a brute-force “restart” brings back network connections.

That’s an interesting clue. :thinking:

Try disabling MAC address randomization and see if you notice any difference.

https://wiki.archlinux.org/title/NetworkManager#Configuring_MAC_address_randomization

3 Likes

Try also some other kernels.

1 Like

These claims are totally unsubstantiated!!!


Where is the textual evidence of the contents of the service you wrote?

I always include the correct command to list the location and the contents of the service in every service I write:

How could we possibly know if your service was written correctly, if you do not post the command output for us to review the service you created?


Where is the terminal output of the status command I always include in any service I write?


How can we possibly know what the problem with the service is, when you do not post the errors from the execution of the status command?


Where is the terminal output of the commands you ran?

We are not clairvoyants! Without textual proof, for all intents and purposes, nothing was run, and no errors were ever thrown. For all we know you simply executed a null command. Where’s the substantiation for your claims?

You don’t have much hope of ever finding a solution with responses such as:

You need to provide detailed and accurate feedback if you wish to solve your problem. Answers such as you’ve provided only serve to frustrate forum assistants and are usually very counterproductive. Sorry if this comes off as a rant, but it is a little insulting when someone basically claims a service I wrote is totally useless without providing any evidence to back up these kind of statements.



4 Likes

You can run the following commands prior to suspending to unload all of your networking components:

nmcli networking off
sleep 1
sudo systemctl stop NetworkManager
sleep 1
sudo ip link set wlp3s0 down
sleep 1
sudo modprobe -rv b43
sudo modprobe -rv b43legacy
sudo modprobe -rv ssb
sudo modprobe -rv brcm80211
sudo modprobe -rv brcmfmac
sudo modprobe -rv brcmsmac
sudo modprobe -rv bcma
sudo modprobe -rv wl
sudo modprobe -rv btusb


Once you resume, run the following commands:

sudo rfkill unblock wifi
sleep 3
sudo modprobe -v brcmfmac
sleep 1
sudo ip link set wlp3s0 mode default
sleep 1
sudo ip link set wlp3s0 up
sleep 1
sudo systemctl start NetworkManager
sudo nmcli networking on
nmcli r wifi off
nmcli r wifi on

These commands should hopefully successfully restart your WiFi after resuming. Bluetooth will not be restarted with the above commands to see if that also helps. If you wish to restart your Bluetooth afterwards you can run sudo modprobe btusb.

As always, please post both the full input and output of all commands run.

Good luck.

3 Likes

Thanks for the lessons. When I wrote my does not work, it was in fact after I did inspect everything in minute detail. I am not new to computing. I appreciate the reminder though.

It does in fact work. All I had to do to get it working was shutdown and restart and lo-and-behold, the network service now nicely figures out it is down, starts up again, and writes me a nice notification after re-connecting.

So this is a slick thing to do, adding a network-restart service. Learned something valuable there.

Thanks!

Glad to hear you got things working.

For the benefit of others with a BCM4360 WiFi adapter, please post the working version of the service you are running.

That way Broadcom users with Wifi adapters that require the brcmfmac driver have a working service example to refer to.

Personally I’d avoid buying Apple products if you intend to run Linux in the future. Apple and Broadcom adapters especially are notoriously hard to get working properly under Linux. Just a word to the wise, but do as you please YMMV.

5 Likes

Absolutely correct, what you say about new Apple products. Old apples that are no longer supported are ideal for Linux thanks to their advanced hardware at the time. I would like to emphasize that Apple products are recyclable thanks to Linux.
My mission is to breathe new life into old Macs and give them away.

1 Like

It is an old machine from 2015 that I am resurrecting with Linux as a fun project. I am not buying a NEW Apple machine and trying to fit Linux onto something that will surely be something crazy cutting-edge!!

I was figuring that since this laptop is nearly 8 years old, it would slot nicely into most *nix kernals without too much trouble, as many hundreds if not thousands of others before me would’ve worked out the kinks!

It has always been a challenge getting Linux working! I was doing it when the Intel 386SX and first generation 486 chips were state of the art…

Anyway, the service is the one you suggested, word for word with the only edit needing to be the swapping out of the brcmfmac.

I think my model, the MBP 12,1 is one of the best they ever made! Heavy sure, but it is has ports, a nice screen and decent performance. Ideal for Linux in 2023!

Again, pease post your working solution.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.