-
Notifications
You must be signed in to change notification settings - Fork 5
Move from wpa_supplicant to NetworkManager and nmcli #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Update WiFi module to use NetworkManager (nmcli) instead of wpa_supplicant - Update command handlers to work with NetworkManager - Add a new wifi-scan command to scan for available networks - Add a new migrate_to_networkmanager.sh script to help with migration - Update installation instructions and add NetworkManager to dependencies - Add migration information to README 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
gonotego/settings/wifi.py
Outdated
| """Update NetworkManager connections for Go Note Go managed WiFi networks.""" | ||
| networks = get_networks() | ||
| filepath = '/etc/wpa_supplicant/wpa_supplicant.conf' | ||
| result = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
gonotego/settings/wifi.py
Outdated
| # Read the existing config | ||
|
|
||
|
|
||
| def get_gonote_managed_connections(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gonotego
gonotego/settings/wifi.py
Outdated
| with open(filepath, 'r') as f: | ||
| config = f.read() | ||
| result = subprocess.run( | ||
| ["nmcli", "-t", "-f", "NAME,TYPE", "connection", "show"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix indentation
gonotego/settings/wifi.py
Outdated
| shell('sudo cp /tmp/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf') | ||
| shell('rm /tmp/wpa_supplicant.conf') | ||
| cmd = [ | ||
| "sudo", "nmcli", "connection", "add", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix indentation (use 4 spaces for hanging indents like these)
gonotego/settings/wifi.py
Outdated
| return False | ||
|
|
||
|
|
||
| def add_open_connection(ssid): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better to combine add_open_connection and add_wpa_connection since they're so similar
gonotego/settings/wifi.py
Outdated
| if ssid in available_networks: | ||
| # Try to connect to this network | ||
| subprocess.run( | ||
| ["nmcli", "connection", "up", "id", ssid], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
gonotego/settings/wifi.py
Outdated
| filepath = '/etc/wpa_supplicant/wpa_supplicant.conf' | ||
|
|
||
| if not os.path.exists(filepath): | ||
| if not subprocess.run(["test", "-f", filepath], capture_output=True).returncode == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.path.exists is better than test -f, right?
gonotego/settings/wifi.py
Outdated
| try: | ||
| # Get all wifi connections | ||
| result = subprocess.run( | ||
| ["nmcli", "-t", "-f", "NAME,TYPE", "connection", "show"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
gonotego/settings/wifi.py
Outdated
| for conn_name in wifi_connections: | ||
| # Get connection details | ||
| result = subprocess.run( | ||
| ["sudo", "nmcli", "--show-secrets", "connection", "show", conn_name], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
installation.md
Outdated
| sudo apt update | ||
| sudo apt upgrade | ||
| sudo apt install firefox-esr xvfb portaudio19-dev libatlas-base-dev redis-server espeak rustc python3-dev | ||
| sudo apt install firefox-esr xvfb portaudio19-dev libatlas-base-dev redis-server espeak rustc python3-dev network-manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave the installation.md as it was -- we'll update it in a separate pull request
…er function names, improve migrate function, and use os.path.exists
…ions, fix indentation to use 4 spaces for hanging indents, inline result=True
…wifi_connection function
…nections which doesn't filter connections
… add and modify operations
Summary
Test plan
Let's move away from wpa_supplicant in favor of NetworkManager and nmcli.
🤖 Generated with Claude Code