You are not logged in.

#1 2012-05-12 16:50:26

altbdoor
Member
From: KL, Malaysia
Registered: 2012-04-25
Posts: 128

[SOLVED] iwconfig cannot associate to new AP

hi everyone

contrary to most of arch users (or so from what i see in threads), i do not use wicd nor network-manager to manage my wifi. i have tried both of them, and somehow, someway, they didn't work. i'd probably get to that someday...

so i resort to using the manual method (i like typing lol), which is as described in the wiki.

all is well, when i associate with the first AP. problem arises when i want to change AP. to associate to an AP, i basically type the following commands

iwlist wlan0 scan
iwconfig wlan0 essid <essid> key s:<pass>
dhcpcd wlan0

let's say, for some reason, i want to change to another AP. i'm not sure how i should do this, but i tried multiple methods. all failed.

1. just iwconfig wlan0 essid <new essid> and so on
2. kill off dhcpcd before/after iwconfig wlan0 essid <new essid>

and a check with the iwconfig shows that wlan0 is not associated. essid reads off/any (if i recall correctly). dhcpcd failed. ping failed.

sometimes, i just wait it out, and iwconfig suddenly pops with the new AP. wow.
or in desperate cases, a reboot. then iwconfig is able to associate again.

what's the problem here? anyone know? and, i'm (forced to) using ndiswrapper on my rtl8187se.

thanks in advance to any helpers.

Last edited by altbdoor (2012-05-15 15:29:08)

Offline

#2 2012-05-12 17:12:27

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] iwconfig cannot associate to new AP

the r8187se driver is provided in the stock kernel package - it is in staging, but it is reported to work satisfactorily.

Have you considered using netcfg? Changing networks is simply a matter of changing profiles.

If you insist on doing it manually, I have found that unloading and reloading the driver is sufficient to "reset" it - rebooting is not necessary.

Offline

#3 2012-05-12 17:30:04

altbdoor
Member
From: KL, Malaysia
Registered: 2012-04-25
Posts: 128

Re: [SOLVED] iwconfig cannot associate to new AP

tomk wrote:

the r8187se driver is provided in the stock kernel package - it is in staging, but it is reported to work satisfactorily.

r8187se? rtl8187se is different from r8187se... or so i thought... and yes, i do know that many realtek drivers are in staging.

but i did try with the staging driver. it did list APs, but it can never connect. not even APs with no security.

Realtek

Since kernel 2.6.29 there's a working driver included in the staging line. The module is rtl8187se and should get loaded without intervention. This network adapter is known to be buggy, so it's unlikely that this driver will show significant progress over its current state. Using ndiswrapper in place of the in-kernel module is recommended because of this situation.

excerpt from the arch's wiki on msi wind u100, its not the same laptop as mine, but same driver, rtl8187se.
-----

tomk wrote:

Have you considered using netcfg? Changing networks is simply a matter of changing profiles.

netcfg, probably. you see, the laptop is a home laptop-ish... so my main priority was making it work as it is. since wicd and network-manager failed me, i've been really doubtful on trying new wireless configs (only on this laptop! because i know the laptop is problematic...)

hence, lately i've been working on a bash script to get this work. bunch of if elses... read... for loops... you get the idea...
-----

tomk wrote:

If you insist on doing it manually, I have found that unloading and reloading the driver is sufficient to "reset" it - rebooting is not necessary.

sorry to ask, but how do you unload/reload driver? does it involve ifconfig?

Offline

#4 2012-05-12 22:25:14

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] iwconfig cannot associate to new AP

No, modprobe.

Offline

#5 2012-05-12 22:47:19

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,281

Re: [SOLVED] iwconfig cannot associate to new AP

Still should not have to unload a module with modprobe. To change to another AP manual method wiki theory stipulates that you bring down the interface

ip link set down

and start again at wiki step 0 then.
Reading about your scripts, you might want to look /etc/network.d/examples as tomk suggested perhaps.

Offline

#6 2012-05-13 02:57:02

altbdoor
Member
From: KL, Malaysia
Registered: 2012-04-25
Posts: 128

Re: [SOLVED] iwconfig cannot associate to new AP

tomk wrote:

No, modprobe.

isn't modprobe a little harsh...? although i do admit, its one of the solutions... anything simpler though?
-----

Strike0 wrote:

Still should not have to unload a module with modprobe. To change to another AP manual method wiki theory stipulates that you bring down the interface

ip link set down

and start again at wiki step 0 then.
Reading about your scripts, you might want to look /etc/network.d/examples as tomk suggested perhaps.

i have tried ip link set wlan0 down. a check with ip link did show that its DOWN. then i moved on to set it up again, and again, confirmed its UP. follow the usual steps to associate, and still, didn't work. iwconfig returns essid: off/any

thanks for the tip on example network scripts. i'll check them out

EDIT: funny. there is no /etc/network.d/ directory in my arch

Last edited by altbdoor (2012-05-13 05:44:05)

Offline

#7 2012-05-13 07:58:36

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] iwconfig cannot associate to new AP

... because you haven't installed netcfg. smile

Offline

#8 2012-05-13 09:53:33

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,281

Re: [SOLVED] iwconfig cannot associate to new AP

After the ip link set down / up, does a scan for wifis work?

Offline

#9 2012-05-13 14:25:32

altbdoor
Member
From: KL, Malaysia
Registered: 2012-04-25
Posts: 128

Re: [SOLVED] iwconfig cannot associate to new AP

tomk wrote:

... because you haven't installed netcfg. smile

aha. thanks for the tip
-----

Strike0 wrote:

After the ip link set down / up, does a scan for wifis work?

just tried that out... this is funny... iwlist wlan0 scan still returns results!

EDIT: i mean, even after i typed out ip link set wlan0 down, wifi scan still produce results

Last edited by altbdoor (2012-05-13 14:30:20)

Offline

#10 2012-05-13 16:39:07

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,281

Re: [SOLVED] iwconfig cannot associate to new AP

altbdoor wrote:

EDIT: i mean, even after i typed out ip link set wlan0 down, wifi scan still produce results

Oh that's good, because that is just what the people programming it wanted to achieve: Give you a list of of wifi's that you could connect to, e.g. by activating a new ip link set up & iwconfig wlan0 essid "..." ;-)

You got mixed up: ip link set does not de-/activate an interface, but a connection.

edit: inserted -too quick myself

Last edited by Strike0 (2012-05-13 21:15:39)

Offline

#11 2012-05-14 05:44:46

altbdoor
Member
From: KL, Malaysia
Registered: 2012-04-25
Posts: 128

Re: [SOLVED] iwconfig cannot associate to new AP

Strike0 wrote:

Oh that's good, because that is just what the people programming it wanted to achieve: Give you a list of of wifi's that you could connect to, e.g. by activating a new ip link set up & iwconfig wlan0 essid "..." ;-)

You got mixed up: ip link set does not de-/activate an interface, but a connection.

edit: inserted -too quick myself

OH i see! i thought it totally kills the interface. was surprised tongue
so, every time i want to change a connection, i need to set the link down, then bring it up again, then continue to iwconfig wlan0 essid "..."?

Offline

#12 2012-05-14 16:50:53

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,281

Re: [SOLVED] iwconfig cannot associate to new AP

altbdoor wrote:

so, every time i want to change a connection, i need to set the link down, then bring it up again, then continue to iwconfig wlan0 essid "..."?

ip link set up/down is not a necessary step for all drivers (see the wireless wiki also). Question is if using it solves your initial problem?

Offline

#13 2012-05-14 17:26:13

altbdoor
Member
From: KL, Malaysia
Registered: 2012-04-25
Posts: 128

Re: [SOLVED] iwconfig cannot associate to new AP

Strike0 wrote:

ip link set up/down is not a necessary step for all drivers (see the wireless wiki also). Question is if using it solves your initial problem?

i haven't had the time to test it yet, but i believe it should work with ip link and all. worst case scenario, i'll resort to modprobe, but for the moment, i'll mark this thread as solved. i'll update this thread when i do test the system.

thanks for all the help big_smile

Offline

#14 2012-05-15 15:42:05

altbdoor
Member
From: KL, Malaysia
Registered: 2012-04-25
Posts: 128

Re: [SOLVED] iwconfig cannot associate to new AP

hi guys and to anyone who's monitoring this thread.

for the moment, the wireless is working well. seems like it doesn't happen as often as it did. maybe because of recent updates, i'm not sure. however, when it happens, not even modprobe and ip link up/down can fix this. reboot seems to be the only solution for me.

since it doesn't occur all the time now, i consider this problem solved. as for solution, please try Strike0's solution of ip link up/down. if that fails, try tomk's suggestion with modprobe, although i admit, its a bit harsh. hope this helps.

thank you.

Offline

Board footer

Powered by FluxBB