# Can't connect to wireless networks

## Kasumi_Ninja

I have a netgear WG111v2 USB wifi. I can see wireless networks but I can't  connect?! Thusfar I have tried  connecting to wep an wpa networks to no avail. I jave wpa an wep support compiled into the kernel. WHat alse can I try?

# lsusb 

```
Bus 002 Device 001: ID 0000:0000  

Bus 001 Device 005: ID 0846:6a00 NetGear, Inc. WG111 WiFi (v2)

Bus 001 Device 001: ID 0000:0000  
```

# 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=( "wpa_supplicant" )
```

# iwconfig 

```
lo        no wireless extensions.

eth0      no wireless extensions.

wmaster0  no wireless extensions.

wlan1     IEEE 802.11g  ESSID:""  

          Mode:Managed  Channel:0  Access Point: Not-Associated   

          Tx-Power=0 dBm   

          Retry min limit:7   RTS thr:off   Fragment thr=2346 B   

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

 # tail -f /var/log/messages 

```
Jun 30 22:12:38 laptop ADDRCONF(NETDEV_UP): wlan1: link is not ready

Jun 30 22:12:38 laptop NetworkManager: <debug> [1214863958.946834] GentooReadConfig(): Enabling DHCP for device wlan1.

Jun 30 22:12:38 laptop NetworkManager: <debug> [1214863958.946914] GentooReadConfig(): Found hostname.

Jun 30 22:12:38 laptop NetworkManager: nm_ip4_config_set_hostname: assertion `config != NULL' failed

Jun 30 22:12:38 laptop NetworkManager: <info>  wlan1: Device is fully-supported using driver 'rtl8187'.

Jun 30 22:12:38 laptop NetworkManager: <info>  nm_device_init(): waiting for device's worker thread to start

Jun 30 22:12:38 laptop NetworkManager: <info>  nm_device_init(): device's worker thread started, continuing.

Jun 30 22:12:38 laptop NetworkManager: <info>  Now managing wireless (802.11) device 'wlan1'.

Jun 30 22:12:38 laptop NetworkManager: <info>  Deactivating device wlan1.

Jun 30 22:12:38 laptop NetworkManager: <debug> [1214863958.979710] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_846_6a00_00184DB160A6_usbraw').

Jun 30 22:12:54 laptop NetworkManager: <debug> [1214863974.390032] nm_device_802_11_wireless_get_activation_ap(): Forcing AP 'Gentoo_Linux'

Jun 30 22:12:54 laptop NetworkManager: <info>  User Switch: /org/freedesktop/NetworkManager/Devices/wlan1 / Gentoo_Linux

Jun 30 22:12:54 laptop NetworkManager: <info>  Deactivating device wlan1.

Jun 30 22:12:54 laptop dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/wlan1 for sub-path wlan1.dbus.get.reason

Jun 30 22:12:54 laptop NetworkManager: <info>  Device wlan1 activation scheduled...

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) started...

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) Stage 1 of 5 (Device Prepare) scheduled...

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) Stage 1 of 5 (Device Prepare) started...

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) Stage 2 of 5 (Device Configure) scheduled...

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) Stage 1 of 5 (Device Prepare) complete.

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) Stage 2 of 5 (Device Configure) starting...

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1/wireless): access point 'Gentoo_Linux' is encrypted, but NO valid key exists.  New key needed.

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) New wireless user key requested for network 'Gentoo_Linux'.

Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1) Stage 2 of 5 (Device Configure) complete.

Jun 30 22:13:07 laptop NetworkManager: <info>  Activation (wlan1) New wireless user key for network 'Gentoo_Linux' received.

Jun 30 22:13:07 laptop NetworkManager: <info>  Activation (wlan1) Stage 1 of 5 (Device Prepare) scheduled...

Jun 30 22:13:07 laptop NetworkManager: <info>  Activation (wlan1) Stage 1 of 5 (Device Prepare) started...

Jun 30 22:13:07 laptop NetworkManager: <info>  Activation (wlan1) Stage 2 of 5 (Device Configure) scheduled...

Jun 30 22:13:07 laptop NetworkManager: <info>  Activation (wlan1) Stage 1 of 5 (Device Prepare) complete.

Jun 30 22:13:07 laptop NetworkManager: <info>  Activation (wlan1) Stage 2 of 5 (Device Configure) starting...

Jun 30 22:13:07 laptop NetworkManager: <info>  Activation (wlan1/wireless): access point 'Gentoo_Linux' is encrypted, and a key exists.  No new key needed.

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'INTERFACE_ADD wlan1      wext   /var/run/wpa_supplicant   '

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was 'OK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'AP_SCAN 1'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was 'OK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'ADD_NETWORK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was '0'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 ssid 47656e746f6f5f4c696e7578'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was 'OK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 proto WPA'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was 'OK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 key_mgmt WPA-PSK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was 'OK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'SET_NETWORK 0 psk <key>'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was 'OK'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: sending command 'ENABLE_NETWORK 0'

Jun 30 22:13:08 laptop NetworkManager: <info>  SUP: response was 'OK'

Jun 30 22:13:08 laptop NetworkManager: <info>  Activation (wlan1) Stage 2 of 5 (Device Configure) complete.

Jun 30 22:13:14 laptop NetworkManager: <info>  Old device 'wlan1' activating, won't change.

Jun 30 22:13:21 laptop NetworkManager: <info>  Old device 'wlan1' activating, won't change.

Jun 30 22:13:28 laptop NetworkManager: <info>  Old device 'wlan1' activating, won't change.

Jun 30 22:13:28 laptop NetworkManager: <info>  Activation (wlan1/wireless): association took too long (>20s), failing activation.

Jun 30 22:13:28 laptop NetworkManager: <info>  Activation (wlan1) failure scheduled...

Jun 30 22:13:28 laptop NetworkManager: <info>  Activation (wlan1) failed for access point (Gentoo_Linux)

Jun 30 22:13:28 laptop NetworkManager: <info>  Activation (wlan1) failed.

Jun 30 22:13:28 laptop NetworkManager: <info>  Deactivating device wlan1.

Jun 30 22:13:40 laptop ADDRCONF(NETDEV_UP): wlan1: link is not ready
```

----------

## eyoung100

 *Aniruddha wrote:*   

> 
> 
> ```
> Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1/wireless): access point 'Gentoo_Linux' is encrypted, but NO valid key exists.  New key needed. 
> ```
> ...

 

Your problem lies here...

```

emerge -pv wpa_suplicant
```

----------

## Kasumi_Ninja

 *eyoung100 wrote:*   

>  *Aniruddha wrote:*   
> 
> ```
> Jun 30 22:12:54 laptop NetworkManager: <info>  Activation (wlan1/wireless): access point 'Gentoo_Linux' is encrypted, but NO valid key exists.  New key needed. 
> ```
> ...

 

Thanks for the help, unfortunately wpa_supplicant ia already installed   :Sad: 

----------

## Ph0eniX

Is the SSID being broadcasted?  I've seen odd connectivity issues on networks with hidden SSIDs.

----------

## eyoung100

 *Aniruddha wrote:*   

> 
> 
> Thanks for the help, unfortunately wpa_supplicant ia already installed  

 

That's the idea, uninstall wpa_supplicant as Network Manager doesn't need it?

----------

## mathfeel

 *eyoung100 wrote:*   

>  *Aniruddha wrote:*   
> 
> Thanks for the help, unfortunately wpa_supplicant ia already installed   
> 
> That's the idea, uninstall wpa_supplicant as Network Manager doesn't need it?

 

I am trying to to get NetworkManager to work as well (wpa_supplicant works fine for me, but I want to be able to use a simple GUI tools like NM-applet).

Anyway, this is what portage say about wpa_supplicant:

```
Calculating dependencies... done!

Dependencies could not be completely resolved due to

the following required packages not being installed:

>=net-wireless/wpa_supplicant-0.4.8 required by gnome-extra/nm-applet-0.6.6 net-misc/networkmanager-0.6.6

Have you forgotten to run `emerge --update --newuse --deep world` prior to

depclean?  It may be necessary to manually uninstall packages that no longer

exist in the portage tree since it may not be possible to satisfy their

dependencies.  Also, be aware of the --with-bdeps option that is documented

in `man emerge`.

```

However, you are still right. wpa_supplicant is what's messing with NetworkManager. After much struggle, this is what I have to do to get NetworkManager working:

Turn OFF wpa_supplicant and use dhclient instead of dhcpcd:

/etc/conf.d/net

```
modules={ "dhclient" "!wpa_supplicant" "!iwconfig"}
```

Tell RC to not start the network interface services (optional for faster boot time)

/etc/rc.conf

```
rc_plug_services="!net.eth* !net.ath* !net.wlan*"
```

----------

## eyoung100

Sorry for the delay in replying.  That's great.  Please add [Solved] to your post title.

----------

## Kasumi_Ninja

 *eyoung100 wrote:*   

> Please add [Solved] to your post title.

 

I will, once I tested mathfeel's solution   :Wink: 

----------

