# Atheros based card goofy on startup

## theMerge

OK... I'm sick of Googling and searching so I'm going to break down and ask for help.  My wireless card (atheros based) acts goofy when net.ath0 starts up during the boot sequence.  I have to restart fairly often due to STUFF I have to do on windows  :Razz: . As soon as the system is started and I get to at terminal, everything acts just as it should.

Here's what I get...

```
 * Starting ath0

 *   Configuring wireless network for ath0

 *     ath0 connected to ESSID "Church" at MY:MA:CA:DD:YY

 *     in managed mode on channel 6 (WEP enabled - open)

 *   Bringing up ath0

 *     dhcp

 *       Running dhcpcd ...                                              [!!]

dhcp timeout...
```

And then there is the sound of breaking glass and sputtering engines as apache, ssh and everything else complains that there is no network connection.

Any advice?

----------

## swimmer

As a workaround I put those two lines in my /etc/conf.d/local.start:

```
/etc/init.d/net.ath0 restart

rc
```

I admit immediately that it's not the most elegant and clean solution but I needed it to work and it works  :Wink: 

I'd like to know anyway what's causing this and how I can resolve it ...

Greetz

swimmer

----------

## theMerge

It's a hack, but I think it will work.  I'll just start the dependencies in local.start and see what happens.

----------

## Suicidal

Try increasing your DHCP timeout in /etc/conf.d/net

----------

## theMerge

 *Suicidal wrote:*   

> Try increasing your DHCP timeout in /etc/conf.d/net

 Also a good call I'll do that.

----------

## swimmer

 *Suicidal wrote:*   

> Try increasing your DHCP timeout in /etc/conf.d/net

 This did not help in my case :-/

----------

## niltonvolpato

I'm having this same problem. And I suppose that your problem is just like mine: the net.ath0 script is trying to connect using a random channel and not the channel of the associated access point.

The problem is weird, because putting:

```

channel_ath0="6" # in my case the correct channel is 6

```

or any other variant does not work!

-- Nilton

----------

## pdr

Same problem - finds ap but connects on channel 11 when the ap is on channel 1.

I just manually log in as root first and do "iwconfig ath0 channel 1" - I may try putting that in localstart..

----------

## Aapzak

It's even worse ... sometimes I says to me it's connecting on channel 7, and when I check with iwlist ath0 chan, it apears to be on an other channel.

This is weird. There is no bug on bugs.gentoo.org either.

----------

## niltonvolpato

There is a bug report i filled. It's here: https://bugs.gentoo.org/show_bug.cgi?id=181545

Please, help by providing information. And any hints so that someone can fix this.

----------

## def_mornahan

I have a similar problem, but all I have to do to fix it is type

```
dhclient ath0
```

in a terminal.  As root, of course.

However, even after I unmerged dhcpcd and made sure that /etc/conf.d/net was using dhclient, the steeyoupid thing won't work during startup.  It sat there for a couple of minutes, pinged an address (I assume the router) and died.

----------

## x1um1n

same problem here, I don't reboot often so its not too annoying, but after upgrading my kernel today its started behaving in an even stranger manner..

after the initial timeout on boot a message pops up saying its been given an IP, but its not the usual IP my router gives me (192.168.2.2 or sumat) but what looks like an actual internet IP..

eg 265.125.42.8 or sumat like that..

but, of course, still no net access..

So I've vowed to solve this once and for all, has anyone else had this newer even stranger behaviour??

I'll post back if I figure anything out..

----------

## krisse

Same problem here. Really annoying.

Putting a ath0 restart in local.start does the trick, but it's, as you've said, a really ugly hack.

Also tried some postup functions, as suggested in other threads; neither "ifconfig ath0 up" or "iwconfig ath0 channel 6" works.

Has anyone gotten this to work -- any other way than the local.start restarting?

----------

## def_mornahan

Is there something wrong with the net.ath0 script?  For s's & g's I pushed 'I' for interactive boot and chose not to start net.lo and net.ath0.  So I ran

```
sudo /etc/init.d/net.lo start

<great>

sudo /etc/init.d/net.ath0 start

<same complete dhclient meltdown, tap your foot for 3 minutes>

```

And I run my usual 

```
sudo dhclient ath0
```

 and it works fine.  I notice there's a brand new wonky error message in the middle of the dhclient output since updating a week or two ago:

```
option_space_encapsulate: option space agent does not exist, but is configured
```

which occurs between "Sending on   Socket/fallback" and "DHCPDISCOVER..." and then again between "DHCPOFFER..." and "DHCPREQUEST..." but at least my internet works.

So what gives?

----------

