OCS - Offchannel Channel Scan is not working

I am currently using the Morse Micro MM6108 HaLow in mesh mode.

I am looking a tool which monitors channel usage and occupancy. I found “OCS” Off Channel Scan comes with ‘morsectrl’ utility which temporarily switch to the off channel in question, and perform an assessment using the PHY channel metric.

I tried ocs commands but it throws error as below,

morsectrl -i morse1 ocs config -c 910000 -o 2 -p 1 -n 0
[  287.565863] morse_sdio mmc1:0001:2: Command 0x0038:1d00 error -1
[  287.571950] morse_sdio mmc1:0001:2: Command morse_cmd_ocs_req 38:1d00 failed with rc -1 (0xffffffff)
[  287.581227] morse_sdio mmc1:0001:2: morse_cmd_vendor error -1
ocs: Error -1 in sending MORSE_COMMAND_OCS_REQ

morsectrl -i morse1 ocs config -c 923000 -o 2 -p 1 -n 0
[  294.233538] morse_sdio mmc1:0001:2: Command 0x0038:1d10 error -1
[  294.239614] morse_sdio mmc1:0001:2: Command morse_cmd_ocs_req 38:1d10 failed with rc -1 (0xffffffff)
[  294.248825] morse_sdio mmc1:0001:2: morse_cmd_vendor error -1
ocs: Error -1 in sending MORSE_COMMAND_OCS_REQ

 morsectrl -i morse1 ocs status
[ 9133.666022] morse_sdio mmc1:0001:2: Command 0x0038:2250 error -1
[ 9133.672182] morse_sdio mmc1:0001:2: Command morse_cmd_ocs_req 38:2250 failed with rc -1 (0xffffffff)
[ 9133.681415] morse_sdio mmc1:0001:2: morse_cmd_vendor error -1
ocs: Error -1 in sending MORSE_COMMAND_OCS_REQ

Below is current channel configuration,

morsectrl -i morse1 channel
Full Channel Information
        Operating Frequency: 909000 kHz
        Operating BW: 2 MHz
        Primary BW: 1 MHz
        Primary Channel Index: 0

Halow interface is configured in mesh mode,

iw dev morse1 info
Interface morse1
        ifindex 4
        wdev 0x1
        addr 1c:bc:ec:1b:32:90
        type mesh point
        wiphy 0
        channel 52 (5260 MHz), width: 40 MHz, center1: 5270 MHz
        txpower 24.00 dBm

Driver Version:
morsectrl -i morse1 -version
Morsectrl Version: rel_1_11_2_2024_Feb_26

Could please check on this issue and assist us to make OCS working?

Please let me know if any information is required from my side.

Hi @tirth21

Unfortunately the ocs commands in morsectrl will only work when the device is in an AP mode. Reading the off channel scan report also requires the use of netlink to send and read the response of a specific vendor command. Let me know if you want more information on this.


I would have expected you to be able to perform scans on specific 802.11ac mapped channels (for example, with iw dev morse1 scan freq 5805) to build up survey data, and then read the information back with iw dev morse1 survey dump. This approach would cause a minor interruption to mesh connectivity.

Unfortunately this isn’t working in the 802.11s style mesh mode. I’ve raised this with the team.

I’ll update this thread if we identify a workaround for the scan approach. The chip firmware is collecting this data, it’s just not propagating up the stack.

Hi @ajudge

Thanks for the reply.

Unfortunately the ocs commands in morsectrl will only work when the device is in an AP mode.

→ I configured AP mode to test ocs. This time its not giving errors as before but still I didnt get proper output.

# iw dev morse1 info
    Interface morse1
        ifindex 3
        wdev 0x1
        addr 1c:bc:ec:1b:32:c5
        ssid MY_SSID
        type AP
        wiphy 0
        channel 52 (5260 MHz), width: 20 MHz, center1: 5260 MHz
        txpower 24.00 dBm

# morsectrl -i morse1 channel
    Full Channel Information
        Operating Frequency: 908500 kHz
        Operating BW: 1 MHz
        Primary BW: 1 MHz
        Primary Channel Index: 0

# morsectrl -i morse1 ocs status
    ocs_cfm_status: running 0

# morsectrl -i morse1 ocs config -c 906500 -o 1 -p 1 -n 0

# morsectrl -i morse1 ocs config -c 908500 -o 1 -p 1 -n 0

# morsectrl -i morse1 ocs status
    ocs_cfm_status: running 0

Reading the off channel scan report also requires the use of netlink to send and read the response of a specific vendor command. Let me know if you want more information on this.

→ Can you share some information on this?

I would have expected you to be able to perform scans on specific 802.11ac mapped channels (for example, with iw dev morse1 scan freq 5805) to build up survey data, and then read the information back with iw dev morse1 survey dump. This approach would cause a minor interruption to mesh connectivity.

→ I tried this too in mesh mode but its only giving ‘channel active time’ and ‘channel receive time’.

Survey data from morse1

    frequency:                      5180 MHz
    noise:                          -110 dBm
    channel active time:            77 ms
    channel receive time:           1 ms

It doesnt give ‘channel busy time’ stat like 802.11 n/ac.
Where can I find 802.11 ac to Halow frequency mapping?

Hi @tirth21,

There is a fairly simple channel mapping in the form of a csv file on our eval kits under /usr/share/morse-regdb/channels.csv. This is used by much of the OpenWrt user space tooling to unravel the 5g mapping.
The last column of that csv contains the 802.11ac mapped center channel. iw phy <phy> channels will let you map that center channel back to a frequency value.

Unfortunately we do not support the channel busy time metric. Historically this looks like it was implemented by Atheros chips. ACS in hostap falls back to use the channel RX time when the busy metric is unavailable.

Thanks @ajudge for the reply.
I could find CSV file in devkit and trying to get survey dump.

Can you please share information on below you mentioned for OCS ?

Reading the off channel scan report also requires the use of netlink to send and read the response of a specific vendor command. Let me know if you want more information on this.

Hey @tirth21,

We have an internal application which does this, unfortunately it’s not available publicly yet.

I’m preparing a minimal version for you, and will aim to get it to you early to mid next week!

Hello @ajudge

Can you please share this if that is prepared?

Hi @tirth21,

Sorry for the delay. I’ve pushed an example of using netlink to make off channel scan requests and parse the resulting event response to a repo in my personal GitHub here: openwrt-utils/ocs at main · morse-arienjudge/openwrt-utils · GitHub.

As this tool does rely on libnl libraries and cross compilation. I found it easier to bundle it into a fairly empty OpenWrt feed to leverage the OpenWrt build system. You may choose to compile it however suits you. But feel free to follow the steps in the top level README for adding the repo to your OpenWrt feeds. Also see [OpenWrt Wiki] OpenWrt Feeds for specific information relating to OpenWrt feeds.

For your benefit, I kept most error handling and input validation to a minimum. I find this helps me better understand the fundamental structure and logic of a complex API like netlink without getting lost in the details of error handling. This does mean the tool is unsuitable for production use as-is. I highly encourage reviewing the source code and improving input validation and error handling throughout the source.

Usage example below:

root@ekh03-680889:~# ocs wlan0 922000 4 2 2
Triggering off-channel scan on wlan0 at 922000 kHz...
922000 kHz (bw: 4, pw: 2, pi: 2):
        Listen time: 30847 us
        RX time: 0 us
        Noise: -88 dBm

Hope it helps.