Ubus: `hostapd.$interface` object only available after radio is `ENABLED`

Hello everyone,

I am trying to expose DFS information of the radios via prometheus-node-exporter-lua.

Luckily hostapd.$interface.get_status already exposes the relevant information:

root@ap~# ubus call hostapd.wlan1 get_status | grep -A4 dfs
        "dfs": {
                "cac_seconds": 60,
                "cac_active": false,
                "cac_seconds_left": 0
        }

Unfortunately it seems that the hostapd.$interface object is only available after the status of the interface changed to ENABLED.

When the radio is still in the DFS phase ubus simply returns:

Command failed: Not found

My gut tells me that the same thing happens if the radio is in the ACS phase (or in anything that is not ENABLED).

Is this by design ? And if so is there a chance that we could "unlock" the hostapd objects in the initialization state of the interface/radio ?

This would enable us to monitor the interface state (is the radio still in ACS, DFS etc. ?).

Thank you all so much :slight_smile:

It is by design. If there is an DFS event it is required to take down the wifi sending on this channel(s)/frequencies instantly. So the interface is getting disabled. It is done because you don't have a valid frequency to operate. If a new free channel/frequency is found wifi will be enabled again. Hostapd is started with new setup.

The only thing I could imagine regarding this is to enable/increasing debugging level for hostapd (in wpad service). If there is an DFS event it is logged in logread already. But AFAIR the "-dd" option is stripped out via source code. So you would have to enable it explicit making your own builds. I remember there was a thread reagarding this ... There it is: