Git Product home page Git Product logo

Comments (1)

ralf-krause avatar ralf-krause commented on September 25, 2024 1

Searching in the source code I found the reason for this issue.
https://github.com/moodlebox/moodle-tool_moodlebox/blob/main/bin/changewifisettings.py
starting in line 126

def do_channel():
    """Channel setting."""
    global new_channel
    # Validate new_channel. Replace it with default_channel if invalid.
    if int(new_channel) < 1 or int(new_channel) > 13:
        new_channel = default_channel
    # Channel 12 and 13 aren't valid in Canada and US.
    if new_country in ['CA','US'] and int(new_channel) > 11:
        new_channel = default_channel
    # new_channel is now valid.
    if is_networkmanager():
        # Workaround bug in NetworkManager: country_code is not used, so if new_channel is 12 and 13,
        # we revert to default_channel (11).
        # See https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/960.
        new_channel = str(min(int(default_channel), int(new_channel)))
        # Set channel with nmcli
        subprocess.run(['sudo', 'nmcli', 'con', 'mod', 'WifiAP', 'wifi.channel', new_channel])
    else:
        # Set channel in hostapd config file.
        file_replace_line(hostapd_conf_file, 'channel=.*', 'channel=' + new_channel)

from moodlebox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.