You are not logged in.

#1 2022-03-01 14:59:54

dead101
Member
Registered: 2021-12-07
Posts: 21

nmcli shows no networks even when the device is there.

I am using mt7601u as my wifi adapter, and I have been using it for 5 months without a flow. But when I installed the VirtualBox, it needs to pass the usb port of the adapter to it. I mean I need to turn on the usb port manually with devices options. And when I do the host machine's wifi turns off. This didn't bother me much as I can do my work. But today when I try to connect to the wifi after disconnecting the VirtualBox's usb device, nmcli doesn't let me connect. When I do nmcli dev wifi list, it shows nothing. As I guess the wifi adapter is there but no networks.

~   ❯   journalctl -xb | grep wlan                                                                                                                            19:39:51
Mar 01 19:34:11 dead NetworkManager[463]: <info>  [1646143451.9308] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
Mar 01 19:34:11 dead NetworkManager[463]: <info>  [1646143451.9312] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Mar 01 19:34:11 dead systemd-networkd[293]: wlan0: Link UP
Mar 01 19:34:11 dead systemd-networkd[293]: wlan0: Link DOWN
Mar 01 19:34:11 dead NetworkManager[463]: <info>  [1646143451.9836] device (wlan0): state change: unavailable -> unmanaged (reason 'removed', sys-iface-state: 'removed')
Mar 01 19:34:12 dead systemd-networkd[293]: wlan0: Link UP
Mar 01 19:34:12 dead NetworkManager[463]: <info>  [1646143452.0114] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/4)
Mar 01 19:34:12 dead NetworkManager[463]: <info>  [1646143452.0177] device (wlan0): new IWD device state is disconnected
Mar 01 19:34:12 dead NetworkManager[463]: <info>  [1646143452.0215] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Mar 01 19:34:12 dead NetworkManager[463]: <info>  [1646143452.0247] device (wlan0): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Mar 01 19:37:37 dead dbus-daemon[462]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-org.freedesktop.home1.service' requested by ':1.35' (uid=0 pid=1382 comm="sudo iw dev wlan0 scan ")
Mar 01 19:37:37 dead sudo[1382]:     dead : TTY=pts/0 ; PWD=/home/dead ; USER=root ; COMMAND=/usr/bin/iw dev wlan0 scan

Any idea how to fix this?

Offline

#2 2022-03-01 15:05:51

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: nmcli shows no networks even when the device is there.

Why is the device called wlan0? Do you have iwd installed/running?

Online

#3 2022-03-01 15:10:53

dead101
Member
Registered: 2021-12-07
Posts: 21

Re: nmcli shows no networks even when the device is there.

Scimmia wrote:

Why is the device called wlan0? Do you have iwd installed/running?

yeah I have iwd installed

~   ❯ pacman -Qi iwd                                                     20:40:02
Name            : iwd
Version         : 1.25-1
Description     : Internet Wireless Daemon
Architecture    : x86_64
URL             : [url]https://git.kernel.org/cgit/network/wireless/iwd.git/[/url]
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : glibc  readline  libreadline.so=8-64  ell
Optional Deps   : None
Required By     : None
Optional For    : networkmanager
Conflicts With  : None
Replaces        : None
Installed Size  : 1909.87 KiB
Packager        : Andreas Radke <andyrtr@archlinux.org>
Build Date      : Fri Feb 25 12:16:23 2022
Install Date    : Tue Mar 1 19:29:05 2022
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : Signature

Offline

#4 2022-03-01 15:20:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,041

Re: nmcli shows no networks even when the device is there.

journalctl -xb | grep wlan

sudo journalctl -b | curl -F 'f:1=<-' ix.io

But you've *at least* systemd-networkd and NetworkManager enabled, possibly iwd and you're also trying iw scan…

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Offline

#5 2022-03-01 15:44:56

dead101
Member
Registered: 2021-12-07
Posts: 21

Re: nmcli shows no networks even when the device is there.

~   ❯ sudo journalctl -b | curl -F 'f:1=<-' ix.io                        20:40:21
[sudo] password for dead: 
http://ix.io/3R5J
~ > find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
find: ‘test’: No such file or directory

But you've *at least* systemd-networkd and NetworkManager enabled, possibly iwd and you're also trying iw scan…

Yes I have both NetworkManager and iwd running.

Last edited by dead101 (2022-03-01 15:46:43)

Offline

#6 2022-03-01 15:52:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,041

Re: nmcli shows no networks even when the device is there.

find: ‘test’: No such file or directory

"test" is part of the coreutils package which is required by the kernels and util-linux and many more?
=> What kind of distribution do you run?

Either way, you're running too many services for sure.
If you want  to use iwd as NM backend, see https://wiki.archlinux.org/title/Networ … Fi_backend

Offline

#7 2022-03-01 16:01:44

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: nmcli shows no networks even when the device is there.

dead101 wrote:
~   ❯ sudo journalctl -b | curl -F 'f:1=<-' ix.io                        20:40:21
[sudo] password for dead: 
http://ix.io/3R5J
~ > find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
find: ‘test’: No such file or directory

But you've *at least* systemd-networkd and NetworkManager enabled, possibly iwd and you're also trying iw scan…

Yes I have both NetworkManager and iwd running.

That's a problem. You want one, and only one, network management daemon enabled.

I usually just use `tree /etc/systemd/` to check what's enabled. That find command seems popular here, but tree is much simpler IMO.

Online

#8 2022-03-02 09:18:58

dead101
Member
Registered: 2021-12-07
Posts: 21

Re: nmcli shows no networks even when the device is there.

seth wrote:

If you want  to use iwd as NM backend

I'm using iwd as backend

~   ❯ bat /etc/NetworkManager/conf.d/wifi_backend.conf                                                                                                        14:44:11
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/NetworkManager/conf.d/wifi_backend.conf
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [device]
   2   │ wifi.backend=iwd
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

And last night I slept without fixing this, and for my surprise it's working now. I don't know what had happened.

PS: Thank you all guys. I love using Arch and it's community too.

Offline

#9 2022-03-02 14:00:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,041

Re: nmcli shows no networks even when the device is there.

https://en.wikipedia.org/wiki/Race_condition

seth wrote:

But you've *at least* systemd-networkd and NetworkManager enabled, possibly iwd and you're also trying iw scan…

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Offline

#10 2022-03-07 15:18:32

RaZorr
Member
Registered: 2021-12-02
Posts: 42

Re: nmcli shows no networks even when the device is there.

Scimmia wrote:

That's a problem. You want one, and only one, network management daemon enabled.

Sorry for an off-topic question but I didn't understand this. I am using NM with iwd as the backend. I have both of their service files enabled. But there has never been a problem. Is that safe?

Offline

#11 2022-03-07 15:31:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,041

Re: nmcli shows no networks even when the device is there.

It's safe in that your system will not explode and burn to ashes, but it's not safe in that you're provoking a race condition. Whether that has any consequences is not deterministic - the nature of a race condition.
Also things can go south very quickly if NM decides it needs to start iwd w/ a certain configuration/parameters and then blindly relies on that, but iwd is actually running w/ the configuration read by the iwd.service.

The recommendation is to not activate mutliple services because they'll compete for the NIC - in the case of activating iwd and also having NM run iwd it's not as certain to cause problems, but
1. it's not  required at all
2. nothing good will come from it
So don't.

Offline

#12 2022-03-07 15:32:38

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: nmcli shows no networks even when the device is there.

I haven't use NM's IWD backend, but in general, you would want NM to start the wireless daemon instead of running it standalone with systemd.

My statement was a bit broad, though. I should say you only want one enabled that's going to manage any given interface. You can, for instance, have systemd-networkd configured to only manage a wired interface and still use IWD for a wireless one.

Online

#13 2022-03-07 17:02:20

RaZorr
Member
Registered: 2021-12-02
Posts: 42

Re: nmcli shows no networks even when the device is there.

Thanks for the information from both of you. I will add a small note on this iwd wiki page. In that page it mentions to start/enable iwd.service to use iwctl. Now that I read both your posts it's more clear to me. So, something like :

Optionally, start/enable iwd.service so it can be controlled using the iwctl command.

or

Start/enable iwd.service so it can be controlled using the iwctl command (may not be necessary if you are using [[Network_configuration#Network_managers]]).

Offline

#14 2022-03-07 17:27:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,292

Re: nmcli shows no networks even when the device is there.

I'd take the second, but potentially change that link directly to the relevant NetworkManager config section in the wiki, as this kind of usage is only implemented by it in that form afaik

Offline

#15 2022-03-07 17:43:11

RaZorr
Member
Registered: 2021-12-02
Posts: 42

Re: nmcli shows no networks even when the device is there.

V1del I am a bit confused by your comment. Are you referring to NetworkManager ? I was referring to Network_configuration#Network_managers as ConnMan also works with iwd.

Offline

Board footer

Powered by FluxBB