Results 1 to 10 of 10
Hello Linux network friends,
I am currently having a problem in switching wireless network (ap) manually using the following command:
--$sudo iwconfig ra0 essid "network name"
Although there is no ...
- 11-12-2009 #1Just Joined!
- Join Date
- Nov 2009
- Posts
- 6
sudo iwconfig ra0 essid "xx" does not work
Hello Linux network friends,
I am currently having a problem in switching wireless network (ap) manually using the following command:
--$sudo iwconfig ra0 essid "network name"
Although there is no error in executing this command and the LED on the adapter blinks for a few times, the network (ap -- access point) hasn't change. My linux distribution is Ubuntu 8.10, linux 2.6.7-27-generic. The wireless adapter is WUSB600N USB stick (Ralink's RT2870 chipset). All the networks do not require key (encryption key: off). Please help.
Regards,
George
- 11-12-2009 #2
Does any thing in your iwconfig output change before and after setting the ESSID ?
Men occasionally stumble over the truth,
but most of them pick themselves up
and hurry off as if nothing had happened.
Winston Churchill
... then the Unix-Gods created "man" ...
- 11-12-2009 #3
You're changing the essid, but not leasing an ip address. (I am assuming you're using DHCP.)
After iwconfig... doCode:sudo dhclient ra0
- 11-12-2009 #4Just Joined!
- Join Date
- Nov 2009
- Posts
- 6
Thanks for your reply. There is little change before and after setting the ESSID. I have also tried sudo dhclient ra0 (should get clean IP, etc.) but it seems no effect. Here are something else I found:
1. ESSID can be changed easily through NetworkManager without any problem.
2. sudo iwconfig ra0 essid "network name" does not work only when:
(1) Swtiching from a network with a key (perhaps strong signal/noise ratio) to a non-key network (weaker signal/noise ratio)
(2) Command "sudo iwlist ra0 scan" must see the network (ap) or it wouldn't work -- even though NetworkManager could see it.
In summary, without knowing any key, "sudo iwconfig ra0 essid ..." only works when switching between two non-key networks, which must be seen by "iwlist ra0 scan" command. Is this true? I'm wondering how NetworkManager could handle the switching without any problem. I wish I could see the source code of the NetworkManager.
George
- 11-12-2009 #5You can. ftp.gnome.orgI wish I could see the source code of the NetworkManager.
I wonder if the networkmanager daemon somehow intereferes with setting the interface configuration via iwconfig? Have you tried stopping networkmanager first?
Code:sudo /etc/init.d/NetworkManager stop
- 11-12-2009 #6Just Joined!
- Join Date
- Nov 2009
- Posts
- 6
reed9,
Thanks for your reply. Stopping the NetworkManager is good suggestion. I just tried and didn't notice any significant change. I guess I have no choice but studying NetworkManager's source code.
Eventually I would have to do scanning and switching among wireless networks programmatically. It appears I have to do this through wlan extension (WE) APIs -- ioctl system call, etc. Do you have any suggestion (books and web links)?Thanks.
George
- 11-12-2009 #7
Programming and development are outside my areas of knowledge, I'm afraid. I'm just a schlub who likes linux.

You might find more info from the wireless_tools project site.
Wireless Tools for Linux
- 11-12-2009 #8Just Joined!
- Join Date
- Nov 2009
- Posts
- 6
reed9,
Thanks for providing the web link.
One correction: when I did "sudo /etc/init.d/NetworkManager stop" again, I noticed the entire wireless network seems being shut down. The LED on the adapter dies too. Command such as "iwlist ra0 scan" doesn't work anymore.
George
- 11-12-2009 #9
Which driver are you using? rt2870usb? I know that one is fairly new and experimental, which might be part of the problem.
After you stop networkmanager, what is the output ofTryCode:lsmod dmesg | grep ra0 dmesg | grep rt2870
and then scan (assuming no error message).Code:sudo ifconfig ra0 up
I don't use networkmanager anymore, but when I did, I never had an issue with the interface going down when networkmanager stopped.Last edited by reed9; 11-13-2009 at 12:56 AM.
- 11-12-2009 #10Just Joined!
- Join Date
- Nov 2009
- Posts
- 6
reed9,
Thanks for your comments. The usb driver is:2008_0925_RT2870_Linux_STA_v1.4.0.0.tar.bz2. Here are the responses to your commands:
-------------------
lsmod |grep rt
..
rt2870sta 512340 1
usbcore 148848 6 rt2870sta,rt73,usbhid,..
-------------------
dmesg|grep ra0
..
..I/F(ra0) ... Invalid key length (lots of this)
..rtusb_disconnect: unregister_netdev(), dev->name=ra0!
..ra0: no IPv6 routers present
..
-------------------
dmesg|grep rt28
(nothing)
Then I tried the following:
sudo ifconfig ra0 up
sudo dhclient ra0
This brings back the network connection, etc. and it seems "sudo iwconfig ra0 essid ..." works more consistently. Thanks a lot.
George


Reply With Quote
