3

I am USING Ubuntu 20.04 Fresh install and the only significant change I have made (except installing the drivers for the said adapter) is to disable "Wake on X" settings on BIOS since it caused the PC to reboot instead of shutting down. But even without this, 9 out of 10 cases, I do not see the wireless icon when I turn on the PC unless I take it out and plug it back in. Is there a solution to this, where I can keep it plugged in at the back of the case and not bother at all?

Here is the Network manager log:

Mär 05 15:48:49 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955729.4703] agent-manager: agent[1a2f8924292a42c2,:1.80/org.gnome.Shell.NetworkAgent/1000]: agent registered
Mär 05 15:49:34 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955774.7539] device (wlan0): driver supports Access Point (AP) mode
Mär 05 15:49:34 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955774.7546] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
Mär 05 15:49:34 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955774.7605] supplicant: wpa_supplicant running
Mär 05 15:49:34 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955774.7761] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.2/ieee80211/phy0/rfkill>
Mär 05 15:49:34 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955774.7834] device (wlan0): interface index 3 renamed iface from 'wlan0' to 'wlx1cbfce65cf9d'
Mär 05 15:49:34 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955774.7896] device (wlx1cbfce65cf9d): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.4636] manager: (D4:0B:1A:E6:22:9C): new Bluetooth device (/org/freedesktop/NetworkManager/Devices/4)
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.4642] device (D4:0B:1A:E6:22:9C): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.4679] device (D4:0B:1A:E6:22:9C): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.5155] sup-iface[0x5638a019a110,wlx1cbfce65cf9d]: supports 5 scan SSIDs
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.5159] device (wlx1cbfce65cf9d): supplicant interface state: starting -> ready
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.5160] Wi-Fi P2P device controlled by interface wlx1cbfce65cf9d created
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.5162] manager: (p2p-dev-wlx1cbfce65cf9d): new 802.11 Wi-Fi P2P device (/org/freedesktop/NetworkManager/Devices/5)
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.5165] device (p2p-dev-wlx1cbfce65cf9d): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'externa>
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.5169] device (p2p-dev-wlx1cbfce65cf9d): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed>
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955775.5171] device (wlx1cbfce65cf9d): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: >
Mär 05 15:49:35 ifrat-ThinkCentre-M83 NetworkManager[603]: <warn>  [1614955775.5234] sup-iface: failed to cancel p2p connect: P2P cancel failed
Mär 05 15:49:39 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955779.4255] policy: auto-activating connection 'WLAN-07B646' (e1122307-80a2-41a8-b243-3cbd6bcbadab)
Mär 05 15:49:39 ifrat-ThinkCentre-M83 NetworkManager[603]: <info>  [1614955779.4263] device (wlx1cbfce65cf9d): Activation: starting connection 'WLAN-07B646' (e1122307-80a2-41a8-b243-3cbd6bcbadab)

In case it is relevant, these are the commands I have executed through terminal to get the dongle to be recognized by Ubuntu in the first place:

sudo apt update
sudo apt install build-essential git dkms
git clone https://github.com/brektrou/rtl8821CU.git
cd rtl8821CU
chmod +x dkms-install.sh
sudo ./dkms-install.sh
sudo modprobe 8821cu 
6
  • Look at the logs! sudo journalctl -b 0 -u NetworkManager. – waltinator Mar 5 at 14:05
  • I posted the log to the main post, does it reveal any clues? – EvilRaceHorse Mar 5 at 14:53
  • Out of curiosity, if you restart Network Manager after a reboot, will the wireless device be picked up? I wonder if this has something to do with a supplicant function ... 🤔 – user1091774 Mar 10 at 4:14
  • Similar to this question (askubuntu.com/questions/1083505/…) you can create such a script for the module iwlwifi. I can't test it, but it might work. – MaestroGlanz Mar 10 at 17:21
  • Did you have a chance of testing any of what was posted? – sancho.s ReinstateMonicaCellio Mar 16 at 14:52
1
+250

Information

It is detected but renamed:

device (wlan0): interface index 3 renamed iface from 'wlan0' to 'wlx1cbfce65cf9d'

For the reasons and consequences of this behavior, please read Predictable Network Interface Names.

Solution

Edit /etc/default/grub like so:

sudo nano /etc/default/grub

Then, add the option net.ifnames=0 to GRUB_CMDLINE_LINUX_DEFAULT like so:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash net.ifnames=0"

Then, save and close the file by pressing Ctrl+x then prss y then press Enter.

After that, update GRUB like so:

sudo update-grub

Finally, reboot your system.

1

I suggest you post additional information, namely:

  1. Brand/model of your system. I guess it is a ThinkCentre M83, but just in case.

  2. Brand/model of your WiFi adapter. I will assume it is a USB adapter.

  3. Where are you connecting the adapter? (front, back, hub, etc.)

  4. The output of the diagnostic commands below (they are long, perhaps you can post short outputs here, and longer outputs in one or two zip files linked here), under two circumstances:

    4.1. WiFi not working (some commands would be meaningless).

    4.2. WiFi working.

Possible causes of / workarounds/solutions to your problem are as below. Further action depends on your feedback.


Diagnostic commands

$ lsusb
$ udevadm info /dev/bus/usb/{BUS_NUMBER}/{DEVICE_NUMBER}
$ ifconfig
$ udevadm info /sys/class/net/{name of interface}
$ ip link
$ iw list
$ rfkill list
$ ifconfig
$ iwconfig
$ sudo systemctl status network-manager.service 
$ ls -1 /etc/systemd/system/multi-user.target.wants
$ lshw -C network

You may need to sudo apt-get install some packages (udev, iw, rfkill).


Possible causes of / workarounds/solutions to your problem

  1. The port you are connecting to. Try a different port.

  2. Automatically restart the network (service, adapter, etc.) if needed. That is, right after boot, or from cron every few minutes, e.g.

    2.1. To work with the adapter you could use this script.

    if ! ping -I wlan0 -c 1 -Q 1 google.com ; then
        ifconfig wlan0 down
        sleep 5
        ifconfig wlan0 up
    fi
    sleep 5
    

    Replace wlan0 with your interface name.

    2.2. To work with the service you could use this script.

    if ifconfig eth0 | grep -q "inet "; then
        # echo "all ok!"
    else
        systemctl restart network-manager.service 
    fi
    sleep 5
    

    2.3. To work with the driver you could use this script.

    modprobe -r <driver name>
    modprobe <driver name>
    

    Get the name with

    $ lspci -nnk | grep -i -A 4 network
    

    You can check further info with

    $ lsmod | grep <driver>
    $ modinfo <driver> 
    

    Try if any/all of the three work to restore network when it is not working. If so, we could add them for automatic execution.

Depending on what you post, I could work alternative approaches.


Related

  1. https://askubuntu.com/a/823908/226614
1
  • Thank you very much for your suggestions, I collected the logs for the commands under both circumstances (when adapter is not working, also after it is re-plugged and working). Regarding your questions: 1. It is ThinkCentre M83 as you noticed 2. It was an amazon brand which said (BT+AC600), it looks very much like this one: askubuntu.com/questions/1301416/… The drivers that got it recognized by Ubuntu is on the main post. 3. All hubs, back or front behave the same 4. easyupload.io/m/fyz2h5 – EvilRaceHorse Mar 18 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.