I would bet that it is kwallet related, but not sure...
I very much doubt it. Kwallet is automatically unlocked at login in stable and it still doesn't autoconnect. Also if you on first boot set an empty password, it would be automatically unlocked on subsequent boots. This has always been the case and it has never autoconnected. I have no clue why this is happening.
I also have this issue and I also suspect it's related to kwallet. (but @PureTryOut's anecdote is good evidence it's not, I suppose) If I manually go to WiFi to select a network it brings up the wallet popup first, and after unlocking the wallet it connects to the WiFi right away without me having to select it again or anything.
I also recently tested ethernet via a USB-to-ethernet adapter plugged into a USB-C OTG adapter when I was having issues preventing me from opening settings or any other apps to get on WiFi (now fixed), and upon plugging in the ethernet on a fresh boot, I noticed I got a wallet popup. I believe to even get ethernet working I had to unlock the wallet, but I can't be sure.
Is there a way to make the wallet unlock automatically in edge? I think the fact that I'm already using FDE could excuse having my wallet unlock automatically.
edit: just unlocked my PinePhone and it's not on WiFi. I have a popup from Network Management dated the 14th, saying "Wireless Interface (wlan0) The WiFi network could not be found". I don't use my PinePhone much currently, so I can't recall if I've unlocked my wallet and previously connected to WiFi on this boot. I just noticed I couldn't connect with ssh just now when I was planning to run some updates. Unsure if this is related to this issue, but thought I'd better note it before I forget.
edit2: I wasn't asked to unlock my wallet when getting back on the WiFi just now. Maybe a power/sleep-related thing caused network issues
edit3: After a reboot and getting on the WiFi again, I realize I'm picking a network to connect to before the wallet popup appears, so my idea that things took care of themselves after unlocking it was misguided. It's just doing what I told it to before the prompt appeared.
I very much doubt it. Kwallet is automatically unlocked at login in stable and it still doesn't autoconnect. Also if you on first boot set an empty password, it would be automatically unlocked on subsequent boots. This has always been the case and it has never autoconnected. I have no clue why this is happening.
I just noticed, we only have patch !2079 (merged) on v21.03, not on edge. However, the process is that patches must go through edge first. So let's put it in edge, too: !2118 (merged)
Is there a way to make the wallet unlock automatically in edge? I think the fact that I'm already using FDE could excuse having my wallet unlock automatically.
This is what !2118 (merged) does. Either wait until it is merged to edge, then upgrade and follow the instructions here to install the kdewallet files from /etc/skel/.local/share/kwalletd/ to ~/.local/share/kwalletd, or grab kdewallet.kwl and .salt from the MR and place them in ~/.local/share/kwalletd.
After updating and following the linked instructions, I no longer need to enter a wallet password, but I do still experience this issue of not auto-connecting to WiFi. I had to re-enter my WiFi password since my wallet was reset, and then I rebooted again just to be sure. I still have to manually select a network. So, it really wasn't the wallet that was the problem then.
I followed those same instructions and it does not work properly. Are you sure that, for example, after a reboot you will be automatically connected to WiFi?
I would say yes, but this does not seem to me like a normal restart. If I even press shutdown, it does the exact same thing. Probably another issue or just a corner case.
As a workaround, you may modify the /etc/NetworkManager/system-connections/MYCONNECTION.nmconnection file and change permissions=user:user:; to permissions=
I applied this change, ran updates, and rebooted. After putting in the FDE passphrase and then unlocking the screen with the pin, I saw it was prompting me for the password for my WiFi. It should already have that saved. I'm not sure if that counts as automatic or not. I didn't have to go into settings, but I wouldn't normally have to enter the WiFi password either.
However, I decided to reboot again before posting this, and on the second reboot it really did connect automatically, even while I was still on my lockscreen. That is very nice. Thank you for the workaround!
Hereby I post my findings which I uncovered in researching this particular problem.
What @dimkard, already found out is that removing the user:user:; trailing after the permissions= flag, makes the Wi-Fi/Mobile Data autoconnect working properly
This made me believe that the problem has to do with a wrong rights/permissions set-up
In my research as to why this didn't happen on Phosh I installed pmOS Phosh image and set-up my Wi-Fi networking.
To my surprise I found out that in Phosh the whole permissions= flag doesn't even appear in the .nmconnection configuration files.
To test if Phosh inhibits the same issue, I added the permissions=user:user:; line in the .nmconnections configuration
After a reboot Phosh now inhibits the same experience and you need manual intervention to connect each time Wi-Fi is lost.
Next thing I tried to figure out why pmOS Plasma Mobile has this particular issue, but the other distributions seem to work properly
For this I installed Arch with Plasma Mobile, and set-up my Wi-Fi connection again.
To my surprise I found out that with this distribution the permissions= line also doesn't appear in the .nmconnections configuration.
So it looks like pmOS does something differently when the connections are set-up, which sets this permissions= line which is causing issues
I think we need to figure out where/why this particular flag gets added to the network configuration, and prevent this from being set, or try and make it work properly with this setting.
But to be honest I think the best solution would be to try to prevent this flag from being set, as other distributions also don't set it.
For this I installed Arch with Plasma Mobile, and set-up my Wi-Fi connection again.
To my surprise I found out that with this distribution the permissions= line also doesn't appear in the .nmconnections configuration.
On Manjaro I setup my Wi-Fi connection from the settings and it did actually have the permissions= line be nonempty. However, the one that was generated from pico-wizard was empty.
the .nmconnection file gets created without the permissions line.
According to this thread, this permissions line is populated if the "GUI option" named "All users may connect" is not enabled. So I guess the plasma network applet is creating the connection without this option set (at least on pmOS).
But to be honest I think the best solution would be to try to prevent this flag from being set, as other distributions also don't set it.
Would be interesting to test on other distributions whether adding the permissions line breaks the autoconnect or not.
I already tested this on other distibutions as well, and the behaviour is the same when the permissions= line gets added and populated with user:user:;
Not only on Plasma Mobile, but also Phosh will get the same behaviour if this flag is set.
So I think we need to figure out on how to set the "All users may connect" option in Plasma Mobile, and try to configure it this way at (compilation maybe with some flag?), or otherwise with a configuration setting during install.
I already tested this on other distibutions as well, and the behaviour is the same when the permissions= line gets added and populated with user:user:;
Did you update the permissions line correctly? You need to make sure the user matches the username you are logged in with, ex: permissions=user:devin:;
It works fine for me on Manjaro, and autoconnects properly.
As stated above, allowing the connection for all users is a workaround. So having this option in the Plasma app would be as well (though it wouldn't hurt to have this possibility, of course).
Could it be that nm simply gets confused if the user name is "user"?
systemd does not fix this. I have edge with systemd and now Plasma Mobile does not connect at all. I made sure that the config file says "permissions=" without any users, and it makes no difference.
Connecting through nmcli works fine.
With OpenRC, the config file workaround fixed the issue. At the moment, I can't get Plasma to connect to WiFi on systemd and have to use nmcli.
For systemd images, renaming the "/usr/lib/systemd/user/kded.service" unit file to "/usr/lib/systemd/user/plasma-kded6.service" does the trick for me, I opened an MR: !6247 (merged)