How does rrm work?

Hi there

I have 2 x dual band access points located in the house (tplink archer C7). I'm using 802.11k neighbour lists sourced via the script below.

This script runs on each AP via a cronjob every 5 minutes and polls the other AP and itself for the neighbour information which is then populated into the neighbour list. Both APs run the same SSID on both bands. Obviously the remotehost variable points to other AP. The script is clunky but does the job for my situation. SSH keys are setup on each AP to allow access from each other.

Hope this helps.

remotehost="192.168.5.20"
nljson="'{ \"list\": [ "
nljson=$nljson"$(ubus call hostapd.wlan0 rrm_nr_get_own | jsonfilter -e '$.value'),"
error=$?
nljson=$nljson"$(ubus call hostapd.wlan1 rrm_nr_get_own | jsonfilter -e '$.value'),"
error=$(( $error + $? ))
nljson=$nljson"$(ssh root@$remotehost ubus call hostapd.wlan0 rrm_nr_get_own | jsonfilter -e '$.value'),"
error=$(( $error + $? ))
nljson=$nljson"$(ssh root@$remotehost ubus call hostapd.wlan1 rrm_nr_get_own | jsonfilter -e '$.value')"
error=$(( $error + $? ))
nljson=$nljson" ] }'"
if [ "$error" == 0 ]; then
	ubus call hostapd.wlan0 bss_mgmt_enable '{"neighbor_report": true}'
	error=$(( $error + $? ))
	ubus call hostapd.wlan1 bss_mgmt_enable '{"neighbor_report": true}'
	error=$(( $error + $? ))
	eval "ubus call hostapd.wlan0 rrm_nr_set $nljson"
	error=$(( $error + $? ))
	eval "ubus call hostapd.wlan1 rrm_nr_set $nljson"
	error=$(( $error + $? ))
else
	ubus call hostapd.wlan0 bss_mgmt_enable '{"neighbor_report": false}'
	error=$(( $error + $? ))
	ubus call hostapd.wlan1 bss_mgmt_enable '{"neighbor_report": false}'
	error=$(( $error + $? ))
fi
if [ "$error" == 0 ]; then
	logger "SUCCESS: 802.11k neighbours set ok"
else
	logger "ERROR: 802.11k neighbours not set"
fi
1 Like