-
Notifications
You must be signed in to change notification settings - Fork 151
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
Wrong WiFi driver detection in Snap package and Ubuntu Core #267
Comments
Hello. Thanks for the investigation here. As a quick disclaimer, I am not familiar with creating Snap packages so I do not know how this changes the behavior. If I'm understand this correctly, you expect the |
I did some further tests. I was not able to modify the cmd("export PATH=\"$PATH:/snap/bin\"")
cmd("sudo export PATH=\"$PATH:/snap/bin\"")
sys.path.append("/snap/bin")
print("Path: " + os.environ['PATH'])
# returns Path: /snap/goprotest/x55/usr/sbin:/snap/goprotest/x55/usr/bin:/snap/goprotest/x55/sbin:/snap/goprotest/x55/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games Some tests how to check if cmd("which nmcli") # returns nmcli: not found
cmd("sudo which nmcli") # returns /snap/bin/nmcli
cmd("sudo nmcli --version").split()[-1] # returns 1.22.10
which("nmcli") # returns false
which("nmcli", path="/snap/bin/") # returns true |
I'm not sure if there is anything I can do about this, at least in the scope of this project. I suppose the module just does not work in the snap environment. |
I think changing this line form if which("nmcli"): to if which("nmcli") or which("nmcli", path="/snap/bin/"): would solve the problem. And reading the version in the next line must have |
Sounds good to me. Feel free to make a Pull Request. |
Component
What is the bug in?
Describe the bug
I'm trying to connect to a GoPro via WiFi with a Raspberry CM4 using the Python SDK and Ubuntu Core 22.
The Python SDK is packed in a snap package using the python plugin.
Connections via USB and BLE are working and when trying to connect via WiFi the SSID and password are correctly read via BLE.
The WiFi is also listed in the found SSID's (
nmcli device wifi list
).When I'm trying to specify the interface manually I get the error
Failed to connect. Requested WiFi interface [wlan0] not found among [sudo:]
Without the interface specified I get
Reason
I found the reason in the python SDK already. The
which
commend here results tofalse
, but should betrue
. Callingcmd(f"sudo nmcli device wifi list")
works as expected in the same python script, so the network manager tool is working. Due to this, thewpa_supplicant
driver is selected. The/tmp/wpa_supplicant.conf
file is created correctly but it cannot connect because the interface is not set. This is because theiwconfig
command here is not working in this environment. This also explains the available interfaces list[sudo:]
when trying to specify it manually.To Reproduce
Steps to reproduce the behavior:
Expected behavior
which should return true.
Hardware
Python script
The text was updated successfully, but these errors were encountered: