Network widget lists no wifi networks
Opened this issue · 7 comments
Describe the bug
The bar network widget and the menu that opens when clicking it work when ags is first started, but after a minute or two both show no networks.
To Reproduce
For me this happens simply by starting ags and then waiting for a minute or two.
Expected behavior
Available networks should always be displayed.
Desktop (please complete the following information):
- Distribution: Arch Linux
- Window Manager/Desktop Environment: Hyprland
Additional context
I'm guessing this is actually an issue with ags/the network manager service since the array returned by network.wifi["access-points"] is what appears to be empty, but it seemed worthwhile to start here first, and I don't feel that I know enough to make a useful bug report to ags yet.
I don't think it's directly related to the comment below since the _device
property does not seem to be undefined
in my case.
// Sometimes the network service will yield a "this._device is undefined" when
// trying to access the "access_points" property. So we must validate that
// it's not 'undefined'
//
// Also this is an AGS bug that needs to be fixed
let WAPs =
network.wifi._device !== undefined ? network.wifi["access-points"] : [];
In fact I can entirely remove the check and replace with just let WAPs = network.wifi["access-points"];
and get the same behavior with no errors. Inspecting WAPs
as ags runs seems to indicate that at some point the available networks start to dwindle out (i.e. it doesn't instantly go from all available to no available) until none are left leading to the no networks available state.
That network.wifi._device !== undefined
check is primarily for when the Wifi device either doesn't exist or isn't enabled on the computer. That's likely why you're not seeing a difference when commenting it out (since yours is always enabled), which is expected.
Could you do me a favor and when you run into the issue where no Wifi access points are being shown, run the following command:
nmcli device wifi list
If that returns the same devices (or lack of) as Hyprpanel, then we know it's related to Network Manager being weird. Otherwise if that shows devices but Hyprpanel doesn't we can dig into it more.
I've always found the NetworkManager to be super inconsistent to be honest, unfortunately.
That all makes sense, thanks for clarifying. Not sure whether good news or bad, but nmcli does show the available networks, but the widget is blanked out again. I was reading up on issues on ags and noticed that the network service seemed to be the most WIP still, so I'm not too surprised if there's still some finickiness with its use.
Yea it could be. It's probably the most 'incomplete' service in AGS. May be a sign for me to contribute to it.
Could you put this line under self.hook(network, () => {...
on line 33 in modules/menus/network/wifi/WirelessAPs.ts
and see whether the service is outputting any wifi networks in the logs, when you see an empty list? If not then that pretty much is a nail in the coffin in that it's AGS network service.
console.log(JSON.stringify(network.wifi.access_points, null, 2));
Yeah it does indeed print out an empty array multiple times right as the widget goes from working to not:
Gjs-Console-Message: 19:47:17.230: []
Gjs-Console-Message: 19:47:17.231: []
Gjs-Console-Message: 19:47:17.231: []
Gjs-Console-Message: 19:47:17.232: []
Gjs-Console-Message: 19:47:17.233: []
Gjs-Console-Message: 19:47:17.438: []
Gjs-Console-Message: 19:47:17.441: []
:( Yea, there is an AGS 2 coming out soon - called Astal. I'll keep a lookout to see if there are updates to the network module in there. Hopefully within the next month or so.
Bummer, yeah I saw that Aylur was working on a rewrite as well. Will stay posted. It's not really a big deal in the meantime since I don't really need to reconfigure wifi all the often. Thanks for taking the time to troubleshoot a little!
I've been noticing more stability with the network widget after disabling the iwd service. I noticed that both wpa_supplicant and iwd had been enabled, and while I'm not entirely certain it's the root cause, I'm thinking that they may have been interfering with each other which lead to the network manager ags service experiencing issues. It's possible also using the iwd backend for network manager and disabling wpa_supplicant would have similar results, though reportedly the iwd backend is less stable.