PoweredLocal / openwrt-auto-channel-select

Automatic Wi-Fi channel selection script for OpenWRT and supported systems
MIT License
10 stars 19 forks source link

script does not recognize active channels arround ? #1

Open T-C-R opened 6 years ago

T-C-R commented 6 years ago

When I'm running the script on an LEDE powered router I'm getting

root@OpenWrt:~# ./setAutoChannel.sh 0 Iteration 1 Iteration 2 Iteration 3 Channel 1 has an average of 0 networks Channel 6 has an average of 0 networks Channel 11 has an average of 0 networks Setting channel to 1

but the result of iw wlan0 scan is: root@OpenWrt:~# iw wlan0 scan BSS e8:94:f6:cc:44:3d(on wlan0) TSF: 1869218724 usec (0d, 00:31:09) freq: 2412 beacon interval: 100 TUs capability: ESS (0x0431) signal: -71.00 dBm last seen: 890 ms ago Information elements from Probe Response frame: SSID: drahtlos nicht ratlos HT capabilities: Capabilities: 0x1ad RX LDPC HT20 SM Power Save disabled RX HT20 SGI TX STBC RX STBC 1-stream Max AMSDU length: 3839 bytes No DSSS/CCK HT40 Maximum RX AMPDU length 65535 bytes (exponent: 0x003) Minimum RX AMPDU time spacing: No restriction (0x00) HT RX MCS rate indexes supported: 0-15 HT TX MCS rate indexes are undefined HT operation:

so there are definitely several WLAN on channels 1,6 and 11 around.

Why is it then the script is not recognizing those ?

dusterio commented 6 years ago

Hmm, try to insert one line at the line 27, eg: echo "$line" It looks like the script doesn't get any response from iw which is strange

T-C-R commented 6 years ago
    will try Denis, but it will take me to the WE as I‘m teavelling all week. Will run a test then and revert to you. 

On Mon, Dec 11, 2017 at 2:03 AM +0100, "Denis Mysenko" notifications@github.com wrote:

Hmm, try to insert one line at the line 27, eg: echo "$line"

It looks like the script doesn't get any response from iw which is strange

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

T-C-R commented 6 years ago

Hmm, maybe I'm too stupid .... line 27 is: FIRST=echo "$line" | awk '{ print $1 }' so I added echo "$line" in a new line right after.

the the script is coming back with: line 1: arithmetic syntax error

which is a bit odd as line 1 is just and only calling ash, right ?

lexxwork commented 6 years ago

echo "$line" is placed in local scope & and outpus out of function so line eval "AVG_$CHANNEL=$(( ($CURRENT_AVG + $CURRENT_VALUE + 1) / 2 ))" raises error in the script logic cuts of weak signals in channels SIGNAL=echo $line | awk '{ print ($2 < -60) ? "NO" : $2 }' suppose all neighbor channels with signal are less than -60dBm