linuxwifiopenwrthostapd

How to get RSSI in a linux AP (iw station dump doesn't work)


I'm trying to measure the RSSI from a station connected to my AP which is running OpenWRT. I know that by using iw wlan0 station dump or iw wlan0 station get [MAC], I should be able to see it. Though for some reason it doesn't show the RSSI on my AP.

Here is the output that I get:

~# iw wlan0 station get 40:b0:fa:c1:75:41

Station 40:b0:fa:c1:75:41 (on wlan0)
inactive time:  75 ms
rx bytes:   17588
rx packets: 134
tx bytes:   10771
tx packets: 76
tx retries: 3
tx failed:  0
tx bitrate: 6.0 MBit/s
rx bitrate: 6.0 MBit/s
authorized: yes
authenticated:  yes
preamble:   short
WMM/WME:    yes
MFP:        no
TDLS peer:  no

I'm running hostapd and dnsmasq. Any ideas of how I can get the RSSI? Maybe somehow in C?

Thanks!

UPDATE

I was checking the code of iw, and for some reason NL80211_STA_INFO_SIGNAL comes up NULL - If anyone has an idea of why this could be happening, would be a great help!

UPDATE 2

Apperently the source of iw in the project I was working was changed and the line with the RSSI for some reason has been commented. This change has never been documented. Thank you for everyone that answered this question.


Solution

  • although it was posted long ago.. may be helpful

    did you try :

    sudo iw dev wlan0 station get [MAC]
    

    (change [MAC] to STA mac address)

    there is field "signal" if that help you.