# Wireless "works" but connection unstable at best

## mattyboy

Hello Gentoo Forums,

My name is Matt and I have a problem...

A have been using Linux as my OS of choice for around 3 years now, but I'd still consider myself a newbie. I've used Ubuntu on my laptop (mostly) and Debian on my simple web/file server, but thought I'd switch to Gentoo as I really want to learn everything I can about Linux, and I love that everything is made from source!

The machine in question is a Lenovo ThinkPad X201, and the wireless card I'm having trouble with is an Intel Ultimate-N 6300. I have the driver installed, and the ucode, and the wireless works, sort of. By this I mean, wlan0 shows up, and upon connecting to an access point, receives an IP address, sometime after establishing a connection it seems to slow down and stop communicating with the router all together. I know the router is functioning properly as every other computer connected to it has no issues, and if I run Ubuntu from live usb it works well on my machine as well... 

I know this is not enough information to really help me, but I'm not sure where to look for debugging information, which logs should I check? The only thing I've tried is running wireshark, which definitely shows some weird results even to me, but it's beyond me why they are occurring.

I'm using gnome, with network-manager to manage wifi at the moment, and have tried wicd as well, same results. 

If anyone can point me in the right direction, possibly which logs to look at, or a wireless debugging tutorial somewhere (I can't seem to find any for anything but getting a non-working card working). 

I would greatly appreciate any help or advice you may have, thank you for your time,

-Matt

----------

## rezrey

Matt,

Welcome to Gentoo

I also have a X201 with intel wireless

I used to have the same problems with random disconnections and slowdowns

but ever since I built-in the wireless driver and not as a module I never had any

issues with it anymore

I also removed the 'rf-kill...or something like that (sorry, I don't remember exactly)'-option...

So it has to be one of these two (or both) which makes the wireless disconnect at random...I think.

I use openbox + wicd.

----------

## mattyboy

Thank you soo much! Very Appreciated, I will try that once I get home and post the results!!

Thanks again!

-Matt

----------

## cach0rr0

i know for a long while my Intel wifi card would be very sketchy under heavy load, and from what I gleaned it was a result of buggy drivers in the Wireless-N code

Fortunately, there was an option for my card to disable 802.11n

I could unload the driver and reload it like so:

```

rmmod iwlagn

modprobe iwlagn 11n_disable=1

```

which had it running purely in B/G mode

not sure if this will work for your card, but you could try it - worst case scenario, it doesnt support the 11n_disable argument, and tells you as much.

now obviously that's a hack and a temporary fix, not a proper solution, if indeed this is what you're experiencing, the proper solution won't come until the upstream kernel/firmware maintainers fix whatever bug.

----------

## mattyboy

 *cach0rr0 wrote:*   

> i know for a long while my Intel wifi card would be very sketchy under heavy load, and from what I gleaned it was a result of buggy drivers in the Wireless-N code
> 
> Fortunately, there was an option for my card to disable 802.11n
> 
> I could unload the driver and reload it like so:
> ...

 

Actually, now that you bring that up, I remember when I was running Ubuntu on the X201, it also didn't support the "n" mode, only b/g! This could definitely be part of the problem too, thank you good Sir! I already recompiled my kernel with built in wireless drivers, but I'm waiting until I get home to post the results because I'm using some random public wifi connection right now...  I will for sure post all my results after I can test everything at home! Thanks guys!

----------

## mattyboy

 *rezrey wrote:*   

> Matt,
> 
> Welcome to Gentoo
> 
> I also have a X201 with intel wireless
> ...

 

rezrey, 

Again thanks for your help! I built the driver into my kernel, but can't adequately test it until I get home, I just have a question about the rf-kill thing... Where is that option? or rather where did you remove it from? Does it have to do with the kernel, or wicd, or something else? I know there's something in the kernel to do with that, are you referring to removing it from the kernel? 

-Matt

----------

## cach0rr0

 *mattyboy wrote:*   

> 
> 
> I already recompiled my kernel with built in wireless drivers, but I'm waiting until I get home to post the results because I'm using some random public wifi connection right now... I will for sure post all my results after I can test everything at home! Thanks guys!
> 
> 

 

Just one thing to point out, modprobe/rmmod are tools for managing modules, so with you now having the driver as a built-in, modprobe/rmmod will not apply to you (this is actually why *I* at least suggest always having wireless stuff built as a module - so you can pass it command-line arguments when you modprobe)

If running it as a built-in yields no positive results, and you want to try doing the rmmod/modprobe steps above, you'll need to reconfigure your kernel to have this as a module, not a built-in

 *mattyboy wrote:*   

> 
> 
> I built the driver into my kernel, but can't adequately test it until I get home, I just have a question about the rf-kill thing... Where is that option? or rather where did you remove it from? Does it have to do with the kernel, or wicd, or something else? I know there's something in the kernel to do with that, are you referring to removing it from the kernel? 
> 
> 

 

RFKILL is a feature in the kernel that enables support for the little button you have on your laptop that can turn the wireless off or on

in order to use this feature, you have to also emerge the rfkill package, which gives you the userspace utilities for managing the rfkill switch

having said that, he may have been making the suggestion to disable RFKILL support in the kernel, and indeed that has been known to be problematic in the past, so it's worth trying at least (although, i think with more recent kernels, since ~2.6.33, this problem has gone away - but dont hold me to that!)

To find it in the kernel, whenever you're in menuconfig, hit the forward slash ( / ) to search, and key in "rfkill" (not case sensitive). It should show you where to find it.

----------

## mattyboy

Hello again, 

I've got a more serious issue now... 

I've tried building the driver into the kernel, and loading it as a module, both seemed to work that day, but I couldn't test it very well. I must have changed something else as well because now when I connect to the internet, either wired or wireless, I cannot open things on my computer... Switching to tty1 shows some errors, mostly just cannot open display. In gnome it shows a little watch for 10-15 seconds and then the "Starting Firefox" bar on the taskbar thing will go away and nothing happends. 

I have no clue what would be causing this, further more, I'm an idiot and accidentally replaced the old kernel with the new one... (ya I know, bad move!!)

Another random thing that happens, when I connect the X201 to the UltraBase (not sure exaclty what it's called but it's the base lenovo makes for the x200 series) which is connected to an external monitor, it does its little switch thing and adds the extended desktop, but the colour scheme is changed... Also this only happens when connected to something, wired or wireless...

I'm totally lost, and will be trying to figure out what happened in the kernel, I'm more interested in learning which logs would be of use so I can better debug what is really going on, because evidently something has gone seriously bonkers... 

Wish me luck!

-Matt

----------

## mattyboy

I have some new information!

So I think I know generally where the problem is happening... first I'll give you some background information:

When I boot, I login in the console and use "startx" to get into gnome

Usually my computer name is "rubberducky" (don't ask) so once logged in, my prompt reads:

"matthew@rubberducky ~ $" 

but I noticed it was being changed by something to:

"matthew@rubberduckyETH ~ $"

which was strange because rubberduckyETH is the hostname I put in my router to set a static ip for the ethernet connection to my machine! So I changed the settings in my router to use just rubberducky as the host name and now I can open firefox and the internet works, and none of the other weird GUI problems happen... the wireless is still slow and making me mad, but at least I can use my computer again!

My question is then, why in the hell was that happening? I'm guessing dhcpcd is to blame?

Why is it changing my computer name? How do I stop this from happening? Does this have anything to do with the slow wireless?

Thanks again,

-Matt

**Edit: The problem with the graphical stuff (nothing opening, and the changing of colours when switching to monitor) I think that all happened because when I connected to the router it changed my hostname, and that broke the x server or something, as if it was trying to connect to the old host name which wasn't there anymore! Anyways... still working on the slow wireless!

----------

