# wireless (rt2500) timesout on dhcp after update

## flazz

after an 'emerge -uDav world' my wireless does not work anymore, it worked perfectly up until this point.

here is what happens now

```
~ # /etc/init.d/net.ra0 start

 * Starting ra0

 *   Bringing up ra0

 *     dhcp

 *       Running dhcpcd ...

Error, timed out waiting for a valid DHCP server response                 [ !! ]

```

i thought it was my router but my girlfriend's laptop is picking it up perfectly.

----------

## nixnut

Any error messages in dmesg or /var/log/messages?

----------

## flazz

```
Oct 22 16:40:20 canary su[13682]: Successful su for root by franco

Oct 22 16:40:20 canary su[13682]: + pts/6 franco:root

Oct 22 16:40:20 canary su(pam_unix)[13682]: session opened for user root by (uid=1000)

Oct 22 16:40:32 canary rt2500 EEPROM:  1  2  3  4  5  6  7  8  9 10 11 12 13 14  Channel

Oct 22 16:40:32 canary rt2500 EEPROM:  6  6  6  6  6  6  6  6  6  6  6  6  6  6  dBm Maximum

Oct 22 16:40:32 canary dhcpcd[16460]: MAC address = 00:12:17:90:b8:5e

Oct 22 16:42:32 canary dhcpcd[16460]: timed out waiting for a valid DHCP server response

```

----------

## terminou

did you do a module-rebuild populate and module-rebuild rebuild ?

can you check also if you have the correct ESSID ?

----------

## flazz

no, i ended up reverting back to my old kernel, everything worked fine, i'll keep those tips in mind tho. what is the difference between those and a make modules_install and rebooting?

----------

## HotBBQ

I am having the same problem since updating to the 2.6.19.gentoo-r1 kernel sources.  I made sure to rebuild the driver.  Nothing else changed in the configuration.

----------

## aaronbc

I upgraded my kernel to 2.6.19.gentoo-r1 as well and ran module-rebuild populate and module-rebuild rebuild which only rebuilt the rt2500 drivers.  After that I needed to setup the new config file at "/etc/Wireless/RT2500STA/RT2500STA.dat" (haven't looked into why it doesn't use "/etc/config.d/wireless" like it did before).  At this point I was having the same problem as you with dhcpcd so I updated dhcpcd... now I can manually get my wireless going by running "ifconfig ra0 up" and then "dhcpcd ra0" but if I try to use "/etc/init.d/net.ra0 start" it fails to find dhcpcd!  That's where I am currently stuck so if anyone has an idea on how to get my rc script to find dhcpcd don't hesitate to enlighten me.

thx

aaron

----------

## UberLord

 *aaronbc wrote:*   

> That's where I am currently stuck so if anyone has an idea on how to get my rc script to find dhcpcd don't hesitate to enlighten me.

 

The chances are you need to ensure that your net.ra0 is a symlink to net.lo and you've etc-updated net.lo recently.

Otherwise, emerge -1 baselayout and etc-update.

If that still fails, please state baselayout and dhcpcd versions.

----------

## HotBBQ

 *aaronbc wrote:*   

> After that I needed to setup the new config file at "/etc/Wireless/RT2500STA/RT2500STA.dat" (haven't looked into why it doesn't use "/etc/config.d/wireless" like it did before).

 

Previously I would make sure to delete this file every time I built the driver.  Not doing so would prevent me from connecting to the access point.  I notice that the beta4 drivers don't seem to create this file anymore.

Edit: Forgot to add requested version information.

```

[ebuild   R   ] sys-apps/baselayout-1.12.6  USE="unicode -bootstrap -build -static"

[ebuild   R   ] net-misc/dhcpcd-3.0.5
```

----------

## UberLord

dhcpcd-3.0.6 was recently released which *may* fix your problem

rt2500 doesn't create RT2500STA.dat any more as it's confusing to users to be presented with 2 config files for the same thing as /etc/conf.d/net should be used  :Smile: 

----------

## HotBBQ

I updated to the latest dhcpcd with no luck.  Any other suggestions?

----------

## UberLord

Sadly no - I've run all recent 2.6 kernels successfully with the rt2500 driver, and I'm currently on gentoo-sources.2.6.19-r1

----------

## aaronbc

Okay, I've updated my entire system which included an update to the net.lo script and now I'm having the same problem as flazz (dhcp timeout)  I emerged the rt2500-beta4 drivers and it still created the RT2500STA.dat file.  I can still get the connection working if I run "ifconfig ra0 up" and then "dhcpcd ra0" manually.  If I remove the RT2500STA.dat file, I cannot get the connection going at all as it doesn't pull the configuration from /etc/conf.d/wireless.  I noticed that the LED's on my wireless card are not illuminated before the call to dhcpcd when using "/etc/init.d/net.ra0 start" like they are when I connect manually.

----------

## HotBBQ

Could you post your .dat file?  I'm curious as to what one contains.  Also, has anyone tried 2.16.9-r2?

----------

## didumos

I'm seeing this problem too. Things work fine with 2.6.18 but dhcpcd hangs with 2.6.19.1 (vanilla).

 *UberLord wrote:*   

> I've run all recent 2.6 kernels successfully with the rt2500 driver, and I'm currently on gentoo-sources.2.6.19-r1

 

In that case, could you please post an example of the config (/etc/conf.d/net or /etc/conf.d/wireless) that works for you?

----------

## UberLord

```
dns_servers_lo=( "127.0.0.1" )

modules_wlan=( "iwconfig" )

config_UberNET=( "dhcp" )
```

That's my entire conf.d/net on my machine using the rt2500

----------

## didumos

Ah, it doesn't look like you are using any encryption/keys then. This is the sort of config I'm trying to use:

```
config_ra0=( "dhcp" )

channel_ra0="11"

essid_ra0="essid"

dhcpcd_essid="-t 20"

iwconfig_essid=(

  "channel 11"

  "mode managed"

)

iwpriv_essid=(

  "set AuthMode=WPAPSK"

  "set EncrypType=TKIP"

  "set WPAPSK=mykey"

)
```

----------

## Naib

I to get/got that problem  :Sad: 

ra0 would just hang

almost finished re-building my system (other problems) will see if it is ok

----------

## HotBBQ

So this is a WPA/WEP + DHCP issue?    :Rolling Eyes:  I use WPA myself.  Here is my net file.

```

hotbbq@Beast ~ $ cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

modules=( "!iwconfig" )

config_ra0=( "dhcp" )

dhcpcd_ra0="-R -N"

preup () {

        iwconfig ra0 mode managed

        iwconfig ra0 essid "hotbbq"

        iwconfig ra0 rate "54M"

        iwconfig ra0 channel 9

        iwpriv ra0 set AuthMode=WPAPSK

        iwpriv ra0 set EncrypType=TKIP

        iwpriv ra0 set WPAPSK="***********"

        return 0

}

```

----------

## UberLord

Yeah, I encrypt my traffic using openvpn as not all my cards work with WPA (which isn't as secure as openvpn anyway)

I'll see if I can test  rt2500 encryption if I can find my rt2500 pcmcia card to take to work.

----------

## shrtckt

I had the same problems when upgrading to 2.6.19-*. I could not even get a static address to come up. I found that using the  RT2500STA.dat file and not iwconfig was the only way I could get the system to connect properly. I guess it is now of some importance when they say "This file is a binary file and will be read on loading rt2500.o module" (-RT2500STA.dat).  I trashed my entire net configuration, edited the RT2500STA.dat file to my needs, and made a simple net configuration. After reading this post, I changed to dhcp - just to see if mine would work. Yes, dhcp does work for me. Possibly some of my info can help...

/etc/conf.d/net

```

# ra0

##############

modules_ra0=( "!iwconfig" )

#config_ra0=( "192.168.1.101 netmask 255.255.255.0" )

#routes_ra0=( "default gw 192.168.1.1" )

config_ra0=( "dhcp" )

```

/etc/Wireless/RT2500STA/RT2500STA.dat

```
# Copy this file to /etc/Wireless/RT2500STA/RT2500STA.dat

# This file is a binary file and will be read on loading rt2500.o module.

# Use "vi -b RT2500STA.dat" to modify settings according to your need.

[Default]

AdhocOfdm=0

CountryRegion=0

WirelessMode=0

TXBurst=0

TurboRate=0

BGProtection=0

ShortSlot=0

#TxBurst=0

#TxPreamble=2

TxRate=0

PSMode=CAM

SSID=short562_UNIX_network

#NetworkType=Infra

Channel=11

AuthMode=WPAPSK

EncrypType=AES

#DefaultKeyID=1

#Key1=

#Key2=

#Key3=

#Key4=

#WPANONE=abcdefghijklmnopqrstuvwxyz

WPAPSK=XXXXXXXXXXXXXXXX

#RTSThreshold=2312

#FragThreshold=2312

PSMode=CAM

#RFMON=0

#StaWithEtherBridge=0

```

start-up

```
node0 RT2500STA # /etc/init.d/net.ra0 start

 * Starting ra0

 *   Bringing up ra0

 *     dhcp

 *       Running dhcpcd ...                                                                                                                         [ ok ]

 *       ra0 received address 192.168.1.105/24

node0 RT2500STA # ping www.gentoo.org

PING www.gentoo.org (66.219.59.46) 56(84) bytes of data.

64 bytes from kiwi.gentoo.org (66.219.59.46): icmp_seq=1 ttl=48 time=75.0 ms

64 bytes from kiwi.gentoo.org (66.219.59.46): icmp_seq=2 ttl=48 time=68.2 ms

64 bytes from kiwi.gentoo.org (66.219.59.46): icmp_seq=3 ttl=48 time=67.8 ms

--- www.gentoo.org ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2000ms

rtt min/avg/max/mdev = 67.858/70.385/75.039/3.301 ms

```

package/sys info

```
node0 RT2500STA # emerge -av gentoo-sources rt2500 dhcpcd baselayout

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] sys-kernel/gentoo-sources-2.6.19-r2  USE="-build -symlink" 0 kB

[ebuild   R   ] net-wireless/rt2500-1.1.0_beta4  USE="qt3" 0 kB

[ebuild   R   ] net-misc/dhcpcd-3.0.6  0 kB

[ebuild   R   ] sys-apps/baselayout-1.13.0_alpha9-r3  USE="pam unicode -bootstrap -build -static" 0 kB

Total: 4 packages (4 reinstalls), Size of downloads: 0 kB

```

Note: I was using baselayout-1.12.7 when all of this was done (so it should not  matter). 

My system boots and starts the network correctly using the regular net.ra0 rc scripts (dhcp or static). Hope this helps  :Smile: 

----------

## didumos

Cheers shrtckt, that works for me too!   :Very Happy:   I wonder why using the baselayout config method doesn't work under 2.6.19 though...

----------

## shrtckt

Cool!   :Very Happy:    I really have no idea. The alpha version of iwconfig does not work for rt2500 either (if it's any different). I'm assuming the 2.6.19 kernel enables the rt2500 driver to work as designed, and users are forced to use the proper config files instead of overriding with iwconfig?? Possibly  UberLord can give some reasoning?

----------

## UberLord

No idea at the moment as I'm dealing with other things right now.

If I don't do anything about this by say the end of next week or just before crmbo then open a bug as I've probably forgotten!

----------

## Naib

Well just to to say all working here

I did have a period where net.ra0 would not startup and the only way to get an IP address was to do it manually (ifconfig ra0 up;dhcpcd ra0)

but as it stands all is working

I am using ~amd64 packages (soz not in Gentoo to print out exact version) but no problems here

----------

## aaronbc

Yeah, thx shrtckt, got it working on my end as well.

----------

## dr_nailz

I had the same problem but from a different cause.  My link kept dropping out every 10 seconds or so (up for 10s, down for 1s or so).  I am using TKIP instead of AES.  According to the rt2x00 forums there is a problem with TKIP in the latest build of rt2500 (beta-4) that is fixed in CVS.  I downloaded the latest CVS daily build and my wireless started working straight away.

The forums seem to indicate that there are no plans as yet for a beta-5 release, so if you are having this problem (manifesting as DHCP timeouts using TKIP), I suggest you try the latest CVS.

----------

## colvillem

 *HotBBQ wrote:*   

> So this is a WPA/WEP + DHCP issue?    I use WPA myself.  Here is my net file.
> 
> ```
> 
> hotbbq@Beast ~ $ cat /etc/conf.d/net
> ...

   :Laughing:  I have been trying to get this working for several days now but this fixed it for me. thanks.   :Laughing: 

----------

## HotBBQ

I finally got around to setting up the .dat file.  It works like a champ.  Any info on why the 2.6.19 kernel doesn't work the old way?  Here's my config for posterity:

```
cat /etc/Wireless/RT2500STA/RT2500STA.dat

# Copy this file to /etc/Wireless/RT2500STA/RT2500STA.dat

# This file is a binary file and will be read on loading rt2500.o module.

# Use "vi -b RT2500STA.dat" to modify settings according to your need.

[Default]

AuthMode=WPAPSK

Channel=9

EncrypType=TKIP

NetworkType=Infra

PSMode=CAM

SSID=hotbbq

TxRate=0

WirelessMode=0

WPAPSK=***************

```

----------

## ace118

I'm having the same issue under 2.6.19-ck2-r1

I've found that I can manually configure the interface with iwconfig commands, but when the baselayout system (~amd64 version) tries to bring up the interface, it seems to lose the ssid during configuration. I've tried tons of different configurations, they work fine under 2.6.18, but seem to all fail under 2.6.19.

I've tried the preup() method, and that seems to work well enough. 

Does anyone know the ins and outs of the the order baselayout sets up the interface? (which order the commands are executed).

----------

## UberLord

I know it as I wrote it  :Smile: 

However, my rt2500 card in my amd64 running a gentoo-sources-2.6.19 works just peachy.

Infact, the wireless scripts haven't been updated for a looong time now. Well, around 6 months at least.

EDIT: OK, maybe not that long, but the changes are trivial and should not affect anyone

http://sources.gentoo.org/viewcvs.py/baselayout/branches/baselayout-1_12/net-scripts/net/iwconfig.sh?rev=2428&view=log

----------

## ace118

I guess this is some kind of driver issue then. I'll inquire on the rt2500 forums.

----------

## Naib

But I use the rt2500 driver fine so it can't be purely a driver issue

----------

## ace118

I should rather say, its a combination of driver and my specific hardware device

----------

