Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Network-Manager Does Not Auto connect  (Read 1705 times)

Offline eriefisher

  • User
  • Posts: 264
[EN] Network-Manager Does Not Auto connect
« on: 2023/03/11, 20:05:40 »
This is a strange behavior I'm seeing in nm-applet. After logging in to the desktop I have to click on the connection to actually connect even though it says I'm connected. I had to put a start up delay on it so I could see it happening after I was logged in. Once logged in I get a notification "Connected To....." but nothing. When I click on the connection the notification says "Disconnected" then it automatically reconnects and states "Connected To ......" again and I'm good until I log out or reboot and the process starts over again.
I've compared setting and configs with another laptop and everything looks identical as far as connection information. Network-Manager is set to "Auto connect" "For all users". The connection works fine albeit slow due to atheros/ath9k other than the described interaction.

Any suggestions/guess'?

FYI this a 2 week old installation and completely up to date.

Edit/update:
Out of curiosity I rebooted and instead of logging into my desktop I logged into a TTY. I sent a ping to Google and it failed. Opened nmtui and activated the connection. Again sent a ping to Google and received a response this time. So it doesn't seem to matter whether I'm in a desktop or not. It must be some setting I'm missing in Network-Manager.

Edit/update #2:
Ok, it seems to be something with iwd. I do not have iwd installed on my other long running siduction laptop. Now I just need to figure out what it's using instead or why I have to interact with NM to connect.
« Last Edit: 2023/03/11, 21:06:09 by eriefisher »

Offline hendrikL

  • Administrator
  • User
  • *****
  • Gravatar
  • Posts: 927
Re: Network-Manager Does Not Auto connect
« Reply #1 on: 2023/03/11, 23:03:47 »
mh. what I have done is to setup my wifi as root via nmcli , to have a connection, even when I am not logged in in graphical mode. I think with iwdctl? (take a short look to our manual) it is working too, also in root!

Offline eriefisher

  • User
  • Posts: 264
Re: Network-Manager Does Not Auto connect
« Reply #2 on: 2023/03/11, 23:29:41 »
I think you mean iwctl and not iwdctl? Looks like I have some reading to do. This is a new one to me. Thanks hendrikL!

Offline eriefisher

  • User
  • Posts: 264
Re: Network-Manager Does Not Auto connect
« Reply #3 on: 2023/03/12, 01:12:20 »
Ok, seems to be working automagically now. It looks like all three were running, NM, wpa_supplicant and iwd. I went through the iwd setup as laid out in the manual but before hand looked at the files. Everything looked fine except one line in /etc/iwd/main.conf
Code: [Select]
#NameResolvingService=resolvconfI just uncommented the line and and changed "resolvconf" to "systemd"
Code: [Select]
NameResolvingService=systemdRebooted and I was on line without any interaction from me. Automagically!

Great manual by the way!

Offline hendrikL

  • Administrator
  • User
  • *****
  • Gravatar
  • Posts: 927
Re: Network-Manager Does Not Auto connect
« Reply #4 on: 2023/03/12, 15:20:38 »
I think you mean iwctl and not iwdctl? Looks like I have some reading to do. This is a new one to me. Thanks hendrikL!
Yes, I misspelled it, using my smartphone to answer.
« Last Edit: 2023/03/12, 15:25:04 by hendrikL »

Offline eriefisher

  • User
  • Posts: 264
Re: Network-Manager Does Not Auto connect
« Reply #5 on: 2023/03/12, 15:35:54 »
We'll it seems that didn't work after all. I'll have to try again.

Offline eriefisher

  • User
  • Posts: 264
Re: Network-Manager Does Not Auto connect
« Reply #6 on: 2023/03/12, 19:24:06 »
I have to admit defeat. No matter what I tried I could not connect via wifi automatically with NM+iwd. Did not try a wired connection to eliminate iwd. I switched back to wpa_supplicant and it connects without issue by itself. From a reboot, lid closed and ssh'd into it. I don't get it? Why would iwd require interaction from the user through NM?

My intention for this laptop is to connect it to a TV and hide it so I will need to ssh and/or remote desktop into it. I may connect a wireless keyboard/mouse combo as well at some point. It will act as a media server/NAS etc so auto connecting is imperative. I'll have to dig into iwd more. Especially if wpa_supplicant is going away at some point. 

Offline hendrikL

  • Administrator
  • User
  • *****
  • Gravatar
  • Posts: 927
Re: Network-Manager Does Not Auto connect
« Reply #7 on: 2023/03/12, 19:47:05 »
well I can't tell you what is going wrong. At some points I had trouble with iwd, but this is way back in the beginning of switching to iwd. In some cases it is better to use wpa. mostly enterprise setups and some exotic setups.
Also hidden networks can produce trouble, like my wifi setup, bit complex but it works and iwd connects automatically to it. In the beginning I had trouble but not yet anymore. What I do is always to setup my WiFi connection as root, when possible. Second I prefer to use the client-tools over the graphical to set it up. later for fast switching i use the GUI.
But if you use it on a headless system, use the cli-tools. its most more easy than all that blinky shiny gui thingy.

Offline eriefisher

  • User
  • Posts: 264
Re: Network-Manager Does Not Auto connect
« Reply #8 on: 2023/03/12, 20:36:24 »
Thanks for your input hendrikL. I have tried as root as you suggest. I also retried with the help of here
https://wiki.debian.org/NetworkManager/iwd
and here
https://developer-old.gnome.org/NetworkManager/1.31/NetworkManager.conf.html#id-1.2.3.12
But still no joy. Like I said it will connect fine but I have to intervene. It will not auto connect. I guess I'll stick with wpa_supplicant for now. At least it works as I need it to.

Thanks again.

Offline eriefisher

  • User
  • Posts: 264
Re: Network-Manager Does Not Auto connect
« Reply #9 on: 2023/03/13, 14:04:06 »
Purely out of curiosity I compiled and installed iwgtk. I stopped NM and wpa_supplicant and started iwd then called iwgtk. It looks as though it worked fine as I was connected. However, I had no dns resolution. Using a numbered address worked fine. The manual shows in /etc/iwd/main.conf
Code: [Select]
NameResolvingService=systemdbut systemd-resolved is not installed by default, at least with the xserver edition. So, maybe a bug??

Anyhow, I went back to NM and wpa_supplicant for now and removed iwgtk until there is at least a proper .deb available. If anyone wants the files let me know and you won't have to install all the supporting stuff to compile it.