Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Wi-Fi troubles!

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
Princess Midna
Posts: 5
Joined: 2017-05-23 15:52
Location: Hyrule

[SOLVED] Wi-Fi troubles!

#1 Post by Princess Midna »

Hello.


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
effectively scanned the Wi-Fi networks.
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=]
This obviously means that Debian loses the connection and immediately reconnects successfully. Each time, I have to re-execute

Code: Select all

dhclient wlxcardmac
to connect again.

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
So the Network Manager handles the connections listed in the /etc/network/interfaces. I have also changed this file:

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 Network Manager now attempts to connect at startup, but it still fails. The wpa_supplicant + dhclient method still works with random reconnects.

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
The card's interface name is

Code: Select all

wlan0
.[/color]

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
The first line prevents Aptitude from removing the dependencies, as removing them could make the system unstable (like removing wpasupplicant!). The only packages that should be removed are network-manager and network-manager-gnome.
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
Once connected, I installed wicd, that I used in Lubuntu back then.

Code: Select all

aptitude install wicd

reboot
After reboot, wicd's icon replaced NetworkManager's in the upper taskbar. I could set up and connect to my Wi-Fi router from there, without any issue (although random drops might still be present, since they are likely driver-related).

Conclusion: I hereby send NetworkManager to Hell and declare Wicd the winner.

Thank you!
Last edited by Princess Midna on 2017-05-23 23:51, edited 12 times in total.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Wi-Fi troubles!

#2 Post by stevepusser »

Can you update your pci and usb device databases as sysadmin:

Code: Select all

update-pciids
update-usbids
install inxi, then give the result of

Code: Select all

inxi -N
so we have a better idea of what hardware you have?

It was my impression that the Realtek problems with the 4.9 kernel could be resolved with a simple text file edit as sysadmin...

or maybe it's fixed in a newer kernel, such as the 4.10 or 4.11 Liquorix ones. Those are worth a try.

Hmmm--we're going to face the same issues with the 4.9 kernel and those Realtek drivers when we start developing MX 17, and antiX 17 is already in development. Maybe we can get some automatic fix like we have for the troubled Broadcom situation.
MX Linux packager and developer

User avatar
Princess Midna
Posts: 5
Joined: 2017-05-23 15:52
Location: Hyrule

Re: Wi-Fi troubles!

#3 Post by Princess Midna »

Here is the inxi output (I connected both Wi-Fi card).

Code: Select all

           Card-2: Realtek RTL8188SU 802.11n WLAN Adapter
           IF: null-if-id state: N/A mac: N/A
           Card-3:  Sagem XG-76NA 802.11bg driver: zd1211rw
           IF: wlx[cardmac] state: N/A mac: N/A
I removed the Ethernet card output, yet I notice that it seems that inxi is unable to get the status of the Wi-Fi cards...

NOTE: The Realtek's IF is wlan0, but it did not load since I did not reboot.
EDIT: No change after reboot, yet the Realtek card is wlan0.

Actually, the main problem with the Realtek card is failing to scan for Wi-Fi networks, whilst Sagem's is to connect. Its connection can stay stable for long times or stop working right after connecting. Network Manager manages to connect to the Wi-Fi using the Realtek card but not the Sagemcom one.

This is really weird.

EDIT2: The Realtek's scanning works after the direct connection, but not before.
EDIT3: Actually, the Sagemcom appears to scan Wi-Fi, and when trying to connect to the box, it seems to fail to use the Sagemcom and revert on the Realtek card, so it connects. But still, using two Wi-Fi cards is quite awkward.[/color]

Fixed. Please refer to the main post.
Last edited by Princess Midna on 2017-05-23 23:41, edited 1 time in total.

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 6 times
Been thanked: 16 times

Re: Wi-Fi troubles!

#4 Post by Dai_trying »

You could try this driver No guarantees it will fix it, but I have used it on a freinds machine with a similar card and it stopped the continous dropping of connection (something to do with power settings I think).

User avatar
Princess Midna
Posts: 5
Joined: 2017-05-23 15:52
Location: Hyrule

Re: Wi-Fi troubles!

#5 Post by Princess Midna »

I installed the driver, but it isn't compatible with my card. Thanks for the help anyway!

Fixed. Please refer to the main post.

Post Reply