Cannot redirect "iwpriv show" command's output to text file

I'm using MT7621, and i have problem with my command.

whenever i try to save a connection status about my interfaces, i need to type following command.

root@router:/# iwpriv apcli0 show connStatus
[69607.953456] =============================================================
[69607.960268] ApCli0 Connected AP : Disconnect
[69607.964590] ApCli0 CliLinkMap ra:0 1 2 3
Ignore repeater MAC address

=============================================================
root@router:/#

in order to save that as text file, i need to use >.

Here is what i did

root@router:/# iwpriv apcli0 show connStatus > test.txt
[69710.469220] =============================================================
[69710.476104] ApCli0 Connected AP : Disconnect
[69710.480372] ApCli0 CliLinkMap ra:0 1 2 3
Ignore repeater MAC address

=============================================================
root@router:/# cat test.txt
root@router:/#

seems it's not working, so i tried with | and grep

root@router:/# iwpriv apcli0 show connStatus | grep "ApCli0"
[69865.245236] =============================================================
[69865.252084] ApCli0 Connected AP : Disconnect
[69865.256352] ApCli0 CliLinkMap ra:0 1 2 3
Ignore repeater MAC address

=============================================================
root@router:/#

I think, only the string with "ApCli0" should be printed like

[69865.252084] ApCli0 Connected AP : Disconnect
[69865.256352] ApCli0 CliLinkMap ra:0 1 2 3

but it does not.

I tried using tee, but this does not works too.

Of course commands like ifconfig works well with >.
Also iwpriv without show option works well with >.
Only iwpriv [interface] show [parameter] does not work with >.

Any ideas for this?

Plus, not like other commands, iwpriv [interface] show [parameter] shows a time stamp. i'm not sure that is related.

Is this on the serial port? It looks like you're seeing log entries being dumped to the port.

iwpriv seems to be deprecated like iwconfig. The modern replacement is iw. Also OpenWrt has iwinfo.

2 Likes

As mk24 mentioned, iwpriv has been deprecated for over one and a half decade. Modern mac80211 based drivers only implement a minimal compat layer on request (via mac80211, if explicitly enabled at build time). Switch to using iw and or other nl80211 or cfg80211 based tools.

2 Likes

@mk24 @slh
Thanks guys. iwconfig [apcli0] works fine. Never thought of using that command.

iwconfig should not be used either. What type of status are you trying to collect?

1 Like

I'm trying to get a AP's SSID and BSSID which is connected to apcli interfaces.

Try iw dev apcli0 link.
iwinfo apcli0 assoclist is a shortened form, showing only the BSSID and the data rates. It doesn't show the SSID but you should know that from the config.
iw dev apcli0 station dump shows almost everything known about the connection.

unfortunately, i'm using LEDE, not openwrt, so iw is not supported

@mk24 @slh
Sorry guys. iwconfig has a problem sometimes, so i cannot use it.

Since iw is not supported, how can i get it?

Upgrade.. ?

1 Like

The output is not stream. It is just as a pop message of the sys log.

1 Like