rockymeza/wifi

IOError: [Errno 2] No such file or directory: '/etc/network/interfaces'

Closed this issue · 4 comments

Just installed wifi on latest ARCH distro which is now using netctl and the wifi module is looking for /etc/network/interfaces which is no longer used.

wifi list

Traceback (most recent call last):
  File "/usr/bin/wifi", line 127, in <module>
    parser_connect.options = [scheme.name for scheme in Scheme.all()]
  File "/usr/lib/python2.7/site-packages/wifi/scheme.py", line 69, in all
    with open(cls.interfaces, 'r') as f:
IOError: [Errno 2] No such file or directory: '/etc/network/interfaces'

Any chance you can update this to work with netctl ??

Many Thanks

Hi @pacmac,

Thank you so much for trying wifi out. Actually, wifi doesn't need to use /etc/network/interfaces anymore, it just stores the information in that file because it used to really on ifscheme which did care about /etc/network/interfaces. I've wanted to switch from using /etc/network/interfaces to using a file in the home directory. So this is good impetus for doing that.

As far as using the netctl tooling, I'm not sure wifi needs to use them, as long as you have iwlist, ifdown, and ifup, I think that wifi will still work.

For now, can you try creating an empty file at /etc/network/interfaces to see if wifi works on arch anyway?

Thanks so much for the quick response, I added /etc/network/interfaces, I now get a different error:

wifi scan

Traceback (most recent call last):
  File "/usr/bin/wifi", line 153, in <module>
    args.func(args)
  File "/usr/bin/wifi", line 47, in scan_command
    print_table([[cell.signal, cell.ssid, 'protected' if cell.encrypted else 'unprotected'] for cell in Cell.all(args.interface)])
  File "/usr/lib/python2.7/site-packages/wifi/scan.py", line 24, in all
    cells = map(Cell.from_string, cells_re.split(iwlist_scan)[1:])
  File "/usr/lib/python2.7/site-packages/wifi/scan.py", line 34, in from_string
    return normalize(cell_string)
  File "/usr/lib/python2.7/site-packages/wifi/scan.py", line 97, in normalize
    cell.quality, signal = quality_re.search(line).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

Yeah, so this means that the output of arch's iwlist is different from the output of debian's iwlist. I can't really look into it right now, but I have a feeling that this is going to be a large difference. I would love to support Arch Linux, so I do want to make this work.

Could you send me the output of

$ sudo iwlist wlan0 scan

If you don't want to put that information on GitHub (it's not super sensitive, but maybe somebody could figure out where you are or something), you can email it to my gmail (also rockymeza). If it's close enough maybe I can figure out what to do with it.

But right now I need to work on my homework. :)

Hey @pacmac,

This second bug (the groups error) that you are receiving has been addressed in the 0.2.2 release of wifi.

Also, the ability to specify your interfaces file is in the works, you can see it in #21.

I'm going to go ahead and close this bug for now. Please feel free to reopen it if you think there are some things that haven't been addressed. Sorry it took so long to get this working.