You may ignore what is colored. The solution is given below.
I have got myself in considerable Wi-Fi troubles recently.
I have a Packard Bell iMedia S3720, which multi-boots between Windows 7 64-Bit (default OS), Windows Vista 64-Bit and Debian amd64.
I recently upgraded Debian to Debian 8.8 with the MATE desktop environment, and because of problems with updates wanting to remove said environment, I accidentally made my computer a mix between Debian 8 and 9, so I changed the sources.list server from jessie to stretch to get a complete Debian 9 install instead.
The thing is that I use a Realtek Wi-Fi card (cannot remember its spec', though) which uses the non-free firmware-realtek package to run. Because the package from the testing branch caused random reboots, I installed and locked the stable 0.43 version instead.
This fixed random reboots, but brought the following problem: the Network Manager doesn't detect any Wi-Fi network, but it can connect to a Wi-Fi network using a direct connect. I installed the wireless-tools package and, unsurprisingly, the command
Code: Select all
iwlist wlan0 scan
I guessed it is a problem with the Network Manager, and sadly I cannot find any configuration thing to help.
UPDATED /etc/network/interfaces, see below.
Note: the /etc/network/interfaces.d/ directory is empty.
Plus, the Wi-Fi has random dropdowns; it sometimes stops working randomly, although Debian still thinks it is connected properly. Since these dropdowns don't happen with Windows, I know it is not related to the router. However, it happened on all Linux systems I ever had.
I have read here and there that the Realtek drivers were kinda broken, so I decided to use an Intel Sagemcom XG-760N instead. I installed the firmware-zd1211 package, shut down the system, disconnected the Realtek card and connected the Sagem one, then restarted.
After logging into MATE, the Network Manager immediately prompted me that Wi-Fi networks were available. I tried to connect to my Wi-Fi network, and it failed, stating it got disconnected.
I directly opened a terminal and logged in as root, then used wpa_supplicant to connect. And it works. Then, I used dhclient to get the Internet access.
Yet, I am still stuck with a non-functional Network Manager and an unstable connection. Randomly, wpa_supplicant drops this:
Code: Select all
cardmac: CTRL-EVENT-DISCONNECTED bssid=[MAC] reason=0
wlxcardmac: Trying to associate with [MAC] (SSID='[REDACTED]' freq=2412 MHz)
ioctl[SIOCSIWFREQ]: Device or resource busy
wlxcardmac: Association request to the driver failed
wlxcardmac: Associated with [MAC]
wlxcardmac: WPA: Key negotiation completed with [MAC] [PTK=CCMP GTK=TKIP]
wlxcardmac: CTRL-EVENT-CONNECTED - Connection to [MAC] completed [id=0 id_str=]
Code: Select all
dhclient wlxcardmac
EDIT: Additional changes.
To make everytihng easier, I have edited the /etc/NetworkManager/NetworkManager.conf file:
Code: Select all
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=true
Code: Select all
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
iface wlxcardmac inet dhcp
The main problem is now the scanning capability of the Realtek card in the Network Manager. I have re-updated the Realtek Wi-Fi drivers from the testing branch for now. The bug of random dropdowns is most likely due to the drivers, and it cannot be fixed.
Here is the inxi -n output, as requested by stevepusser.
Code: Select all
Card-2: Realtek RTL8188SU 802.11n WLAN Adapter
IF: null-if-id state: N/A mac: N/A
Code: Select all
wlan0
FIX: Throw NetworkManager out of the window after re-updating the firmware-realtek driver, and installing Wicd instead.
I used these commands to remove the Network Manager.
Code: Select all
apt-mark manual libmbim-glib4 libmbim-proxy libmm-glib0 libnm0 libnma0 libqmi-glib5 libqmi-proxy mobile-broadband-provider-info modemmanager policykit-1-gnome dns-root-data dnsmasq-base iputils-arping libndp0 libteamdctl0 wpasupplicant
aptitude remove network-manager
reboot
Of course, we reboot to apply the changes.
After logging in, MATE displayed a warning related to the screen's display settings being invalid, for some reason. Yet, it retained the settings. I just opened the display settings (where you can set the resolution, framerate, etc.), changed the resolution to 800x600, clicked on Apply for all users and Apply, relogged, then reverted the changes and re-applied everywhere.
Then, I connected using wpa_supplicant. Here is how I did it (using sudo before the commands replaces su) (this may or may not work based on your configuration and router!):
Code: Select all
su
Password: <your_root_user_password>
wpa_passphrase <router_ssid> <router_password> >/etc/wpa.conf
wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa.conf
dhclient wlan0
Code: Select all
aptitude install wicd
reboot
Conclusion: I hereby send NetworkManager to Hell and declare Wicd the winner.
Thank you!