ghostbsd / issues

Issue tracker for GhostBSD
BSD 2-Clause "Simplified" License
1 stars 1 forks source link

Network manage does not alert that wifi password is wrong #99

Open clark713 opened 5 months ago

clark713 commented 5 months ago

Version

24.01.1

What desktop?

Official MATE

Explain the issue and what happens

Tried to connected to wifi, didnt work, no error message popup. Later checked /etc/wpa_supplicant.conf and saw the password was wrong (missing 1 digit). Fixed, saved, reconnected using GUI Network Manager and all is well.

Thanks

Explain how to reproduce the bug?

Connect to wifi network with the wrong password.

What is the Expected behavior (if applicable)

A popup alerting the password is wrong.

Additional context (if applicable)

No response

ericbsd commented 1 month ago

It should time out after a minute or so, but I think more work is needed in that area.

anonymous-cupholder commented 4 days ago

FWIW. I looked at how to solve this issue. I just want to share an idea on how to correct this issue. This is the proposed networkmgr file.

!/usr/bin/env python

import signal from NetworkMgr.trayicon import trayIcon import subprocess from tkinter import messagebox

def connect_to_wifi(ssid, password): command = f"wpa_supplicant -B -i wlan0 -c <(wpa_passphrase {ssid} {password} )"

try:
    result = subprocess.run(command, shell=True, check=True, stderr=subproce

ss.PIPE) if result.returncode != 0: raise subprocess.CalledProcessError(result.returncode, command)

    # Additional code to handle successful connection

except subprocess.CalledProcessError as e:
    # Notify user if the password is incorrect
    messagebox.showerror("Connection Error", "The WiFi password is incorrect

. Please try again.")

class NetworkMgrTrayIcon(trayIcon): def connect_to_network(self, ssid, password): connect_to_wifi(ssid, password)

signal.signal(signal.SIGINT, signal.SIG_DFL)

NetworkMgrTrayIcon().tray()