Mikrotik R11e-5HacT hostapd config

Hi everyone. First post for me.

The reason it's my first post is because I'm not actually using OpenWRT, so please free to ignore this topic entirely, but let me tell you, I'm desperate.

A couple of years ago I bought a PCEngines apu4c4 and a Mikrotik R11e-5HacT. It took me a couple of tries to get it working, mostly because I thought this was easier to do and I have no real knowledge of low level wireless stuff.

Thing is, my experience with this setup, and I think it's more related to the WiFi card, has been really flaky. For instance, once, and mostly by accident, I managed to make it work at 80[some_unit] wide channel, which is what I was pursuing from the beginning, bus as I was running hostapd by hand so I could read log messages as they happened, when I restarted it with systemctl so it would be automatically managed by the system, hostapd failed entirely.

At some point I found the recommended config in the driver's page, which worked for a week until I had to reboot the machine.

Right now it happened that I could configure it using ansible, but when I relaunched it on the terminal (again, debugging stuff) and right now I'm getting:

nl80211: Failed to start radar detection: -16 (Device or resource busy)
DFS start_dfs_cac() failed, -1
Interface initialization failed
wlp5s0: interface state DFS->DISABLED
[...]
nl80211: Frame command failed: ret=-22 (Invalid argument) (freq=0 wait=0)

so what I came here to do is to beg you, specially to @neheb, please share your hostapd config? Here's mine:

# most of the config taken from
# https://wireless.wiki.kernel.org/en/users/drivers/ath10k/configuration#full_hostapd_configuration
# unless specified

# for the original config file, see
# https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf

interface=wlp5s0
driver=nl80211

##### IEEE 802.11 related configuration #######################################
ssid=mmlm

hw_mode=a
channel=0

# don't touch
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
# fragm_threshold=2346

##### DFS #####################################################################
ieee80211d=1
ieee80211h=1
country_code=FR

###### Don't touch ANYTHING below #############################################

###### WMM ####################################################################
wmm_enabled=1

# Low priority / AC_BK = background
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10

# Normal priority / AC_BE = best effort
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7

# High priority / AC_VI = video
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188

# Highest priority / AC_VO = voice
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102

###### TX queue parameters ####################################################
tx_queue_data3_aifs=7
tx_queue_data3_cwmin=15
tx_queue_data3_cwmax=1023
tx_queue_data3_burst=0
tx_queue_data2_aifs=3
tx_queue_data2_cwmin=15
tx_queue_data2_cwmax=63
tx_queue_data2_burst=0
tx_queue_data1_aifs=1
tx_queue_data1_cwmin=7
tx_queue_data1_cwmax=15
tx_queue_data1_burst=3.0
tx_queue_data0_aifs=1
tx_queue_data0_cwmin=3
tx_queue_data0_cwmax=7
tx_queue_data0_burst=1.5

I removed everything not dedicated to set wireless modes, like auth or the like. Thanks for any light shed on this.

1 Like

I don't have this card. But I have a different ath10k /802.11ac based Mikrotik device running openwrt (hap ac)

  • check dmesg, and make sure you're successfully loading the firmware, there should be a firmware version in the logs - if you're having trouble locating the line it's probably a bad sign.
    (you can try rmmod and modprobe, restarting the kernel module should produce some logs)
  • try using channel=36 (doesn't require DFS anywhere), or channel=149 (doesn't require DFS, but is fairly low power in Europe).

Let me know if you need me to pull logs for reference, or check versions of things.

The firmware loads, it has done so since the beginning. In fact it seems my issue is that channel auto detection is returning a channel that requires DSF, but DFS is disabled in the kernel. So I either use a channel without (36-44) or i recompile my kernel, which is way beyond my allotted time for this.

yeah, like I said, that did it :slight_smile:

so are you looking to iw reg set FR or something similar and use DFS or .. are you happy on 36?

this is not done by hostapd itself?

happy? no, most of the neighbors are there, bus as I said, the kernel has no DFS support and recompiling is out of my time budget for this (work, kids, other projects are more important right now).