-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wi-Fi fails to work when connman is enabled with networking.connman.enable = true. #23196
Comments
cc @matejc |
FTR I have applied a similar workaround to @yegortimoshenko in my networking.wireless = {
enable = true; # Actually automatically enabled by connman.
networks = {
# Fake ssid so NixOS creates wpa_supplicant.conf
# otherwise the service fails and WiFi is not available.
# https://github.com/NixOS/nixpkgs/issues/23196
S4AKR00UNUN21W1NV2Y5MDDW8 = {};
};
}; I think that it would be possible to fix this if the connman configuration did something similar when it's being instantiated:
If people are interested, I'd be willing to submit a PR (with some guidance from maintainers/developers). BTW, this happens in:
Thanks! |
So isn't it a duplicate of #56125 ? |
This workaround is no longer needed. |
@doronbehar unfortunately I can still reproduce the issue with a fresh NixOS Would it be possible to reopen this issue please? I don't want to create duplicates. Thanks. |
@stefano-m many things have changed since your last comment - e.g the names of the options. I think it'd be better to open a new issue with better info of the NixOS version you use (I can confirm I don't experience this issue anymore on unstable) and ccing the module's maintainer. |
#56125 fixes the issue with I can open a new GitHub issue allright, but the problem on the latest stable 20.03 (fresh installation) is the same as described here with the same workaround #23196 (comment)). If the problem has been fixed in unstable, unfortunately it does not make the situation any better for users that are on the stable channel. Also, AFAIU this does not even seem to be fixed in unstable, because
that may or may not exist. In the case of connman, that file does not exist, which causes the wpa supplicant service to fail which causes connman to be unable to use wifi. |
Alternative workaround (which is also nice for plain wpa supplicant use so that {
users.groups = {
"network" = {};
};
systemd.services.wpa_supplicant_initial_cfg = {
description = "WPA Supplicant Initial Configuration";
before = [ "network.target" "wpa_supplicant.service" ];
wants = [ "network.target" ];
wantedBy = [ "multi-user.target" "wpa_supplicant.service" ];
path = [];
script = ''
if ! test -e "/etc/wpa_supplicant.conf"; then
printf "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=network\nupdate_config=1\n" > /etc/wpa_supplicant.conf
fi
chmod 600 /etc/wpa_supplicant.conf
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
};
networking = {
wireless.enable = true;
connman.enable = true;
};
} |
I agree 😬 though we are near yet a 20.09 release and I sure hope whatever commit that fixed it on unstable will reach 20.09. I'll reopen as it seems others are still facing this issue on 20.03. If anyone is capable of verifying that the issue persists on 20.03 or 20.09, it'll help. |
Well, I'm happy that this has been reopened although, looking at the code on master, I have the feeling that this is not yet solved. The problem is that connman sets I wish I had more time to look into it since it's been bothering me for a while. I hope that eventually I'll be able to post a PR. Thanks for keeping this issue open. |
I marked this as stale due to inactivity. → More info |
I close this considering @knuton's report that this is not an issue on stable and unstable anymore. |
Interesting... I have recently moved to NixOS 21.05 and the issue was still present for me. I don't mind that this issue has been closed. If I ever get to it I might investigate further and possibly submit a patch. In the meantime I changed my workaround slightly: environment.etc."wpa_supplicant.conf".text = lib.mkIf
config.services.connman.enable
''
# Dummy config file. Connman uses wpa_supplicant directly.
''; The only annoying thing is that with 21.05 I get a warning whenever I rebuild because "wpa_supplicant" has not interfaces:
I guess this can be avoided by conditionally disabling the warning is |
@stefano-m I must be missing something: why are you enabling |
Not sure I follow... IIRC
and I guess that then the warning follows. Connman configures wpa_supplicant on its own, I don't need to do anything directly. |
Ah, I missed that line, thanks. So, connman starts the daemon and writes to |
AFAIU no, it does not, it just sets I guess that ideally, it should create a dummy |
My report above was about a version of nixpkgs with #104722 applied, however this patch has been reverted in upstream nixpkgs and no longer is present in 21.05 (see also #107341 (comment)). So I can't say how this behaves in current NixOS, sorry. :-) |
I may have finally found a clean solution to the issues[1][2][3] with the automatic discovery of wireless network interfaces. [1]: NixOS#101963 [2]: NixOS#23196 [3]: NixOS#125917 (comment) Currently the start script fails right away if no interface is available by the time it's running, possibly leaving the system without network. This happens when running a little early in the boot. A solution is to instead wait for at least one interface to appear before scanning the /sys/class/net/ directory. This is done here by listening for the right udev events (from the net/wlan subsystem) using the `udevadm monitor` command and grep to match its output. This methods guarantees the availability of at least one interface to wpa_supplicant, but won't add additional interfaces once it has started. However, if the current interface is lost, say unplugged, the service is automatically stopped and will be restarted as soon as a one (not necessarily the same) is detected. It would be possible make this fully dynamic by running another service that continously listen for udev events and manages the main wpa_supplicant daemon, but this is probably overkill. I tested the following cases: - one interface, starting at boot, w/o predictable naming scheme - two interfaces, starting at boot (intel wireless and a usb adapter), w/o predictable naming scheme - one interface after the system booted, w/o predictable naming scheme - two interfaces after the system booted, w/o predictable naming scheme - unplugging and plugging back the current interface
This should be finally fixed with #127595 (now in nixos-unstable). |
Issue description
When connman is enabled with
networking.connman.enable = true
, connman fails to see Wi-Fi. It will not be listed in technologies & when runningenable wifi
inconnmanctl
you will get the cryptic & confusing errorError wifi: Method "SetProperty" with signature "sv" on interface "net.connman.Technology" doesn't exist
Oddly enough, connman works fine when
networking.connman.enable = false
&networking.wireless.enable = true
(specifically, when wpa_supplicant is running, which of course also requires a valid wpa_supplicant.conf otherwise it'll fail.) &connmand
is manually run as root.Steps to reproduce
1.Put
networking.connman.enable = true
in configuration.nix.2. Run
nixos-rebuild switch --upgrade
Technical details
The text was updated successfully, but these errors were encountered: