Skip to content
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

ERROR: Can't find the 'iwgetid' command #4

Closed
theniwo opened this issue Jan 27, 2021 · 24 comments
Closed

ERROR: Can't find the 'iwgetid' command #4

theniwo opened this issue Jan 27, 2021 · 24 comments
Labels
bug Something isn't working

Comments

@theniwo
Copy link

theniwo commented Jan 27, 2021

~ locate iwgetid
/sbin/iwgetid

~ wifi-password
ERROR: Can't find the 'iwgetid' command

This was run on Ubuntu 18.04.5 LTS

@Adrianordp
Copy link
Contributor

I'm pulling the fix

@Adrianordp
Copy link
Contributor

The pull request #5 fixes it.

@sdushantha
Copy link
Owner

Closing this issue since it has been fixed in #5

@littlediobolic
Copy link
Contributor

Just tested the newest version and this error seems to persist.

$ sudo wifi-password
ERROR: Can't find the 'iwgetid' command

@theniwo
Copy link
Author

theniwo commented Jan 27, 2021

I get:
ERROR: You need to run '/home/niwo/.local/bin/wifi-password' as root
and when run with sudo
sudo: wifi-password: command not found
:D

@sdushantha sdushantha reopened this Jan 27, 2021
@sdushantha
Copy link
Owner

I don't have a Linux machine at the moment. Would you guys be willing to try and figure out why this error is arising?

@littlediobolic
Copy link
Contributor

Sure thing, after looking my box does not have the iwgetid binary. I am trying to locate and install it and see if that fixes the problem.

@theniwo
Copy link
Author

theniwo commented Jan 27, 2021

Isn't it possible for you to run a virtual machine?

@sdushantha
Copy link
Owner

sdushantha commented Jan 27, 2021

@littlediobolic The only computer I have is my school MacBook. We unfortunately have restrictions when it comes to installing apps on our computers. So I can't install a virtual machine.

@littlediobolic
Copy link
Contributor

littlediobolic commented Jan 27, 2021

That's the problem, which I guess was obvious. I resolved by installing the wireless-tools package on my machine to get the iwgetid command.

For Arch/Manjaro: sudo pacman -S wireless_tools
For Ubuntu: sudo apt-get install wireless-tools

I'm not super programming savvy so I probably couldnt write something to install those packages on install, but I could make a PR with comments to install wireless-tools if you'd like?

@theniwo
Copy link
Author

theniwo commented Jan 27, 2021

install those packages on install

Not a good idea. Better print an error message that the package is missing. Also, if it is required it should to be mentioned in the readme

@Adrianordp
Copy link
Contributor

ERROR: You need to run '/home/niwo/.local/bin/wifi-password' as root
and when run with sudo
sudo: wifi-password: command not found

@theniwo Uninstall with sudo and without sudo:
pip3 uninstall wifi-password ; sudo pip3 uninstall wifi-password

Then reinstall via:
sudo pip3 install wifi-password.

Tell us if it works now.

@theniwo
Copy link
Author

theniwo commented Jan 27, 2021

ERROR: Cound not find password

(Wasn't that typo also fixed in the pr by ImranVirani)

@jans-de
Copy link

jans-de commented Jan 27, 2021

That's the problem, which I guess was obvious. I resolved by installing the wireless-tools package on my machine to get the iwgetid command.

For Arch/Manjaro: sudo pacman -S wireless-tools
For Ubuntu: sudo apt-get install wireless-tools

I'm not super programming savvy so I probably couldnt write something to install those packages on install, but I could make a PR with comments to install wireless-tools if you'd like?

The package for Arch/Manjaro is actually called wireless_tools so the command is sudo pacman -S wireless_tools

@littlediobolic
Copy link
Contributor

The package for Arch/Manjaro is actually called wireless_tools so the command is sudo pacman -S wireless_tools

Yup just noticed and edited my comment. Im working on a PR to add this to the README and to the error message

@sdushantha sdushantha added the bug Something isn't working label Jan 27, 2021
@sdushantha
Copy link
Owner

I am closing this PR as this issue seems to be fixed

@ghost
Copy link

ghost commented Jan 27, 2021

I am closing this PR as this issue seems to be fixed

I'm in Debian 10, the problem persist after installing wireless-tools via APT.

ERROR: Can't find the 'iwgetid' command
Please ensure wireless-tools is installed on your machine.

If I go with sudo:

ERROR: Cound not find password

@littlediobolic
Copy link
Contributor

@Engineer22
Is iwgetid present on your system?

which iwgetid

@Adrianordp
Copy link
Contributor

@Engineer22 Your output for
/etc/NetworkManager/system-connections/
has your connection configuration files for each SSID you've connected. On Ubuntu, these files has the extension nmconnection. How does Debian's connection files look like?

@ghost
Copy link

ghost commented Jan 27, 2021

@Adrianordp @littlediobolic

these are the results with the SSIDs manipulated:

sudo which iwgetid
/usr/sbin/iwgetid

cd /etc/NetworkManager/system-connections/
ls
name1.nmconnection name2.nmconnection

@Adrianordp
Copy link
Contributor

Your SSID appears when you input
iwgetid -r
on terminal?

@ghost
Copy link

ghost commented Jan 27, 2021

Yes it does.

sudo iwgetid -r
name2

@littlediobolic
Copy link
Contributor

Does cat /etc/NetworkManager/system-connections/{ssid}.nmconnection | grep psk= return anything? Replacing {ssid} for name2 of course

@ghost
Copy link

ghost commented Jan 27, 2021

I found the problem.

I have 2 SSIDs, one named name1 and one named name2. Both have space between them:

name 1 & name 2

after reading again the results of /etc/NetworkManager/system-connections/ they're displayed as 'name 1' & 'name 2'.
If I create a new AP and name it as name3 (no space), the script prints successfully.

The program needs to take into consideration that some SSIDs may have space between their names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants