# wireless wont start, iwl3945 & wpa_supplicant

## Iesos

Hi.

I, just as others before me, have been having problems with wireless. And reinstalling my system (which had a working iwl3945) with the files you find below, have stopped working. This is the message I get:

```
# /etc/init.d/net.wlan0 start

net.wlan0        |* Bringing up interface wlan0

net.wlan0        |*   Changing MAC address of wlan0...                                                                                                                                                              [ ok ]an0        |

net.wlan0        |*     changed to 00:0b:74:da:da:e3

net.wlan0        |SIOCSIFFLAGS: No such device

net.wlan0        |*   Configuring wireless network for wlan0

net.wlan0        |*   Scanning for access points

net.wlan0        |*      does not support scanning

net.wlan0        |*   You either need to set a preferred_aps list in /etc/conf.d/wireless

net.wlan0        |*      preferred_aps="SSID1 SSID2"

net.wlan0        |*      and set associate_order_wlan0="forcepreferred"

net.wlan0        |*      or set associate_order_wlan0="forcepreferredonly"

net.wlan0        |*   or hardcode the  SSID to "any" and let the driver find an Access Point

net.wlan0        |*      ssid_wlan0="any"

net.wlan0        |*   or configure defaulting to Ad-Hoc when Managed fails

net.wlan0        |*      adhoc_ssid_wlan0="WLAN"

net.wlan0        |*   or hardcode the SSID against the interface (not recommended)

net.wlan0        |*      ssid_wlan0="SSID"

net.wlan0        |*   Failed to configure wireless for wlan0

net.wlan0        |* ERROR: net.wlan0 failed to start
```

The essential parts of my net and wpa_supplicant.conf files are:

-- /etc/conf.d/net --

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext" 

config_wlan0="dhcp"

-- /etc/wpa_supplicant/wpa_supplicant.conf --

network={

        ssid="cake_space"

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=CCMP TKIP

        group=CCMP TKIP

        psk="whatnot"

}

--

Any ideas on what could be wrong?

----------

## cach0rr0

for troubleshooting purposes, let us skip the init script route

if you do:

```

rmmod iwl3945

```

first, to tidy things up

then

```

modprobe iwl3945

```

post 

```
cat /proc/net/wireless

dmesg |tail -n 20

```

----------

## mikegpitt

Have you installed net-wireless/iwl3945-ucode?

----------

## cach0rr0

 *mikegpitt wrote:*   

> Have you installed net-wireless/iwl3945-ucode?

 

I saw that earlier when I was looking. What the deuce is it? 

not entirely clear on what 'ucode' is =/

I suppose I could always google....

----------

## Iesos

Yes, I have the -ucode thingy installed.

# cat /proc/net/wireless 

Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE

 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22

 wlan0: 0000    0     0     0        0      0      0      0      0        0

# dmesg |tail -n 20 

Registered led device: iwl-phy0::TX

ADDRCONF(NETDEV_UP): wlan0: link is not ready

Registered led device: iwl-phy0::radio

Registered led device: iwl-phy0::assoc

Registered led device: iwl-phy0::RX

Registered led device: iwl-phy0::TX

ADDRCONF(NETDEV_UP): wlan0: link is not ready

wlan0: deauthenticating by local choice (reason=3)

r8169: eth0: link up

r8169: eth0: link up

eth0: no IPv6 routers present

ACPI: EC: GPE storm detected, transactions will use polling mode

iwl3945 0000:02:00.0: PCI INT A disabled

iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.2.26ks

iwl3945: Copyright(c) 2003-2009 Intel Corporation

iwl3945 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

iwl3945 0000:02:00.0: setting latency timer to 64

iwl3945 0000:02:00.0: Tunable channels: 13 802.11bg, 23 802.11a channels

iwl3945 0000:02:00.0: Detected Intel Wireless WiFi Link 3945ABG

phy1: Selected rate control algorithm 'iwl-3945-rs'

----------

## mikegpitt

 *cach0rr0 wrote:*   

> not entirely clear on what 'ucode' is =/

 Ucode is just the firmware needed to make the driver work.

Iesos:  The messages you are receiving when starting net.wlan0 are a bit odd... especially the fact that it is trying to change the MAC address.  Are you purposely trying to do that?

Can you post the output of iwconfig and ifconfig -a?  Also try this:

```
ifconfig wlan0 up

/etc/init.d/net.wlan0
```

I'm leaning towards a kernel configuration issue.  Post the output of: grep IWL .config

This is what mine looks like:

```
CONFIG_IWLWIFI=m

CONFIG_IWLWIFI_LEDS=y

# CONFIG_IWLWIFI_RFKILL is not set

# CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT is not set

# CONFIG_IWLWIFI_DEBUG is not set

CONFIG_IWLAGN=m

CONFIG_IWL4965=y

CONFIG_IWL5000=y

CONFIG_IWL3945=m

CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y

```

Last edited by mikegpitt on Thu Aug 13, 2009 5:47 pm; edited 1 time in total

----------

## cach0rr0

 *mikegpitt wrote:*   

>  *cach0rr0 wrote:*   not entirely clear on what 'ucode' is =/ Ucode is just the firmware needed to make the driver work.
> 
> 

 

bugger, I'd made an educated guess that's what it was, and was going to suggest that before anything else

shouldn't have doubted my instincts, cheers for that

(PS: shouldn't it be ifconfig wlan0 up and not ifconfig net.wlan0 up? )

----------

## mikegpitt

 *cach0rr0 wrote:*   

> (PS: shouldn't it be ifconfig wlan0 up and not ifconfig net.wlan0 up? )

 Yes!  Good eye... post corrected above.

----------

## Iesos

Nice, progress; 

```
ifconfig wlan0 up 
```

makes my LED go on, and I can scan (iwlist scanning). However doing a /etc/init.d/net.wlan0 start after the if up-stuff, shuts down the LED and back to the beginning. So something wrong with the init script? (not edited by me ever.) And yes, I change the MAC address on purpose. How do I continue from here?

```
# iwconfig 

- snip -

wlan0     IEEE 802.11abg  ESSID:""  

          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   

          Tx-Power=off   

          Retry min limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management: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
```

```
# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:16:d4:60:f1:4c  

          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::216:d4ff:fe60:f14c/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:12119 errors:0 dropped:0 overruns:0 frame:0

          TX packets:9851 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:12253843 (11.6 MiB)  TX bytes:835017 (815.4 KiB)

          Interrupt:18 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:3854 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3854 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:499626 (487.9 KiB)  TX bytes:499626 (487.9 KiB)

sit0      Link encap:IPv6-in-IPv4  

          NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:0b:74:da:da:e3  

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-18-DE-D9-AD-36-00-00-00-00-00-00-00-00-00-00  

          [NO FLAGS]  MTU:0  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
```

```
# grep IWL .config 

CONFIG_IWLWIFI=y

CONFIG_IWLWIFI_LEDS=y

CONFIG_IWLWIFI_RFKILL=y

# CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT is not set

# CONFIG_IWLWIFI_DEBUG is not set

# CONFIG_IWLAGN is not set

CONFIG_IWL3945=m

CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y
```

----------

## Iesos

Hi again.

Played around with this for a while, this is what I figured out.

The "edit the /etc/conf.d/wireless"-message I got indicated that iwconfig tried to handle my connection. This is not what I want. So before loading wpa_supplicant in /etc/conf.d/net I need to block iwconfig. That is the line with module has to look like:

modules_wlan0=( "!iwconfig" "wpa_supplicant" )

(and the iwconfig stuff needs to be first.) This does however not solve my problem. Now I don't get the "edit the /etc/conf.d/wireless"-message, but instead dhcpcd dies after five seconds. During these five seconds I check iwconfig, and it doesn't seem to have attached itself to my network (that is the ssid= is unset). So I figured that wpa_supplicant wasn't running, since that is the thing that handles my connection. So I run

# wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf

and wpa_supplicant starts and I can successfully run

# /etc/init.d/net.wlan0 start

I do not consider this a full "solved" so if anyone has an idea to why my init script doesn't start wpa_supplicant, I would be grateful.

----------

## cach0rr0

I know it's annoying hearing "alternatives" rather than actually getting folks to help you do things the way you want, so I apologize in advance, but....

I've never found the init scripts to be anything but cumbersome. 

if you have X, wicd does a brilliant job, and can be configured to autoconnect to an AP upon boot with relative ease

for those times X isn't doable, run wpa_supplicant in screen by hand, detach, then dhclient and you're on your way. 

Were it a server I'd be more insistent upon init scripts, but for a laptop I could care less - i just want easy connectivity to multiple networks, and a few autoconnect networks set up

----------

