[SOLVED] Iwchan.awk to show Wi-Fi info

Hi all,

whe I run under 23.05.2 the iwchan.awk show I got here https://openwrt.org/docs/guide-user/network/wifi/iwchan?rev=1694213842, it works partially:

# ./iwchan.awk show
command failed: No such device (-19)
Phy:	phy0
Dev:		Interface phy0-ap0
Band:	1
FreqTh:	15
LoadTh:	1000

Freq	Channel	Signal	Quality	BSSID			SSID

Freq	Channel	Load	Status
2412	1	0	
2417	2	0	
2422	3	0	
2427	4	0	
2432	5	0	
2437	6	0	
2442	7	0	+
2447	8	0	
2452	9	0	
2457	10	0	
2462	11	0	
2467	12	0	
2472	13	0	-

Up to 22.03.5 it gave all the exptected info shown here https://openwrt.org/docs/guide-user/network/wifi/iwchan?rev=1694213842#examples

I only want to run iwchan.awk with the show option (i.e. no Wi-Fi automatic channel selection needed), but I do not have the skill to adjust it; maybe it doesn't work anymore because "deprecated in favor of the default ACS algorithm" (see https://openwrt.org/docs/guide-user/network/wifi/iwchan?do=revisions) which, for me, is even worse in terms of understanding... can you help me?

Thanks in advance.

The device name cannot be extracted correctly because of the hyphen.

Open iwchan.awk and find and replace

dev = gensub(/^\s*\w*\s(\w+)$/, "\\1", 1, $0)

with

dev = gensub(/^\s*\w*\s(\w+-?\w+)$/, "\\1", 1, $0)
2 Likes

Thank you so much: it works.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.