OpenWrt Forum Archive

Topic: K7.09 + wl500g + client mode: dumb iwconfig problems

The content of this topic has been archived on 26 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all.

I've installed kamikaze 7.09 on a WL500g (oldest there is), using the openwrt-brcm-2.4-squashfs.trx image.
This all went smoothly, and now I'm trying to make it work as a wireless client, with my home network.
Later I will try to use it with a WPA network, but for now my home network, which is only WEP encrypted.
The network name is 'NetwerkI' and the if is wl0

I was trying to connect using the iwconfig command. All wireless network including mine are nicely listed by iwlist scan, so that's working. It sees the network.
I was trying things like: iwconfig wl0 mode managed essid NetwerkI
It accepts it, but offcourse this is not enought information, the key has to be given to.
Here is where I lost it. I've read the man page about the enc/key option, but whatever I do it says 'Invalid argument'. The key is a Hex key.
As you can probably see, i'm not that experienced with iwconfig.

Examples:

iwconfig wl0 key s:XXX
Error for wireless request "Set Encode" (8B2A) :
    SET failed on device wl0 ; Invalid argument.
root@OpenWrt:~# iwconfig wl0 key restricted s:XXX
Error for wireless request "Set Encode" (8B2A) :
    SET failed on device wl0 ; Invalid argument.
root@OpenWrt:~# iwconfig wl0 key open s:XXXX
Error for wireless request "Set Encode" (8B2A) :
    SET failed on device wl0 ; Invalid argument.
root@OpenWrt:~# iwconfig wl0 key 0xXXX
Error for wireless request "Set Encode" (8B2A) :
    invalid argument "0xXXX".

I'm assuming I'm the problem, and not the system. What am I doing wrong?

Further information, the iwlist scan data:

          Cell 01 - Address: 00:16:B6:3A:8A:6D
                    ESSID:"NetwerkI"
                    Mode:Master
                    Channel:11
                    Quality:0/0  Signal level:-46 dBm  Noise level:-92 dBm
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s

the iwconfig about my interface:

wl0       IEEE 802.11-DS  ESSID:"NetwerkI"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:16:B6:3A:8A:6D
          Tx-Power:19 dBm
          RTS thr:2347 B   Fragment thr:2346 B
          Encryption key:<too big>
          Link Signal level:-50 dBm  Noise level:-98 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:132  Invalid misc:3   Missed beacon:0

the config file I also tried:

config wifi-device  wl0
        option type     broadcom
        option channel  11
# channel was 5

        # REMOVE THIS LINE TO ENABLE WIFI:
#       option disabled 1

config wifi-iface
        option device   wl0
#       option network  wl-lan
        option mode     sta
        option ssid     NetwerkI
        option encryption "wep"
        option key      XXXX

Thanks in advance!!

Thanks I'll check it out later! Funny thing is I can't reach my AP on my network, not even via a static ARP, so I have to reset it anyway.

One more question, if the connection works, do I have to manually get a DHCP lease or not? I think not, because of the mode managed, but I'll see.

Ok I got it working. I'm using an WRT54G as access point (the 2mb flash version, standard firmware) and it's auth mode is on "Auto", not "shared"
I didn't get the "shared" mode to work, but I didn't really try it actually.

I was going the right way, but when setting the key (10 chars, 64 bit) I just had to do this:

iwconfig wl0 essid networkname key [1] xxxx-xxxx-xx

This just tells it to use key nr 1, and used the right format to set the key. And it worked instantly.
Ok, you have to use udhcpc to get a dhcp lease with DNS and all.
Setting the gateway might be needed (not sure), which can be done with route add default gw gatewayadress

for further information on iwconfig and it's key option:
http://linux.die.net/man/8/iwconfig

(Last edited by Swing on 4 Mar 2008, 11:55)

The discussion might have continued from here.