FreeWifi icon indicating copy to clipboard operation
FreeWifi copied to clipboard

Doesn't work on Archlinux

Open zgqq opened this issue 7 years ago • 4 comments

sudo python3 wifi-users.py

Error getting wireless interface.
Traceback (most recent call last):
  File "wifi-users.py", line 151, in <module>
    main(argv)
  File "wifi-users.py", line 51, in main
    wireless = Wireless()
  File "/usr/lib/python3.6/site-packages/wireless/Wireless.py", line 23, in __init__
    self._driver_name = self._detectDriver()
  File "/usr/lib/python3.6/site-packages/wireless/Wireless.py", line 50, in _detectDriver
    compare = self.vercmp(ver, "0.9.9.0")
  File "/usr/lib/python3.6/site-packages/wireless/Wireless.py", line 71, in vercmp
    return cmp(normalize(actual), normalize(test))
NameError: name 'cmp' is not defined

zgqq avatar Feb 05 '17 01:02 zgqq

This looks like a bug with https://github.com/joshvillbrandt/wireless/

It might be related to https://github.com/joshvillbrandt/wireless/issues/17

If you get a chance, try reporting the error in that repo and maybe there is a workaround.

I also just pushed changes that add -s / --ssid and -i / --interface flags which should allow you to manually specify these variables, which will work around the bug with that package on archlinux.

kylemcdonald avatar Feb 05 '17 01:02 kylemcdonald

As mentioned in the comments, cmp doesn't exist in Python 3. If you really want it, you could define it yourself:

def cmp(a, b): return (a > b) - (a < b)

..... Or use python 2

upmauro avatar Feb 06 '17 02:02 upmauro

@kylemcdonald sudo python3 wifi-users.py -i wlp3s0 -s 360WiFi-A379AF

Interface: wlp3s0
SSID: 360WiFi-A379AF
Available gateways: wlp3s0
Gateway IP: 192.168.43.1
Error getting gateway MAC address.
1002it [00:15, 65.10it/s]
Total of 0 user(s)

It seems to work,but still receive a error "Error getting gateway MAC address."

zgqq avatar Feb 06 '17 02:02 zgqq

"Error getting gateway MAC address." means that netifaces can't grab your gateway for some reason. This isn't a huge deal, because the code should still be able to detect packets that are sent to the router from other devices. But some packets only go to the gateway, and you will miss them. If you can find another way to get your gateway with Python and share it here, I'd like to add it to the script, and it will improve the quality of the results.

kylemcdonald avatar Feb 06 '17 06:02 kylemcdonald