# D-Link DWL-G520 and Wireless frustrations!! [SOLVED]

## sienarot

I've spent the past three days searching countless threads this forum, as well as a few others, trying to find a way to get wireless going on my Gentoo box and I'm all out of ideas.  

First off, the card I have is the D-Link DWL-G520.  As I have come across many times during my search for a solution, I'm well aware that this card isn't exactly a favorite among many Linux wireless users  :Sad:   (If it means anything, the router I'm using is a Linksys WRT954G.)

I've tried so many things, that I can't even remember!  But I'll try listing off what I've done to the best of my recollection for anyone willing to give me a hand.  

First off, I have emerged wireless-tools and linux-wlan-ng.  

I've added the following line in /etc/conf.d/net:

```
iface_ath0="dhcp"
```

I've tried both copying /etc/init.d/net.eth0 as /etc/init.d/net.ath0 as well as using the net.ath0 script provided at www.zippysoft.com (this one).  For some reason when I use the one from zippysoft, it hangs when trying to "Detecting network for ath0".

I've tried entering the settings manually (using "iwconfig ath0 <parameters>") and haven't had any success.  This includes the essid, channel, mode, access point location, rate, and key.

"iwlist ath0 scan" finds the network's ESSID, though the signal level is very weak (about 26/154) and the quality and noise level are at 0.

One thing I do notice is under Encryption key, it indicates ****-****-****-**.  The key I'm using is 64bit 10 digit hexadecimal.  Is that correct?  I've tried entering the key without dashes, with dashes, upper case, and lower case and nadda.  Interestingly enough, once I enter the key, when I "iwlist ath0 scan", it's no longer able to locate anything anymore...

The only way I'm assigned an IP is when I "ifconfig ath0 <IP address>" and when I "dhcpcd ath0", it takes a long time (about a minute) and doesn't seem to do anything.

When I do a dmesg, it indicates that:

```

ath0: no IPv6 routers present

NETDEV WATCHDOG: ath0: transmit timed out

```

That's all I can think of right now.  

Please, if anyone's willing to help me out to get this going I'd greatly appreciate your assistance.  This is very frustration!    :Sad: Last edited by sienarot on Sat Jan 31, 2004 2:42 am; edited 1 time in total

----------

## sienarot

 :Crying or Very sad: 

----------

## jahve

I am also using the DWL-G520 (rev. A1). It works in Gentoo!

 *sienarot wrote:*   

> I've tried so many things, that I can't even remember!  But I'll try listing off what I've done to the best of my recollection for anyone willing to give me a hand.

 

Have you tried my suggested solution in this thread. That solution, however, requires that encryption is turned off. (can be solved later).

 *sienarot wrote:*   

> First off, I have emerged wireless-tools and linux-wlan-ng. 
> 
> 

 

I've managed to get this working with just:

madwifi-driver-0.1_pre20031213-r1 and wireless-tools-26 (both are found in portage).

I suggest you to unmerge linux-wlan-ng, as it is probably not needed for your setup. Instead, be sure you are using the latest madwifi-driver instead.

Also, be sure that you enabled Wireless networking in your kernel, even though hardware-specific drivers are not compiled in.

```
#

# Wireless LAN (non-hamradio)

#

CONFIG_NET_RADIO=y
```

Do not forget to re-emerge the madwifi-drivers after compiling the kernel.

 *sienarot wrote:*   

> For some reason when I use the one from zippysoft, it hangs when trying to "Detecting network for ath0".
> 
> 

 

I have not used the zippysoft scripts, but I'm guessing it is waiting for a connection to an AP. If encryption is not working, then it will never connect, thus "hang".

The easiest way of setting up Wireless networking in Linux (and also Windows) is by keeping it simple (as in insecure) and turn on security measures step by step. I suggest you to turn off WEP and access controls and begin from there. Linux wireless tools should then be able to connect to your AP. (Hint: Follow my guide in link above). Your post suggests that you have set up your AP to use encrytption.

 *sienarot wrote:*   

> "iwlist ath0 scan" finds the network's ESSID, though the signal level is very weak (about 26/154) and the quality and noise level are at 0.

 

Don't worry too much about signal levels, my card indicates link quality:39/94 without connection problems.

 *sienarot wrote:*   

> The only way I'm assigned an IP is when I "ifconfig ath0 <IP address>" and when I "dhcpcd ath0", it takes a long time (about a minute) and doesn't seem to do anything.

 

The gentoo standard dhcp-client timeout is 60 seconds, so that is probably the explaination. No connection means no chance of getting a DHCP lease.

A dmesg gives me the following output, how does this differ for yours?

```
ath_hal: module license 'Proprietary' taints kernel.

ath_hal: 0.9.6.3

wlan: 0.7.2.0 BETA

ath_pci: 0.8.4.0 BETA

ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

ath0: 802.11 address: XX:XX:XX:XX:XX:XX

ath0: Atheros 5212: mem=0xe2000000, irq=10
```

What madwifi-driver (revision) are you using?

Try connecting to your AP without WEP. Does it work in an alternative OS as Windows? If you can get it working in Windows it should work in Linux too.

----------

## sienarot

Thank you for the reply, jahve!  I appreciate this very much.

Just a few things before I try your suggestions:

I'm currently using madwifi-driver-0.1_pre20030802 and wireless-tools-26.

Regarding whether or not my wireless networking is enabled in my kernel, my /etc/kernels/default-config indicates that

```

#

# Wireless LAN (non-hamradio)

#

CONFIG_NET_RADIO=y

...

CONFIG_NET_WIRELESS=y

```

Is this what you were referring to?  If not, which file would I enable this?  If this was already set, is it still necessary to recompile my kernel?

When I dmesg, I get pretty much what yours says, except different version numbers:

```

wlan: 0.7.1.1 BETA (Sam Leffler <sam@errno.com>)

ath_hal: 0.9.5.3 BETA (Sam Leffler <sam@errno.com>)

ath_pci: 0.8.3.2 BETA  (Sam Leffler <sam@errno.com>)

ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

ath0: 802.11 address: XX:XX:XX:XX:XX:XX

ath0: Atheros 5212: mem=0xef000000, irq=5

```

... some lines about the filesystem, followed by:

```

ath0: no IPv6 routers present

NETDEV WATCHDOG: ath0: transmit timed out

NETDEV WATCHDOG: ath0: transmit timed out

NETDEV WATCHDOG: ath0: transmit timed out

NETDEV WATCHDOG: ath0: transmit timed out

NETDEV WATCHDOG: ath0: transmit timed out

inserting floppy driver for 2.4.20-gentoo-r7

```

I'll try your suggestions in the morning.  I am currently using WEP as suspected, so I'll turn it off to see how it works.  And yes, it does work on Windows.  I have it running perfectly fine on 3 machines, one of which Gentoo resides on dual-boot.

I'll let you know how it turns out tomorrow.  Again, I thank you for your help and appreciate the time you're taking to help out a newbie  :Smile: 

----------

## mattman

I too am using a DWL-G520 under Gentoo right now, with 104/128 bit WEP.

I spent a great deal of time getting this set up over the summer, then got stuck using another OS for a few months, but that's neither here nor there...

Right now I'm using madwifi 0.1_pre20031110 (haven't tried the 1213 release yet), wireless-tools-26, and Linux 2.4.23 with wireless extensions (CONFIG_NET_RADIO, CONFIG_NET_WIRELESS) enabled.

To begin with, you should try to get it working manually and worry about the startup stuff later.

I use something to the effect of...

```

modprobe ath_pci

/usr/sbin/iwconfig $DEV essid $ESSID enc on key $KEY

/sbin/ifconfig $DEV up

/sbin/dhcpcd $DEV -h `hostname`

```

where $DEV is ath0 and $ESSID and $KEY are your values, of course.

It can be really frustrating to try and set up the card the first few times and then check the config with iwconfig, because the settings don't seem to be "locked in" before you bring up ath0 with ifconfig.

Oh, and if you were using madwifi 20030802, you'll probably want to upgrade.  That version may have been released before a show-stopping WEP bug was fixed.  I also seem to remember kernel panics or lockups when the module was unloaded with that version.

Hope this is helpful in some way.

----------

## sienarot

WOOOOOOOOOOOOOOO HOOOOOOOOOOOOOOOOOOOO!!!  THANK YOU!!  THANK YOU!! THANK YOU!!

To the both of you that took the time to give me a bit of help, I hold you in the highest regards!!  I finally got it working!  Turns out that it was the old driver that was giving me problems.  I removed, updated it with the lastest one, and it fired up without any problems!

If I seem a little happy, it's because I am!  You two have made my day!   :Very Happy: 

----------

## elzbal

Just to add my two cents, I have had good success with madwifi-driver version 0.1_pre20031213-r1 with my ath chipset (Netgear card, same chipset as yours if I recall correctly), where previous releases (well, at least 20030802 - I never tried 20031110) have been somewhat lacking.

Cheers!

----------

## sienarot

Yes, it was the 0.1_pre20031213-r1 release that worked.  The 20030802 which I had been using earlier was giving me the problems.  I had followed numerous instructions found on this forum and none of them seemed to work.  As soon as I updated the driver to the 20031213 version, it worked almost immediately.  It turns out I was doing the correct procedures, but it was the driver that was preventing me from connecting properly  :Evil or Very Mad: 

----------

## jahve

Seems like the lesson to be learned from this thread is to use madwifi-driver-0.1_pre20031213-r1. Maybe it's time to unmask it in portage?

 *mattman wrote:*   

> To begin with, you should try to get it working manually and worry about the startup stuff later.

 

Well, I'm using hotplug which does a great job loading all relevant kernel modules needed so I forgot that. But you're right, begin with the basics and work your way up to full functionality.

However, if you're are using an USB-mouse, not running hotplug should be a felony.  :Smile: 

I found a quite nice FAQ on the madwifi-driver:

http://www.mattfoster.clara.co.uk/madwifi-faq.htm.

It seems to be a work in progress, however instructions for getting the wireless card up and running are fairly complete. It also has some info on the zippysoft net.ath0-script.

----------

