rockymeza/wifi

AttributeError: 'NoneType' object has no attribute 'groups'

Closed this issue · 19 comments

from wifi.scan import Cell
Cell.all('wlan0')

gives this error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "wifi/scan.py", line 24, in all
    cells = map(Cell.from_string, cells_re.split(iwlist_scan)[1:])
  File "wifi/scan.py", line 34, in from_string
    return normalize(cell_string)
  File "wifi/scan.py", line 97, in normalize
    cell.quality, signal = quality_re.search(line).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

with the command iwlist

iwlist wlan0 scan

outputs this

wlan0     Scan completed :
          Cell 01 - Address: A4:56:30:E8:97:F0
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=84/100  Signal level=43/100  
          Cell 02 - Address: 2C:36:F8:42:0E:40
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=90/100  Signal level=48/100  
          Cell 03 - Address: A4:56:30:E8:F5:F1
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=100/100  Signal level=100/100  
          Cell 04 - Address: 20:4E:7F:76:F1:06
                    ESSID:"Ja"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.422 GHz (Channel 3)
                    Encryption key:on
                    Bit Rates:300 Mb/s
                    Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD7A0050F204104A0001101044000102103B0001031047001000000000000010000000204E7F76F106102100044E54475210230009776E72323030307633102400016E104200046E6F6E651054000800060050F204000110110016574E5232303030763328576972656C65737320415029100800020086103C000103
                    Quality=100/100  Signal level=92/100  
          Cell 05 - Address: A4:56:30:E8:FE:20
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=54/100  Signal level=43/100  
          Cell 06 - Address: F2:23:DB:A3:3B:A0
                    ESSID:"Antons iPhone"
                    Protocol:IEEE 802.11g
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:54 Mb/s
                    Extra:rsn_ie=30140100000fac040100000fac040100000fac020c00
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality=78/100  Signal level=16/100  
          Cell 07 - Address: 1C:AA:07:B0:3E:61
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=27/100  Signal level=46/100  
          Cell 08 - Address: 2C:36:F8:0E:AB:21
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=100/100  Signal level=64/100  
          Cell 09 - Address: A4:56:30:E9:BE:71
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=75/100  Signal level=47/100  
          Cell 10 - Address: 1C:AA:07:6F:2D:00
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=87/100  Signal level=47/100  
          Cell 11 - Address: 2C:36:F8:0E:93:70
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=100/100  Signal level=48/100  
          Cell 12 - Address: A4:56:30:E8:F5:F0
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=100/100  Signal level=100/100  
          Cell 13 - Address: 2C:36:F8:42:62:30
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=54/100  Signal level=84/100  
          Cell 14 - Address: 2C:36:F8:0E:AB:20
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=75/100  Signal level=87/100  
          Cell 15 - Address: 1C:AA:07:6F:2F:40
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=46/100  Signal level=43/100  
          Cell 16 - Address: 2C:36:F8:0E:93:71
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=68/100  Signal level=48/100  
          Cell 17 - Address: 2C:36:F8:42:0E:41
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=56/100  Signal level=46/100  
          Cell 18 - Address: 2C:36:F8:0E:AC:81
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=30/100  Signal level=43/100  
          Cell 19 - Address: 2C:36:F8:42:58:11
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=90/100  Signal level=46/100  
          Cell 20 - Address: A4:56:30:E8:F6:60
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=48/100  Signal level=26/100  
          Cell 21 - Address: 30:46:9A:8A:60:F4
                    ESSID:"Majsbollar"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30140100000fac040100000fac040100000fac020c00
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD810050F204104A00011010440001021041000100103B00010310470010CAF22436FFC0A8D313D1A963280982E21021000D4E4554474541522C20496E632E10230009574E5232303030763210240009574E523230303076321042000230311054000800060050F204000110110009574E52323030307632100800020084103C000101
                    Quality=100/100  Signal level=72/100  
          Cell 22 - Address: A4:56:30:E8:97:F1
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=48/100  Signal level=43/100  
          Cell 23 - Address: 2C:36:F8:0E:9A:C1
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=100/100  Signal level=72/100  
          Cell 24 - Address: A4:56:30:E8:F6:61
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=41/100  Signal level=26/100  
          Cell 25 - Address: 2C:36:F8:0E:AC:80
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=101/100  Signal level=43/100  
          Cell 26 - Address: 54:3D:37:28:62:38
                    ESSID:"wifijkpg"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.457 GHz (Channel 10)
                    Encryption key:off
                    Bit Rates:130 Mb/s
                    Quality=95/100  Signal level=7/100  
          Cell 27 - Address: 54:3D:37:68:62:38
                    ESSID:""
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.457 GHz (Channel 10)
                    Encryption key:on
                    Bit Rates:130 Mb/s
                    Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality=100/100  Signal level=10/100  
          Cell 28 - Address: 2C:36:F8:0E:9D:31
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=80/100  Signal level=46/100  
          Cell 29 - Address: 2C:36:F8:42:37:81
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=15/100  Signal level=23/100  
          Cell 30 - Address: 2C:36:F8:42:12:E1
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=96/100  Signal level=48/100  
          Cell 31 - Address: 1C:AA:07:B0:4C:61
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=36/100  Signal level=26/100  
          Cell 32 - Address: 2C:36:F8:0E:9D:30
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=70/100  Signal level=46/100  
          Cell 33 - Address: 2C:36:F8:42:62:31
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=45/100  Signal level=76/100  
          Cell 34 - Address: 1C:AA:07:6F:2F:41
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=84/100  Signal level=43/100  
          Cell 35 - Address: 2C:36:F8:0E:91:61
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=81/100  Signal level=43/100  
          Cell 36 - Address: 1C:AA:07:B0:84:B0
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=9/100  Signal level=26/100  
          Cell 37 - Address: 1C:AA:07:B0:9D:81
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=33/100  Signal level=26/100  
          Cell 38 - Address: A4:56:30:E8:FE:21
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=54/100  Signal level=43/100  
          Cell 39 - Address: 1C:AA:07:B0:3E:60
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=36/100  Signal level=42/100  
          Cell 40 - Address: 1C:AA:07:6F:2D:01
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=69/100  Signal level=47/100  
          Cell 41 - Address: A4:56:30:E9:BE:70
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=78/100  Signal level=56/100  
          Cell 42 - Address: 2C:36:F8:0E:91:60
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=84/100  Signal level=43/100  
          Cell 43 - Address: 2C:36:F8:42:58:10
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=90/100  Signal level=43/100  
          Cell 44 - Address: 2C:36:F8:0E:9A:C0
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=101/100  Signal level=72/100  
          Cell 45 - Address: 2C:36:F8:42:12:E0
                    ESSID:""
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2020050f20401000050f2020000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac022800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Quality=84/100  Signal level=43/100  
          Cell 46 - Address: 1C:AA:07:B0:9D:F1
                    ESSID:"eduroam"
                    Protocol:IEEE 802.11gn
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac012800
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : 802.1x
                    Quality=36/100  Signal level=43/100  

Hey @anders-linden,

I'm so sorry I didn't respond earlier (GMail marked the email as unimportant). I think I have a chance tomorrow night to take a look at this for real.

For now can you let me know what OS you are on? That output looks very similar to the output that I get. I will try to get that working if I can.

Oh!!, your Quality line is different than my quality line.

For me I get a Quality line that looks like: 'Quality=26/70 Signal level=-84 dBm', but yours looks like 'Quality=36/100 Signal level=43/100'. OK, that's a pretty easy fix.

I would like the signal level to be consistently in dBm though, so I'll figure out what that means and how to convert. It looks like Wikipedia has enough information for me to get started.

Also, thanks for trying out wifi and I'm so sorry that you ran into this problem.

I've ran into same problem today. I've created a fix for it, but I don't understand how to convert signal level 43/100 into dBm, wikipedia is not so obvious for me. I can finish the fix and send pull request if you'll explain how to convert it.

Btw, I have format Quality=26/70 Signal level=30/100 on Raspbian, which is a blend of Debian Wheezy recompiled for RaspberryPi. But I have format Quality=26/70 Signal level=-84 dBm on Ubuntu 12.04.

@alexykot, thanks so much for looking into this.

I was looking through the Wikipedia article and I did some googling, but I
couldn't come up with anything useful. Maybe now that I know the that this
response is coming from Raspbian, maybe I can look into the differences in
their iwlists. It's weird though, because I use wheezy and I get dBm back.
Maybe this is tied to hardware? I hope not.

It would be super cool to get wifi running on a RaspberryPi, that's a good
use case.

Finals are coming up soon and I don't know if I'll have time to crawl
through iwlist source anytime soon. @alexykot, go ahead and send your PR
without the dBm translation. Wifi might as well not error, even if it can't
spit out the right units. Right?

-rocky
On Dec 11, 2013 8:46 AM, "Alex Kotenko" notifications@github.com wrote:

I've ran into same problem today. I've created a fix for it, but I don't
understand how to convert signal level 43/100 into dBm, wikipedia is not
so obvious for me. I can finish the fix and send pull request if you'll
explain how to convert it.

Btw, I have format Quality=26/70 Signal level=30/100 on Raspbian, which
is a blend of Debian Wheezy recompiled for RaspberryPi. But I have format Quality=26/70
Signal level=-84 dBm on Ubuntu 12.04.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-30284163
.

from wifi.scan import Cell
Cell.all('wlan0')

it gives this error

Traceback (most recent call last):
File "", line 1, in
File "wifi/scan.py", line 24, in all
cells = map(Cell.from_string, cells_re.split(iwlist_scan)[1:])
File "wifi/scan.py", line 34, in from_string
return normalize(cell_string)
File "wifi/scan.py", line 97, in normalize
cell.quality, signal = quality_re.search(line).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

hey i also got the same error can any one give me the idea how to fix this error .
with step by step

i am new to python

I have an idea how to fix it, I will send a pull request with the fix for
it around this evening or tomorrow.

Best regards,
Alex Kotenko

2013/12/11 vivekanandgoud notifications@github.com

from wifi.scan import Cell
Cell.all('wlan0')

it gives this error

Traceback (most recent call last):
File "", line 1, in
File "wifi/scan.py", line 24, in all
cells = map(Cell.from_string, cells_re.split(iwlist_scan)[1:])
File "wifi/scan.py", line 34, in from_string
return normalize(cell_string)
File "wifi/scan.py", line 97, in normalize
cell.quality, signal = quality_re.search(line).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

hey i also got the same error can any one give me the idea how to fix this
error .
with step by step

i am new to python


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-30316282
.

thanks for your replay

i am waiting for your answer

http://madwifi-project.org/attachment/wiki/UserDocs/RSSI/Converting_Signal_Strength.pdf?format=raw

here's an article about converting to dBm for certain brands of NICs. The problem is that they are using a relative measurement whereas dBm is an absolute measurement. They do provide some conversion methods... I don't know if that covers all of our bases though.

Maybe we can just return the percentage values...?

@gavinwahl, any input?

Also here's where I learned that iwlist just passes through what the hardware returns:

http://svn.dd-wrt.com/browser/src/router/wireless-tools/iwlib.c?rev=7473#L1395

really i don't understand your saying need to be change the signal levels but where can i find this statements
where should i change the signals

please give me full instructions step by step

thanking you......

in my scan.py
theese statment is there
is this gives me any error
what thing i need to change in this statement ..

cells_re=re.compile(r'cell \d+ - ')
quality_re= re.compile(r'quality =(\d+/\d+).signal level=(-\d+) dBm)
frequency_re =re.compile(r'([\d.]+ .Hz).
')

pull request fixing this committed in #15. It doesn't convert value dBm thought, but allow all other things to work.

this is fixed in #16, I'm going to cut a release for this right now.

Hi!
I was trying the same to list the ssid using the command
>>> cell=Cell.all('wlan0')
but I'm getting something like this...
>>> cell <map object at 0x76b70e70>
What is this object and how do I get the ssids using this command?
Also when I try to use the command:
Cell.all('wlan0')[0]
I get the following error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'map' object is not subscriptable
I'm using RaspberryPi 3 for the project
Any help is appreciated...

Hi!
thanks for the reply.
It's working this way.

Hi!
The library is working great, but I'm facing an issue in connecting it for the first time. When running scheme.activate() for the second time, it's getting connected.

>>> scheme.activate()
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.4/dist-packages/wifi/scheme.py", line 176, in activate return self.parse_ifup_output(ifup_output) File "/usr/local/lib/python3.4/dist-packages/wifi/scheme.py", line 183, in parse_ifup_output raise ConnectionError("Failed to connect to %r" % self) wifi.exceptions.ConnectionError: Failed to connect to Scheme(interface='wlan0', name='test', options={'wpa-psk': 'c2d41decfa60f24288ec193893917b192d00dd324e1e71a7ba789a4b82fbd5d3', 'wireless-channel': 'auto', 'wpa-ssid': 'ESPsoftAP_01'}

Hi!

Can you please let me know if I can edit the etc/network/interfaces file in rasPi using Python3? I just want to add the lines required to auto-reconnect to a Wi-Fi.