cosmic-applets icon indicating copy to clipboard operation
cosmic-applets copied to clipboard

[Bug Report] WiFi Does Not Reconnect on System Wake

Open Dygear opened this issue 1 year ago • 1 comments

Cosmic-applets version: 0.1.0~1725375368~24.04~0b53634

Specific applet that this is regarding (if applicable): cosmic-applet-network

Issue/Bug description: When the system goes to sleep, or when the connection is dropped, the system does not automatically reconnect to the last WiFi connection it had.

Steps to reproduce:

  1. Put the system to sleep, and wake it up again. The system will not re-connect to the last WiFi connection.
  2. Disconnect power from the WiFi access point. The system will not re-connect when the WiFi SSID comes back online.
  3. Reboot the system. The system will not re-connect to the last WiFi SSID that it connected to.

Expected behavior: System should automatically reconnect to the last SSID it was connected to. Ideally this should also persist over system reboots, and not just sleep / wake events, or lost of access to the SSID due to power loss (on the access point side) or moving away from the signal source.

Other notes: Other systems will often pick the next best connection that it knows. That doesn't always produce an expected behavior for the user, that can sometimes be surprised when their laptop is suddenly connected to their Cellphone's Hotspot for several hours and didn't realize until their provider sent them a message about them being near their data limit. So for the moment, I think the best move forward would simply re-attempt a connection back to the same SSID as before.

Dygear avatar Sep 04 '24 20:09 Dygear

Writing down notes for myself, or someone else if they want to take this on.

In cosmic-applet-network/src/network_manager/mod.rs#L366 is has:

let s = Settings::new(s);

Settings is from cosmic_dbus_networkmanager::settings::connection that looks like it loads the known information about theconnection state from last time (so there is a database or settings file somewhere). ConnectionSettings's autoconnect value could be used, but that is dependent on WifiSettings is a inhearting of ConnectionSettings.

	ConnectionSettings,
	(auth_retries("auth-retries"): i32),
	(autoconnect("autoconnect"): bool),

Otherwise, we just add the autoconnect property to WifiSettings that defaults to true so when the connection manager loads the list of known connections it can look over the available SSIDs and the list of known SSID's and connect if the SSIDs match.

Dygear avatar Sep 16 '24 04:09 Dygear

This has been resolved. Thank you @wash2 for landing this in https://github.com/pop-os/cosmic-applets/commit/d1a6e089b4b87d6b8b4ee6b6759317f49af402ee.

Dygear avatar Oct 16 '24 07:10 Dygear

I'm experiencing wifi issues with similar conditions from the initial post.

Pop!_OS 24.04 LTS COSMIC Epoch 1 (alpha 6)

pop-os description: Laptop product: Lemur Pro vendor: System76 version: lemp13-b

*-pci:3 description: PCI bridge product: Intel Corporation vendor: Intel Corporation physical id: 1c.1 bus info: pci@0000:00:1c.1 version: 20 width: 32 bits clock: 33MHz capabilities: pci pciexpress msi pm normal_decode bus_master cap_list configuration: driver=pcieport resources: irq:125 memory:b2900000-b29fffff *-network description: Ethernet interface product: Wi-Fi 7(802.11be) AX1775*/AX1790*/BE20*/BE401/BE1750* 2x2 vendor: Intel Corporation physical id: 0 bus info: pci@0000:2e:00.0 logical name: wlp46s0f0 version: 1a serial: 28:a0:6b:e4:7b:4f width: 64 bits clock: 33MHz capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical configuration: broadcast=yes driver=iwlwifi driverversion=6.12.10-76061203-generic firmware=90.38c93dbc.0 gl-c0-fm-c0-90.uc ip=192.168.0.72 latency=0 link=yes multicast=yes resources: irq:17 memory:b2900000-b2903fff

rockymount5280 avatar Mar 02 '25 23:03 rockymount5280