GL.iNET Flint 2 (GL-MT6000) discussions

It appears your AP detected a DFS channel and couldn’t find a viable channel to prevent interference, so it decided to shutdown that interface.

So it will keep happening in the future as well? What can I do to prevent this?

From ssh, give us the output of these commands:

  1. grep -E "80211[dh]" /tmp/run/hostapd-phy1.conf
  2. iw reg get
  3. uci show | grep radio1 | grep -v key
1 Like

Can't say much as I have M2 Macbook Pro and I've seen similar issues with both MT6000 and QCA based HE dev kits running QSDK

The recent FW drops for iphone/ipad (18.0), Mac (15.0), and TvOS (15.0) - there's a lot under the hood that's changed with the network stack and wifi specifically...

So packet steering is broken in 23.05.5?

He's running HE160, and there, the default Primary/Control Channel is 52 (5260Mhz), squarely in DFS space, so the firmware gets stuck into a loop...

One thing to try is setting the control channel to 46

hth...

A script that acts like wifi analyzer. It may help assuming the OP is US based...

#!/bin/bash

# Function to calculate and suggest the best channel based on SNR and congestion using scan data
get_best_channel() {
    local interface="$1"
    local band="$2"

    echo "Scanning Wi-Fi environment on interface $interface for $band..."

    # Use `iw scan` to gather information about nearby APs
    if ! iw dev "$interface" scan > /tmp/wifi_scan_results.txt 2>/dev/null; then
        echo "Error: Failed to scan Wi-Fi networks using interface $interface"
        exit 1
    fi

    # Initialize channel counters and SNR totals based on selected band
    declare -A channel_count
    declare -A channel_snr

    if [ "$band" = "2g" ]; then
        # Channels for 2.4 GHz in the US (1, 6, 11)
        for channel in 1 6 11; do
            channel_count[$channel]=0
            channel_snr[$channel]=0
        done
    elif [ "$band" = "5g" ]; then
        # Valid 5 GHz channels in the US
        for channel in 36 40 44 48 149 153 157 161 165; do
            channel_count[$channel]=0
            channel_snr[$channel]=0
        done
    else
        echo "Error: Invalid band selection. Use --2g or --5g."
        exit 1
    fi

    # Parse the scan data to populate channel usage and SNR
    current_freq=""
    current_signal=""
    while read -r line; do
        # Extract frequency
        if echo "$line" | grep -q "freq:"; then
            current_freq=$(echo "$line" | awk '{print $2}')
            if [ "$band" = "2g" ] && [ "$current_freq" -ge 2412 ] && [ "$current_freq" -le 2472 ]; then
                current_channel=$(( ($current_freq - 2407) / 5 ))
                if [[ ! "$current_channel" =~ ^(1|6|11)$ ]]; then
                    current_channel=""
                fi
            elif [ "$band" = "5g" ] && [ "$current_freq" -ge 5180 ] && [ "$current_freq" -le 5825 ]; then
                current_channel=$(( ($current_freq - 5000) / 5 ))
                # Only consider valid 5 GHz channels for the US
                if [[ ! "$current_channel" =~ ^(36|40|44|48|149|153|157|161|165)$ ]]; then
                    current_channel=""
                fi
            else
                current_channel=""
            fi
        fi

        # Extract signal level and update counters
        if [ -n "$current_channel" ] && echo "$line" | grep -q "signal:"; then
            current_signal=$(echo "$line" | awk '{print $2}' | cut -d'.' -f1)
            # Convert RSSI to a positive number to calculate SNR (assume noise level is -95 dBm)
            snr=$((95 + current_signal))

            # Update channel usage count and SNR total
            channel_count[$current_channel]=$((channel_count[$current_channel] + 1))
            channel_snr[$current_channel]=$((channel_snr[$current_channel] + snr))
        fi
    done < /tmp/wifi_scan_results.txt

    # Output the channel analysis in a professional manner
    echo -e "\nChannel Analysis for $band Band:"
    echo "-------------------------------------------------"
    printf "%-10s %-15s %-15s %-10s\n" "Channel" "Congestion Count" "Average SNR (dB)" "Graph"
    echo "-------------------------------------------------"

    # Find the channel with the least congestion and best SNR
    best_channel=1
    best_score=-9999
    for channel in "${!channel_count[@]}"; do
        if [ "${channel_count[$channel]}" -gt 0 ]; then
            avg_snr=$((channel_snr[$channel] / channel_count[$channel]))
        else
            avg_snr=100  # If no networks are found, assume high SNR (low interference)
        fi

        # Print channel statistics
        congestion="${channel_count[$channel]}"
        snr="$avg_snr"
        # Create a graphical representation of congestion (bars) for easier visualization
        bar=$(printf "%0.s█" $(seq 1 $((congestion + 1))))
        printf "%-10s %-15s %-15s %-10s\n" "$channel" "$congestion" "$snr" "$bar"

        # Prioritize zero congestion channels with high SNR
        if [ "$congestion" -eq 0 ]; then
            score=$snr
        else
            score=$((snr - congestion))
        fi

        if [ "$score" -gt "$best_score" ]; then
            best_score=$score
            best_channel=$channel
        fi
    done

    # Output the suggested best channel
    echo "-------------------------------------------------"
    echo -e "\nRecommended Channel for $band Band: $best_channel"
    echo "-------------------------------------------------"
}

# Main script logic
if [ "$1" == "--2g" ]; then
    get_best_channel "phy0-ap0" "2g"
elif [ "$1" == "--5g" ]; then
    get_best_channel "phy1-ap0" "5g"
else
    echo "Usage: $0 [--2g | --5g]"
    echo "  --2g : Scan and suggest the best channel for 2.4 GHz"
    echo "  --5g : Scan and suggest the best channel for 5 GHz"
    exit 1
fi

Updated. still may temp lose connected wifi when scanning.

#!/bin/bash

# Function to calculate and suggest the best channel based on signal strength and congestion using scan data
get_best_channel() {
    local interface="$1"
    local band="$2"

    echo "Scanning Wi-Fi environment on interface $interface for $band..."

    # Use `iw scan` to gather information about nearby APs
    if ! iw dev "$interface" scan > /tmp/wifi_scan_results.txt 2>/dev/null; then
        echo "Error: Failed to scan Wi-Fi networks using interface $interface"
        exit 1
    fi

    # Initialize channel counters and signal strength totals based on selected band
    declare -A channel_count
    declare -A channel_signal

    if [ "$band" = "2g" ]; then
        # Channels for 2.4 GHz in the US (1, 6, 11)
        for channel in 1 6 11; do
            channel_count[$channel]=0
            channel_signal[$channel]=0
        done
    elif [ "$band" = "5g" ]; then
        # Valid 5 GHz channels in the US
        for channel in 36 40 44 48 149 153 157 161 165; do
            channel_count[$channel]=0
            channel_signal[$channel]=0
        done
    else
        echo "Error: Invalid band selection. Use --2g or --5g."
        exit 1
    fi

    # Parse the scan data to populate channel usage and signal strength
    current_freq=""
    current_signal=""
    while read -r line; do
        # Extract frequency
        if echo "$line" | grep -q "freq:"; then
            current_freq=$(echo "$line" | awk '{print $2}')
            if [ "$band" = "2g" ] && [ "$current_freq" -ge 2412 ] && [ "$current_freq" -le 2472 ]; then
                current_channel=$(( ($current_freq - 2407) / 5 ))
                if [[ ! "$current_channel" =~ ^(1|6|11)$ ]]; then
                    current_channel=""
                fi
            elif [ "$band" = "5g" ] && [ "$current_freq" -ge 5180 ] && [ "$current_freq" -le 5825 ]; then
                current_channel=$(( ($current_freq - 5000) / 5 ))
                # Only consider valid 5 GHz channels for the US
                if [[ ! "$current_channel" =~ ^(36|40|44|48|149|153|157|161|165)$ ]]; then
                    current_channel=""
                fi
            else
                current_channel=""
            fi
        fi

        # Extract signal level and update counters
        if [ -n "$current_channel" ] && echo "$line" | grep -q "signal:"; then
            current_signal=$(echo "$line" | awk '{print $2}' | cut -d'.' -f1)
            
            # Update channel usage count and signal strength total
            channel_count[$current_channel]=$((channel_count[$current_channel] + 1))
            channel_signal[$current_channel]=$((channel_signal[$current_channel] + current_signal))
        fi
    done < /tmp/wifi_scan_results.txt

    # Output the channel analysis in a professional manner
    echo -e "\nChannel Analysis for $band Band:"
    echo "-------------------------------------------------"
    printf "%-10s %-15s %-20s %-10s\n" "Channel" "Congestion Count" "Avg Signal Strength (dBm)" "Graph"
    echo "-------------------------------------------------"

    # Find the channel with the least congestion and best signal strength
    best_channel=1
    best_score=-9999
    for channel in "${!channel_count[@]}"; do
        if [ "${channel_count[$channel]}" -gt 0 ]; then
            avg_signal=$((channel_signal[$channel] / channel_count[$channel]))
        else
            avg_signal=0  # If no networks are found, assume no signal (worst case)
        fi

        # Print channel statistics
        congestion="${channel_count[$channel]}"
        signal="$avg_signal"
        # Create a graphical representation of congestion (bars) for easier visualization
        bar=$(printf "%0.s█" $(seq 1 $((congestion + 1))))
        printf "%-10s %-15s %-20s %-10s\n" "$channel" "$congestion" "$signal" "$bar"

        # Prioritize channels with higher signal strength and lower congestion
        # Note: Signal strength is negative, so we add it to penalize weak signals
        score=$((signal - congestion))

        if [ "$score" -gt "$best_score" ]; then
            best_score=$score
            best_channel=$channel
        fi
    done

    # Output the suggested best channel
    echo "-------------------------------------------------"
    echo -e "\nRecommended Channel for $band Band: $best_channel"
    echo "-------------------------------------------------"
}

# Main script logic
if [ "$1" == "--2g" ]; then
    get_best_channel "phy0-ap0" "2g"
elif [ "$1" == "--5g" ]; then
    get_best_channel "phy1-ap0" "5g"
else
    echo "Usage: $0 [--2g | --5g]"
    echo "  --2g : Scan and suggest the best channel for 2.4 GHz"
    echo "  --5g : Scan and suggest the best channel for 5 GHz"
    exit 1
fi`Preformatted text`

irqbalance and packet steering address two different things...

packet steering is routed traffic only across interfaces - wifi is layer 2, so packet steering obviously doesn't do anything for wifi - it does help though for traffic going across the bridge interface (e.g.routing)

Flow offloading via HW/SW might change things here, along with SQM as this impacts these features - all I can say is test and see what works best.

irqbalance is part of the cpufreq-utils package, and this involves governor and other things, for example the PREEMPT-RT packages/patches - since we're not a tablet or a mobile phone, and definitely not a big server with a bunch of HBA's to manage...

irqbalance in general tries to address specific items with older kernels/architectures (e.g. x86, not ARM) and now that we're at Kernel 6.x, most of these things are sorted, and we don't have dynamic clocks or preemtp-rt present, irqbalance hurts more than it helps...

If one wants to pin tasks to specific cores, it's linux, so one always has that option...

1 Like
  1. IRQs should be balanced across cores sans RSS (this should be 1:1) by default, as to not overwhelm a single core to process everything. Pinning WiFi to other cores besides e.g. eth0 (default) always proves at least a 5-10% bump in throughput.
  2. RPS/RFS/RFS_FLOW_COUNT should be enabled by default sans RSS. XPS doesn't seem appropriate unless the system is a server? That's usually not the bottleneck in the case of OpenWRT.
  3. Kernel option skew_tick=1 does result in better optimization for irqs albeit slightly increased power consumption for the system.

For non-techies:

  1. Balancing IRQs across cores:
    Imagine your computer's processor as a team of workers. Each worker (core) can handle tasks (IRQs or Interrupt Requests) from different parts of your computer. By default, we want to spread these tasks evenly among all workers, rather than having one worker do everything. This is especially important for Wi-Fi tasks. When we assign Wi-Fi tasks to different workers than those handling other network tasks (like ethernet), we often see a 5-10% improvement in how fast data can be processed.

  2. Enabling RPS/RFS/RFS_FLOW_COUNT:
    These are like traffic management systems for your computer's network data:

    • RPS (Receive Packet Steering) is like having multiple checkout lines at a store, spreading customers (data packets) across different cashiers (processor cores).
    • RFS (Receive Flow Steering) ensures that related data (like from the same website) goes to the same worker, which is more efficient.
    • RFS_FLOW_COUNT controls how many of these "related data streams" can be managed at once.

    Enabling these features helps your computer handle network traffic more efficiently. XPS (Transmit Packet Steering) is another feature, but it's usually more beneficial for servers handling lots of outgoing traffic, not typical for home routers like OpenWRT.

  3. Kernel option skew_tick=1:
    This is like fine-tuning an engine for performance. It changes how your computer's internal clock works to better handle those task interruptions (IRQs) we talked about earlier. It can make your system run more smoothly, especially when dealing with network tasks. However, like tuning a car for performance, it might use a bit more power (electricity) to run.

In simpler terms, these are all ways to make your router work more efficiently:

  1. Spread out the workload among all available workers (processor cores).
  2. Use smart systems to manage how network data is handled inside your router.
  3. Fine-tune the router's internal timing for better performance, even if it uses a bit more power.

These tweaks can help your home network, especially your Wi-Fi, run faster and more reliably, particularly in situations where you're transferring a lot of data or have many devices connected at once.

2 Likes

Technobabble? :rofl: Bless your heart.

3 Likes

Or you can just go over to Status -> Channel Analysis - it'll show the same info on the WebUI

FWIW - the Mediatek AX chips are fairly smart with ACS, and generally make good choices...

So as I said - use your words to explain what and why?

Pretend the audience is a group of kindergarten kids...

1 Like

OpenWRT doesn't have a button in LUCI to set the unit as a simple AP mode. Let's not sell on the ease of use. At a certain point, it does become technical and a certain amount of surface education is needed. I'm all for friendly information, but some things are agreed to go beyond basic level information.

1 Like

Indeed, Pot.

Have you ever used telnet to view the internals of the stock firmware of most major off-the-shelf brands? Their settings are sold with most of my advised settings. SMP Affinity to spread to other cores and RPS tweaks being consistent. That's not showing off. You're just trolling. It's okay sir, I understand you're dealing with something personal. GOD bless you.

Here it is:

root@OpenWrt:~# grep -E "80211[dh]" /tmp/run/hostapd-phy1.conf
ieee80211d=1
ieee80211h=1
root@OpenWrt:~# iw reg get
global
country IL: DFS-ETSI
        (2402 - 2482 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
        (5250 - 5350 @ 80), (N/A, 23), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
        (5725 - 5875 @ 80), (N/A, 23), (N/A), AUTO-BW

root@OpenWrt:~# uci show | grep radio1 | grep -v key
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.path='platform/soc/18000000.wifi+1'
wireless.radio1.channel='52'
wireless.radio1.band='5g'
wireless.radio1.htmode='HE160'
wireless.radio1.country='IL'
wireless.radio1.cell_density='0'
wireless.default_radio1=wifi-iface
wireless.default_radio1.device='radio1'
wireless.default_radio1.network='lan'
wireless.default_radio1.mode='ap'
wireless.default_radio1.ssid='Ali_5G'
wireless.default_radio1.encryption='sae-mixed'

Some new info on the 2.4GHz issue on GitHub.

Could be a misconfiguration? Does the router boardcast a single spatial stream?

I'll give your script a try. Do I need to place the default exit 0 at the end of the script in rc.local and would it be counterproductive to enable Packet Steering together with your script?