DFS not starting

Your channel setting looks wrong. It should just be set to the idx of the channel you want to use.
This seems to have also thrown the vht seg idx's out as well

vht_oper_centr_freq_seg0_idx=-6

Can you post your /etc/config/wireless as well? But fixing your channel to be the correct spec should bring everything online.

Does it matter that the hostapd-phy1.conf has the driver=nl80211 instead of mac80211? I don't know where to change that.

Here is the /etc/config/wireless.

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'pci0000:00/0000:00:01.0/0000:02:00.0'
        option country 'US'
        option frag '2346'
        option rts '2347'
        option htmode 'HT40'
        option channel '1'
        option legacy_rates '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid '#rnetwork-2G'
        option key 'password'
        option encryption 'psk2+ccmp'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
        option country 'US'
        option legacy_rates '0'
        option frag '2346'
        option rts '2347'
        option channel 'auto'
        option htmode 'VHT80'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid '#rnetwork'
        option encryption 'psk2+ccmp'
        option key 'password'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option ssid 'rnetwork-2G_Guest'
        option encryption 'psk2+ccmp'
        option key 'password'

config wifi-iface                      
        option device 'radio1'         
        option mode 'ap'               
        option ssid 'rnetwork_Guest'   
        option encryption 'psk2+ccmp'  
        option key 'password'          
        option network 'guest'         
        option isolate '1'
root@RROUTER:~# hostapd -dd -t -P /var/run/wifi-phy1.pid /var/run/hostapd-phy1.conf
1531361536.155014: Configuration file: /var/run/hostapd-phy1.conf
1531361536.184156: nl80211: Could not configure driver mode
1531361536.184261: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
1531361536.185474: nl80211 driver initialization failed.
1531361536.185580: wlan1: interface state UNINITIALIZED->DISABLED
1531361536.186281: wlan1-1: AP-DISABLED 
1531361536.186377: wlan1-1: CTRL-EVENT-TERMINATING 
1531361536.186416: hostapd_free_hapd_data: Interface wlan1-1 wasn't started
1531361536.186963: wlan1: AP-DISABLED 
1531361536.187042: wlan1: CTRL-EVENT-TERMINATING 
1531361536.187436: hostapd_free_hapd_data: Interface wlan1 wasn't started

as well

option channel 'auto'

This is the problem. Change it.
You should also consider removing all the custom settings like frag and rts. Get a baseline config that works running, then modify from there.
Don’t run before you can walk :wink:

1 Like

What should it be set to? I want it to auto scan for channels then pick one.

Openwrt doesn't do that

I don't think such a functionality exists (or is implemented). And in fact, i think 'auto' as far as the Luci interface is concerned just means "lowest usable channel" i.e. 1 or 36 depending on band.

Just statically set it to 36 to begin to see that it comes up.
Then try setting it to one of the DFS channels and see if it works. Note that when doing so you should see a message in the log along the lines of "CAC-STARTED", and then 60 seconds later "CAC-COMPLETED". Once this message is seen the interface will either come up or fail to start depending on outcome.

Yes 'auto' is an alias for the first channel in the list, which in most cases is 36 and not a DFS channel. You have to specify the number of a DFS channel which is allowed in your country. It will then either operate on that channel (after listening for radar for 60 seconds), or try another DFS channel if radar is detected.

Okay I picked my channel of 52 which for US requires DFS but from the log I see that it is having some issues probe_req: send failed? Anyone know what that means?

Wed Jul 11 21:26:04 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Wed Jul 11 21:26:04 2018 kern.info kernel: [ 6720.431670] device wlan1 left promiscuous mode
Wed Jul 11 21:26:04 2018 kern.info kernel: [ 6720.440809] br-lan: port 3(wlan1) entered disabled state
Wed Jul 11 21:26:05 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy1.conf
Wed Jul 11 21:26:05 2018 kern.info kernel: [ 6721.636475] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
Wed Jul 11 21:26:05 2018 kern.info kernel: [ 6721.657151] br-lan: port 3(wlan1) entered blocking state
Wed Jul 11 21:26:05 2018 kern.info kernel: [ 6721.668176] br-lan: port 3(wlan1) entered disabled state
Wed Jul 11 21:26:05 2018 kern.info kernel: [ 6721.679513] device wlan1 entered promiscuous mode
Wed Jul 11 21:26:05 2018 daemon.notice hostapd: wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
Wed Jul 11 21:26:05 2018 daemon.notice hostapd: wlan1: interface state COUNTRY_UPDATE->HT_SCAN
Wed Jul 11 21:26:06 2018 daemon.notice hostapd: wlan1: interface state HT_SCAN->DFS
Wed Jul 11 21:26:06 2018 daemon.notice hostapd: wlan1: DFS-CAC-START freq=5260 chan=52 sec_chan=1, width=1, seg0=58, seg1=0, cac_time=60s
Wed Jul 11 21:26:10 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:20 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:26 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:26 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:26 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:26 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:32 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:32 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:37 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:59 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:59 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:59 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:26:59 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:27:06 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:27:06 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:27:10 2018 daemon.notice hostapd: handle_probe_req: send failed
Wed Jul 11 21:27:11 2018 daemon.notice hostapd: wlan1: DFS-CAC-COMPLETED success=1 freq=5260 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5290 cf2=0
Wed Jul 11 21:27:11 2018 daemon.err hostapd: Using interface wlan1 with hwaddr a4:99:4d:de:05:1a and ssid "#rnetwork"

I won't say "that's fine", as it surely indicates some error has occurred. But i can say that i see the same message and have not seen any adverse affects. Maybe @jow could comment on what this error actually indicates?

The important messages in your log are

hostapd: wlan1: DFS-CAC-START freq=5260 chan=52 sec_chan=1, width=1, seg0=58, seg1=0, cac_time=60s
...
hostapd: wlan1: DFS-CAC-COMPLETED success=1 freq=5260 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5290 cf2=0

Looks good!

Hi tekdancerob
I have been trying to get DFS to work for my AP (Nanostation M5) but it doesn't seem to startup. I have setup everything same as you and I have problem same as your problem.
my AP log is:

Tue Oct 15 12:31:19 2019 daemon.err hostapd: Configuration file: /var/run/hostapd-phy0.conf
Tue Oct 15 12:31:20 2019 kern.info kernel: [  687.144652] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Tue Oct 15 12:31:20 2019 kern.info kernel: [  687.183654] br-lan: port 2(wlan0) entered blocking state
Tue Oct 15 12:31:20 2019 kern.info kernel: [  687.189056] br-lan: port 2(wlan0) entered disabled state
Tue Oct 15 12:31:20 2019 kern.info kernel: [  687.194908] device wlan0 entered promiscuous mode
Tue Oct 15 12:31:20 2019 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Tue Oct 15 12:31:20 2019 daemon.notice hostapd: wlan0: interface state COUNTRY_UPDATE->DFS
Tue Oct 15 12:31:20 2019 daemon.notice hostapd: wlan0: DFS-CAC-START freq=5260 chan=52 sec_chan=0, width=0, seg0=0, seg1=0, cac_time=60s
Tue Oct 15 12:32:05 2019 daemon.notice hostapd: handle_probe_req: send failed
Tue Oct 15 12:32:23 2019 daemon.notice hostapd: wlan0: DFS-CAC-COMPLETED success=1 freq=5260 ht_enabled=1 chan_offset=0 chan_width=1 cf1=5260 cf2=0
Tue Oct 15 12:32:23 2019 daemon.err hostapd: Using interface wlan0 with hwaddr fc:ec:da:6a:60:ef and ssid "UBNT1"
Tue Oct 15 12:32:23 2019 kern.info kernel: [  750.611300] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Tue Oct 15 12:32:23 2019 kern.info kernel: [  750.618249] br-lan: port 2(wlan0) entered blocking state
Tue Oct 15 12:32:23 2019 kern.info kernel: [  750.623725] br-lan: port 2(wlan0) entered forwarding state
Tue Oct 15 12:32:23 2019 daemon.notice hostapd: wlan0: interface state DFS->ENABLED
Tue Oct 15 12:32:23 2019 daemon.notice hostapd: wlan0: AP-ENABLED
Tue Oct 15 12:32:23 2019 daemon.notice netifd: Network device 'wlan0' link is up

and:

root@OpenWrt:/sys/kernel/debug/ieee80211/phy0/ath9k# cat dfs_stats
DFS support for macVersion = 0x300, macRev = 0x2: disabled
Pulse detector statistics:
    pulse events reported    :        170
    invalid pulse events     :          2
    DFS pulses detected      :        168
    Datalen discards         :          0
    RSSI discards            :          0
    BW info discards         :          0
    Primary channel pulses   :        168
    Secondary channel pulses :          0
    Dual channel pulses      :          0
Radar detector statistics (current DFS region: 2)
    Pulse events processed   :        168
    Radars detected          :          0
Global Pool statistics:
    Pool references          :          7
    Pulses allocated         :         25
    Pulses alloc error       :          0
    Pulses in use            :          7
    Seqs. allocated          :          6
    Seqs. alloc error        :          0
    Seqs. in use             :          0

I do not what is my problem. what is my wrong?
tanks

The log shows nothing wrong, it went to AP-ENABLED state so it should be on the air.

Does iw dev show the wlan0 AP operating on 5260?

I generated radar signal but this AP did not change operating channel. and the log show "Radars detected:0" this AP work with ath9k driver. but another AP that work with ath10k driver detect same radar signal and change operating channel.
log of another AP is:

root@OpenWrt:/sys/kernel/debug/ieee80211/phy0/ath10k# cat dfs_stats
Pulse detector statistics:
reported phy errors          :        144
pulse events reported        :        144
DFS pulses detected          :         65
DFS pulses discarded         :         78
Radars detected              :          0
Global Pool statistics:
Pool references              :          9
Pulses allocated             :          9
Pulses alloc error           :          0
Pulses in use                :          7
Seqs. allocated              :          0
Seqs. alloc error            :          0
Seqs. in use                 :          0
Last-DFS-Msg:
root@OpenWrt:/sys/kernel/debug/ieee80211/phy0/ath10k# cat dfs_stats
Pulse detector statistics:
reported phy errors          :        666
pulse events reported        :        666
DFS pulses detected          :        568
DFS pulses discarded         :         97
Radars detected              :         32
Global Pool statistics:
Pool references              :          9
Pulses allocated             :         20
Pulses alloc error           :          0
Pulses in use                :         19
Seqs. allocated              :          3
Seqs. alloc error            :          0
Seqs. in use                 :          3
Last-DFS-Msg:

and:

Thu Oct 17 09:19:35 2019 daemon.err hostapd: Configuration file: /var/run/hostapd-phy0.conf
Thu Oct 17 09:19:36 2019 kern.warn kernel: [ 2766.209142] ath10k_pci 0000:00:00.0: 10.1 wmi init: vdevs: 16  peers: 127  tid: 256
Thu Oct 17 09:19:36 2019 kern.info kernel: [ 2766.226095] ath10k_pci 0000:00:00.0: wmi print 'P 128 V 8 T 410'
Thu Oct 17 09:19:36 2019 kern.info kernel: [ 2766.232858] ath10k_pci 0000:00:00.0: wmi print 'msdu-desc: 1424  sw-crypt: 0 ct-sta: 0'
Thu Oct 17 09:19:36 2019 kern.info kernel: [ 2766.241180] ath10k_pci 0000:00:00.0: wmi print 'alloc rem: 24648 iram: 26168'
Thu Oct 17 09:19:36 2019 kern.warn kernel: [ 2766.306239] ath10k_pci 0000:00:00.0: pdev param 0 not supported by firmware
Thu Oct 17 09:19:36 2019 kern.info kernel: [ 2766.321291] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Thu Oct 17 09:19:36 2019 kern.info kernel: [ 2766.330963] br-lan: port 2(wlan0) entered blocking state
Thu Oct 17 09:19:36 2019 kern.info kernel: [ 2766.336505] br-lan: port 2(wlan0) entered disabled state
Thu Oct 17 09:19:36 2019 kern.info kernel: [ 2766.342266] device wlan0 entered promiscuous mode
Thu Oct 17 09:19:36 2019 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Thu Oct 17 09:19:36 2019 daemon.notice hostapd: wlan0: interface state COUNTRY_UPDATE->HT_SCAN
Thu Oct 17 09:19:36 2019 daemon.notice hostapd: wlan0: interface state HT_SCAN->DFS
Thu Oct 17 09:19:36 2019 daemon.notice hostapd: wlan0: DFS-CAC-START freq=5500 chan=100 sec_chan=1, width=1, seg0=106, seg1=0, cac_time=60s
Thu Oct 17 09:20:19 2019 daemon.info dnsmasq-dhcp[1699]: DHCPINFORM(br-lan) 192.168.20.106 6c:f0:49:6f:ac:6b
Thu Oct 17 09:20:19 2019 daemon.info dnsmasq-dhcp[1699]: DHCPACK(br-lan) 192.168.20.106 6c:f0:49:6f:ac:6b Accountant2
Thu Oct 17 09:20:19 2019 daemon.warn dnsmasq-dhcp[1699]: Error sending DHCP packet to 192.168.20.106: Network unreachable
Thu Oct 17 09:20:39 2019 daemon.notice hostapd: wlan0: DFS-CAC-COMPLETED success=1 freq=5500 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5530 cf2=0
Thu Oct 17 09:20:39 2019 daemon.err hostapd: Using interface wlan0 with hwaddr b4:fb:e4:15:24:63 and ssid "UBNT1"
Thu Oct 17 09:20:39 2019 daemon.notice hostapd: wlan0: interface state DFS->ENABLED
Thu Oct 17 09:20:39 2019 kern.info kernel: [ 2829.323972] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Thu Oct 17 09:20:39 2019 kern.info kernel: [ 2829.330740] br-lan: port 2(wlan0) entered blocking state
Thu Oct 17 09:20:39 2019 kern.info kernel: [ 2829.336231] br-lan: port 2(wlan0) entered forwarding state
Thu Oct 17 09:20:39 2019 daemon.notice hostapd: wlan0: AP-ENABLED
Thu Oct 17 09:20:39 2019 daemon.notice netifd: Network device 'wlan0' link is up
Thu Oct 17 09:21:02 2019 daemon.notice hostapd: wlan0: DFS-RADAR-DETECTED freq=5500 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5530 cf2=0
Thu Oct 17 09:21:02 2019 daemon.notice hostapd: wlan0: DFS-NEW-CHANNEL freq=5180 chan=36 sec_chan=1
Thu Oct 17 09:21:02 2019 daemon.notice hostapd: wlan0: DFS-RADAR-DETECTED freq=5500 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5530 cf2=0

Thu Oct 17 09:21:02 2019 daemon.notice hostapd: wlan0: DFS-RADAR-DETECTED freq=5500 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5530 cf2=0
Thu Oct 17 09:21:02 2019 daemon.notice hostapd: wlan0: DFS-RADAR-DETECTED freq=5500 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5530 cf2=0
Thu Oct 17 09:21:02 2019 daemon.notice hostapd: wlan0: DFS-RADAR-DETECTED freq=5500 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5530 cf2=0
Thu Oct 17 09:21:02 2019 daemon.notice hostapd: wlan0: DFS-RADAR-DETECTED freq=5500 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5530 cf2=0
Thu Oct 17 09:21:03 2019 daemon.notice hostapd: handle_probe_req: send failed
Thu Oct 17 09:21:03 2019 daemon.notice hostapd: handle_probe_req: send failed
Thu Oct 17 09:21:03 2019 daemon.info hostapd: wlan0: IEEE 802.11 driver had channel switch: freq=5180, ht=1, vht_ch=0x0, offset=1, width=3 (80 MHz), cf1=5210, cf2=0
Thu Oct 17 09:21:03 2019 daemon.notice hostapd: wlan0: AP-CSA-FINISHED freq=5180 dfs=0
  • You have a military-grade aircraft radar in your test area?
  • Perhaps it was recorded as a pulse event?

Actually OpenWRT (hostapd) can auto choose a wifi channel just fine.
There is also an option to ignore DFS channels.
(Recently added in trunk but doesn't work on mwlwifi. But there is a work around: Use the ACS channel bias option to boost none dfs channels.)
//edit
channels option seems to work better:

2.4Ghz
option channels '1 6 11'
....
5Ghz 20Mhz Channel width
option channels '36 40 44 48'
...
5Ghz 40Mhz Channel width
option channels '36 44'

I use "HackRF One" hardware + "GNURadio" software to generating radar signal. In this test, I use a type 4 pattern with a pulse width of 15 µs and a pulse repetition interval of 250 µs. The radar signal pattern looks like this:


two AP with openwrt firmware tested at the same time. one of them work with ath9k driver that can not change operating channel and another one work with ath10k driver that change operating channel when HackRF One start generating type 4 pattern radar signal.I think ath9k have a bug or do not support atheros wireless chip for IEEE802.11a/n

In the case of the US, the FCC defines 5 different short pulse radar test waveforms:

1 Like

What device that uses ath9k is subject to DFS between band and age?

Plenty.
Almost the entire WNDR3700/WR1043ND range.
WNDR3800.

Off the top of my head without thinking hard. Most of those are still pretty valid entry level devices (missing Wifi 5 support, slow/single core processors).

It's also very refreshing to see someone using proper (at least consumer grade) test equipment to verify functionality. I'm now following this thread but can't offer any good advice at this stage.

1 Like

Nanostation M5.
you can see log of this device in my first post