# Can't find access points after re-merging [solved]

## bps7j

I decided to play around and see if I could make my system leaner and faster.  So I unmerged all my gui apps, everything not system-related, and then went through the installed packages one at a time, ran emerge -pv on it, and looked at its USE flags.  My idea was to see if I could reduce dependencies on things, for instance, stupid stuff like alsa wanting cups and X.  (that's just an example).  I re-merged things with fewer USE flags.  At some point my wireless network stopped working.  I'm not sure when, because I'm not really using this computer, just playing with it.  So I didn't use it to access the network (portage already had the source code it needed).  Now I can't get the wireless network up no matter what I do.  Worst of all, I'm not done "optimizing" my system yet  :Very Happy: 

Details:

My access point "was" secured with WEP and no broadcast, but now I've opened it up without security and broadcasting the SSID.  Still can't get anything.  This Windows laptop works fine by the way.  It's not the AP.

My card is an aironet.  The modules are built in the kernel (I didn't recompile the kernel).  I am fairly sure it's not a hardware issue or driver issue.  Here's the output of lsmod | grep airo:

```

airo_cs   5156 1

airo     68608 1 airo_cs

pcmcia    21224 5 airo_cs

pcmcia_core   43128 airo_cs,pcmcia,yenta_socket,rsrc_nonstatic
```

Sorry it's sloppy, I'm hand-typing it by looking at my other monitor...

I've been using wireless-tools.  Here's my /etc/conf.d/net:

```
iface_eth0="dhcp"
```

Here's my /etc/conf.d/wireless:

```
associate_order_eth0="forcepreferred"

preferred_aps=( "linksys" )
```

ifconfig just shows lo.  iwconfig shows lo and eth0 and wifi0.  They appear to be duplicates (where did wifi0 come from anyway?).  eth0 has a bunch of output that I won't type here, but suffice to say the ESSID is "", the Nickname is "linksys" and the Access Point is a bunch of FF:FF:FF.

Here's what happens when I try to start eth0:

```
/etc/init.d/net.eth0 start

* Caching service dependencies                    [ ok ]

* Starting eth0

*   Configurig wireless network for eth0

*   eth0 does not support scanning

*     no access points found

*   Trying to force preferred in case they are hidden

*   Failed to associate with any preferred access points on eth0

*   Couldn't find any access points on eth0

*   Failed to configure wireless for eth0                     [ !! ]
```

I've also tried setting NO preferred aps at all, and then the only line in /etc/conf.d/wireless is essid_eth0="any".  Here's what happens now when I run /etc/init.d/net.eth0 start:

```
* Starting eth0

* Configuring wireless network for eth0

* Failed to configure wireless for eth0
```

OK, so I'm undaunted and I'm gonna try to do it myself...

```
# ifconfig eth0 up

# ifconfig

             .... it shows me some generic output for eth0, without an IP address or anything...

# iwconfig eth0 essid linksys

# iwconfig

            ..... it shows me that the ESSID is set correctly .....

# dhcpcd eth0
```

Dhcpd hangs and hangs and eventually gives up and then ifconfig shows that eth0 is down again.

Here is the output of dmesg | grep eth0:

```
airo: MAC enabled eth0 0:a:41:7d:50:be

eth0: index 0x05: Vcc 5.0, Vpp 5.0, irq 3, io 0x0100-0x013f
```

Grepping dmesg for airo outputs about ten lines that look fine.  I can post them if need be.

/var/log/messages shows me this output from trying to start eth0 with forcepreferred:

```
Setting transmit key to 0

.... the output of the script as I typed above....

Setting transmit key to 0
```

And when I run dhcpcd as above, I get output in /var/log/messages about timing out waiting for a valid DHCP server response.

I notice that the lights on the card are not on, unless I actually try to run something, such as iwlist scanning or some such.  Then the lights blink as I expect.

When I pull the card out (it's a pcmcia card) I get a bunch of stuff in /var/log/messages about

```
airo: Rsp1= ffff

.... more airo: stuff

....

cardmgr[2325]: executing: './network stop eth0 2>&1'

.... more cardmgr stuff about device not found,

.... remove event not handled, 

.... /var/lib/init.d/deptree no such file or directory, dependency info missing.....

.... run /sbin/depscan.sh to fix...

```

Help?  Any ideas?  :Confused: 

----------

## bps7j

bump

----------

## bps7j

If anyone has ANY ideas, please post... I've searched the web, searched the forums, read literally hundreds of posts and not found a single thing that works.  ::sigh::

----------

## UberLord

post the output of iwconfig eth0

----------

## bps7j

Thanks for replying!

```
# iwconfig eth0

eth0      IEEE 801.11-DS  ESSID:""  Nickname:"linksys"

          Mode:Managed  Frequency:2.442 GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate: 11 Mb/s   Tx-Power=20 dBm   Sensitivity=0/65535

          Retry Limit: 16   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=0/100  Signal level=-105 dBm  Noise level=-105 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0    Missed beacon:0
```

Hopefully I didn't make any typos there.  Another possibility I'm considering is that having rebuilt things with different USE flags, and with specific locales enabled, might be borking it?  I think the only thing I haven't rebuilt is my kernel.  Possibly relevant things I rebuilt between the time I knew it to be working and when it stopped working: pcmcia-cs, gcc, util-linux, sudo, syslog-ng, pam-login.

I'm currently trying to figure out what the net.eth0 script really does.  It looks like it stops at line 471 while doing "pre Start any modules with".  The first module makes it exit, and that's iwconfig.

----------

## bps7j

Whoa, anyone who wants to see a LOT of output telling you exactly what your script is doing, try this:

```
NET_DEBUG=1 /etc/init.d/net.eth0 start
```

I suggest running this in screen, then scrolling with C^a Esc because for some reason it doesn't like being piped to a real file then viewed with less.  The file ends up full of characters less doesn't like or something.

----------

## bps7j

OK, this is odd.  I'm tracing through the verbose output of the command I posted above, and I see that the first 'no access points found' output is related to the following (I'm not sure about this)

```
ifconfig eth0 up

iwconfig eth0 rate auto

iwconfig eth0 rts off

iwconfig eth0 frag off

iwconfig eth0 power off

iwconfig eth0 txpower auto

iwconfig eth0 key off '[1]'

iwconfig eth0 essid any
```

So then I typed this, and ran 

```
iwlist eth0 scanning
```

 and guess what, it saw my access point.  BUT, I haven't been able to duplicate this since then!  How odd.  Every time I've run this since then, it just tells me it's unable to read data.  My access point is well within range; the signal is very strong.  So I really doubt this has anything to do with not being able to get a signal.

I unset the ipv6 USE flag before I rebuilt all these packages.  Does anyone know if this has anything to do with this?

----------

## bps7j

OK, in desperation I rebooted and pulled the PCMCIA card out of the slot until after the machine had bounced back up, and then pushed it in.  After a minute ifconfig and iwconfig reported that the card had associated with the access point (yep, I checked the MAC address, and it was right) and had gotten an IP address, 192.168.1.102.  But I couldn't ping anything out on the internet, and it looked like my 'connection' was bogus.  I looked in /var/log/messages and I see

```
....

rc-scripts: Trying to force preferred in case they are hidden

NET: Registered protocol family 17

dhcpcd[7851]: DHCP_NAK server response received

dhcpcd[7851]: DHCP_NAK terminating on signal 15

rc-scripts: eth0 does not support scanning

....
```

The rest of the messages from there on are as above in other posts.  I tried running 

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

 and it failed just as in my other posts.

I'm deeply suspicious of recompiling things with different USE flags at this point.  I think that might be the problem.  I think I'm gonna recompile everything, including my kernel, and reboot -- this does not seem to be a configuration issue.

----------

## the_mgt

Do you have "trusted" as pcmcia-cs useflag? I have it and works fine here...

Maybe "optimizing" gcc b0rked stuff? Maybe mixig programms which were compiled with the older useflags with newer ones doesnot  work. Maybe some library looks different then the freshly compiled program expects? Did you try emerge pcmcia-cs --emptytree -vp to look at its dependencies and where you may have tinkered around? I like to play around with my systems too, until they are over-optimized... :Wink: 

Sometimes my card does weird things, than i "cardctl eject" it, unload the modules (which isn't possible in your case) and "cardctl insert" it again and everything works fine. Have a look what dmesg tells you about it.

(I guess you tried that...)

----------

## bps7j

Thanks for the tips.  I haven't used the trusted flag before and didn't change it from before, when my system was working.  I looked it up on http://gentoo-wiki.com/USE_Flags_explained and found out what it does.  I tried your suggestions for cardctl and it does the same thing as I've been seeing[/code], on insert it tries to start eth0 and fails as usual.

emerge -pv --emptytree pcmcia-cs prints out a dozen or so packages, mostly things like make and binutils and ncurses; it seems that the only relevant ones in the list are gentoo-sources and pcmcia-cs.  I'm building my kernel now, under the theory that maybe it's not playing well with the new glibc or something.  After that I'll rebuild pcmcia-cs and see what happens!

----------

## bps7j

By the way, the usual commands like revdep-rebuild, emerge --deep --newuse world, and so forth report nothing wrong, nothing that needs rebuilding.  I'm just trying this as a theory  :Smile: 

Hopefully I can figure this out.  I'm not worried, like "oh my gosh I can't use my computer" because I have a laptop from my employer that I can use.  I'm just playing, trying to learn, trying to find bugs... etc.  Oh, and optimizing my system.  It's amazing -- the things that work, work really fast now.  I mean, listing the files in a directory is probably 3 or 4 nanoseconds faster now.  I love it  :Wink: 

----------

## the_mgt

LOL! Thats a gain!

I always thought devices which are plugged in and out a lot like pcmcia devices should be build as modules.

But now i have bluetooth and isdn running with a monolythic kernel, i think it is no problem.

Do you build the pcmcia stuuf and your card as modules now?

It is strange, that your card doesn't work anymore, but did one time in between...

Revdep-rebuild can be started with a special library given to it. It does other things than, as if you only run it without these options. Had to do it here, after i chenged my system to unicode. (Still doesn't work copmletely...)

Good look with your new kernel!

----------

## bps7j

I rebuilt my kernel and pcmcia-cs and rebooted, and the network came up fine when the system booted, but I can't do /etc/init.d/net.eth0 restart.  If I do, it brings it down, then tries to bring it up again, and it fails.  Whiskey Tango Foxtrot?  Very strange.

----------

## bps7j

Yeah, that appeared to be a fluke.  I rebooted again, and this time it didn't come up.  I checked /var/log/messages and I could see that even when the network DID come up (I could even ping the outside world) the script's output reported failing and not finding access points.  This seems to be related to the time I could get iwlist eth0 scanning to work, and then couldn't get it to work after that.  Basically, it only seems to work on random occasions!

----------

## UberLord

 *bps7j wrote:*   

> This seems to be related to the time I could get iwlist eth0 scanning to work, and then couldn't get it to work after that.  Basically, it only seems to work on random occasions!

 

Alas, Gentoo scripts work in the same way.

If you get your AP appearing in a scan intermittently, don't expect our scripts to work all the time  :Sad: 

----------

## bps7j

 *Quote:*   

> Alas, Gentoo scripts work in the same way.
> 
> If you get your AP appearing in a scan intermittently, don't expect our scripts to work all the time

 

Yep, I know.

I had a brilliant idea: maybe it's a HARDWARE problem.  I think the PCMCIA card itself is faulty.  I put it into another laptop running Windows and even though the hardware tells the computer it's working fine, it can't seem to talk to the access point except when it's physically cool.  I think the fact that it went on the blitz at the same time as I was recompiling all this software is just coincidence.

I put my brother's Linksys WPC11 into my computer and (after adding the required modules in the kernel) it's working great.

This has been a complete wild goose chase  :Razz:   But, thanks to all the people who've read and posted.  Apparently there's no help for my problem, but your moral support is much appreciated!  Thank you!

----------

