# [solved] wifi scan don't work

## valarko

Hello,

I have a little problem with my laptop. It can't detect wifi network.

This is the result of the command lspci

```
Network controller : Intel Corporation PRO:Wireless 3945ABG [Golan] Network connection (rev02)
```

Then if I use the command iwconfig, I obtain :

```
wlan0 IEE 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
```

And the result of the command iwlist scan is No scan results

Of course it exists an access point which I can connect it.

I need help.

Thank you.Last edited by valarko on Thu Jan 21, 2010 10:41 pm; edited 1 time in total

----------

## Telemin

Did you try running 

```
ifconfig wlan0 up
```

 before scanning?

The reason you are getting no scan results is because the wireless card is turned off (see it says power: off) so running ifconfig wlan0 up should turn it on.

Note the init scripts should do this by default so don't worry about having to do it on every boot.

-Freestyling-

----------

## valarko

Yes I try this command.  My card is turned on.

----------

## Telemin

Okay just to check, you are using the kernel based driver for this card?

Also can you actually connect to the network by specifying things manually?

Are there any wireless related messages in dmesg after you have tried scanning?

-Freestyling-

----------

## valarko

 *Quote:*   

> Okay just to check, you are using the kernel based driver for this card? 

 

Yes, I use the kernel based driver.

 *Quote:*   

> Also can you actually connect to the network by specifying things manually? 

 

I didn't try that and I don't know the file which I have to modify and how configuring that manually

 *Quote:*   

> Are there any wireless related messages in dmesg after you have tried scanning? 

 

This is the information about the wireless in dmesg :

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

iwl3945: Copyright(c) 2003-2009 Intel Corporation

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

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

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

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

iwl3945 0000:05:00.0: irq 28 for MSI/MSI-X

e100 0000:07:08.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20

e100 0000:07:08.0: PME# disabled

e100: eth0: e100_probe: addr 0xf0905000, irq 20, MAC addr 00:a0:d1:43:b1:34

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

EXT3 FS on sda1, internal journal

kjournald starting.  Commit interval 5 seconds

EXT3 FS on sda3, internal journal

EXT3-fs: mounted filesystem with writeback data mode.

Adding 1951888k swap on /dev/sda2.  Priority:-1 extents:1 across:1951888k 

e100: eth0 NIC Link is Up 100 Mbps Full Duplex

iwl3945 0000:05:00.0: firmware: requesting iwlwifi-3945-2.ucode

iwl3945 0000:05:00.0: loaded firmware version 15.32.2.9

Registered led device: iwl-phy0::radio

Registered led device: iwl-phy0::assoc

Registered led device: iwl-phy0::RX

Registered led device: iwl-phy0::TX

wlan0: deauthenticating by local choice (reason=3)

pci 0000:01:00.0: power state changed by ACPI to D0

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

Registered led device: iwl-phy0::radio

Registered led device: iwl-phy0::assoc

Registered led device: iwl-phy0::RX

Registered led device: iwl-phy0::TX
```

----------

## Telemin

Okay standard method for connecting is to use wpa_supplicant.  It has a config file by default in /etc/wpa_supplicant/wpa_supplicant.conf and has fairly straightforward syntax, constructed of a block for each network you wish to connect to, for example:

```

ap_scan=1 #use this line to make wpa_supplicant look after the scanning

#Home network

network={

     ssid="Snoopy"

     psk="Woodstock"

}

```

that should work for a home wireless network, be aware that wpa_supplicant is case sensitive in terms of it's ssids.

Wpa_supplicant also installs a config example file at /usr/share/doc/wpa_supplicant-{version}/wpa_supplicant.conf.bz2, and can be read most easily using bzcat.

```

bzcat /usr/share/doc/wpa_supplicant-{version}/wpa_supplicant.conf.bz2 | less

```

You can then run wpa_supplicant (as root) from the command line to see its output by calling:

```

wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

```

You should see a snippet looking something like this:

```

Trying to associate with 00:24:17:78:3e:e7 (SSID='Myssid' freq=2412 MHz)

Associated with 00:24:17:78:3e:e7

WPA: Key negotiation completed with 00:24:17:78:3e:e7 [PTK=CCMP GTK=CCMP]

CTRL-EVENT-CONNECTED - Connection to 00:24:17:78:3e:e7 completed (auth) [id=2 id_str=]

```

Then you can get an ip using dhcp by running "dhcpcd wlan0"

If this all works then set up /etc/conf.d/net, to use wpa_supplicant with the lines

```

modules_wlan0=("wpa_supplicant")

wpa_supplicant_wlan0="-Dwext"

```

[/url]

-Freestyling-

----------

## valarko

It doesn't work. When I use the command wpa_supplicant as you said, I have this message :

CTRL-EVENT-SCAN-RESULTS

----------

## roarinelk

try this before initiating a scan:

iwconfig wlan0 txpower auto

According to the log in the initial post tx power is off.

----------

## d2_racing

Ok, reboot your box and try this :

```

# cd /usr/src/linux

# cat .config | grep -i 802

# cat .config | grep -i kill

# cat .config | grep -i iwl

# ifconfig -a

# iwconfig

# ifconfig wlan0 up

# iwlist scan

# dmesg | tail

```

----------

## valarko

I succeed to solve my problem. I update the kernel and after that the wifi scan worked. 

Thanks for your help

----------

## d2_racing

No problem.

----------

