OpenWrt Forum Archive

Topic: scanning speed

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi

Why we have to use "wifi down" before each scan? Is there another way?
When we use this method we have to wait for some seconds before scanning. It makes our scanning process slow.
When I scan AP's with MikroTik OS on a 200MHz processor it takes about 1 second for each refresh but in our method with openwrt on a 600MHz processor each refresh takes 2, 3 or more seconds( it's depended on AP's response speed ).

What can we do to increase our scan refresh speed?

Thanks in advance

Any idea?

Could be that the reason is that you can't be connect to a network AND scan at the same time. Wi-fi hopper exhibits the same behaviour where if you scan with it it'll kick you off your current connection and not let you connect to anything until you disable scanning mode.

Thanks Sp@ce Boy for reply.

But I'm not connected to any AP before scanning and there's no any AP with the name of my system at all to connect automatically.
Also I know that every GUI like X-WRT use this method for scanning, but it's very slow. And if you don't use wifi down before using iwlist scanning the result of scan is toooooo slow (it seems that iwlist uses a cache and because of that it's tooooo slow). When you use wifi down and recreate ath0, every things will be refreshed, But as I said before, it takes 2 or 3 seconds to give you a result after creation.

Any help will be appreciated.

the scanning speed may depend on the radio circuit used, and drivers that go with it.
Can you be more specific what you are using ?
In a scan basically the radio listens on all channels for a defined time to listen for beacons and if you define SSIDs it may also issue probes for APs that do not send out a beacon with SSID.
E.g. a card with both 802a and bg will need longer as it needs to scan channels in 2.4 and 5 GHz bands.
I know in the case of broadcom drivers that it is possble to define the dwell time per channel (wl non-free package) and influence the total time. But as you go quicker you may miss some APs, so it is a trade off.
When scanning from a station I never had to issue wifi down. Just use the iw commands for scanning.
iw dev <devname> scan [-u] [freq <freq>*] [ssid <ssid>*|passive]
iw dev <devname> scan trigger [freq <freq>*] [ssid <ssid>*|passive]
iw dev <devname> scan dump [-u]

(Last edited by doddel on 8 Jan 2010, 12:02)

Thank you very much doddel

I tried to use iw command, but it seems that something is missed here because it doesn't know my device :

root@OpenWrt:/home# iw dev ath0 scan trigger
command failed: No such device (-19)

I'm using atheros wifi cards. I have both types(11a and 11abg)  on a routerstation board (AR71XX).
I also selected ath9k and madwifi modules in openwrt trunk.

Thanks again.

check what the interface is called by issuing ifconfig and iwconfig.
Latter should give all sorts of details about the wireless interface.

The HW name is wifi0 and interface name is ath0.
I tested with both of them in iw.
I use ath0 in iwlist command, but it doesn't work in iw.

One difference with here is that my wireless devices are called wlan0 wlan1 etc.
via the definitions in //etc/config /network and /wireless.
I also use a RS board and with it two miniPCI boards with ar9220 radios.
I can reproduce your error message when I use iw with an interface name that does not exist.
So it must be a configuration issue.

(Last edited by doddel on 8 Jan 2010, 16:24)

I'm sorry doddel for my inconvenience and thank you very much for you helps.

What driver packages did you selected in trunk to build?

And have you changed any configuration after flashing? When I flash my board, I always see wifi0 in /etc/config/wireless.

for my miniPCI boards I need ath9k , so selected that.
Indeed I do not use the default configuration and therefore my suggestion to start experimenting with the way
the interface gets defined in /etc/config ./network and ./wireless

Thank you doddel for introducing this beautiful tool (iw).

I could run it on ath5 driver but not on ath9 driver.

Do you know any specific configuration on ath9 that needed for this tool?

I think it has a lot of options and it can scan faster. I should work on it for some days.

I'll write here any problem or good result.

Thanks again for your helps

have it working here with ath9k.
What I could suggest is to issue 'wifi down' to remove the wireless interfaces and than to create the one served by ath9k by hand just for the purpose of being able to scan.
Have a look in /sys/class/ieee80211 and see the identification of the interface you are looking for; let? assume it is called phy0
iw phy phy0 interface add wlan0 type managed
ifconfig wlan0 <ipaddress> netmask <netmask> broadcast +
iw scan wlan0

Hi doddel thank you very much for your great help.

I could run it on ath9 too.
I just installed ath5 and ath9 drivers together and it worked.

You did a great help.
Thanks again.

Hi

Your method works fantastic in client mode.
But I have a problem in ap mode with my new configuration using new driver.
when I run wifi command to set wireless parameters I get these messages:

root@OpenWrt:/# wifi
command failed: Invalid argument (-22)
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering disabled statenf

br-lan: port 2(wlan0) entering forwarding state
Hardware does not support configured mode
wlan0: IEEE 802.11 Hardware does not support configured mode (1)
Could not select hw_mode and channel. (-1)
rmdir[ctrl_interface]: No such file or directory
br-lan: port 2(wlan0) entering disabled state
enable_mac80211(wifi0): Failed to set up wpa for interface wlan0

I know that these errors produce by /lib/wifi/mac80211.sh .

But I don't know why.

I use the simplest wireless configuration.
This is my /etc/config/wireless configuration:

config wifi-device  wifi0
        option type     mac80211
        option channel  5
        option macaddr  00:07:61:ff:00:24
        option hwmode   11a

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption none

The discussion might have continued from here.