Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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

  2. #2
    Linux User dxqcanada's Avatar
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    259
    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" ...

  3. #3
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    You're changing the essid, but not leasing an ip address. (I am assuming you're using DHCP.)

    After iwconfig... do
    Code:
    sudo dhclient ra0

  4. $spacer_open
    $spacer_close
  5. #4
    Just 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

  6. #5
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    I wish I could see the source code of the NetworkManager.
    You can. ftp.gnome.org

    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

  7. #6
    Just 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

  8. #7
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    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

  9. #8
    Just 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

  10. #9
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    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 of
    Code:
    lsmod
    dmesg | grep ra0
    dmesg | grep rt2870
    Try
    Code:
    sudo ifconfig ra0 up
    and then scan (assuming no error message).

    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 01:56 AM.

  11. #10
    Just Joined!
    Join Date
    Nov 2009
    Posts
    6

    Smile

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •