WLAN-Pi / wlanpi-profiler

Wi-Fi client capabilities analyzer tool built for the WLAN Pi
BSD 3-Clause "New" or "Revised" License
25 stars 8 forks source link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc6 in position 1: invalid continuation byte #25

Closed joshschmelzle closed 3 years ago

joshschmelzle commented 4 years ago

Need to fix this error so that the sniffer process does not crash.

Version Info:

profiler 1.0.0-alpha1
2020-06-27 13:32:42,785 [INFO] fakeap.py: scapy version: 2.4.3
Bus 004 Device 002: ID 0e8d:7612 MediaTek Inc. 
     *-usb
          description: Generic USB device
          product: 802.11ac WLAN
          vendor: MediaTek Inc.
          physical id: 1
          bus info: usb@4:1
          version: 1.00
          serial: 000000000
          capabilities: usb-2.10
          configuration: driver=mt76x2u maxpower=200mA speed=480Mbit/s

Traceback:

Process sniffer:
Traceback (most recent call last):
  File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/dist-packages/profiler2/fakeap.py", line 210, in __init__
    filter=self.bpf_filter,
  File "/usr/local/lib/python3.7/dist-packages/scapy/sendrecv.py", line 972, in sniff
    sniffer._run(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/scapy/sendrecv.py", line 925, in _run
    session.on_packet_received(p)
  File "/usr/local/lib/python3.7/dist-packages/scapy/sessions.py", line 47, in on_packet_received
    result = self.prn(pkt)
  File "/usr/local/lib/python3.7/dist-packages/profiler2/fakeap.py", line 219, in received_frame
    ssid = packet[Dot11Elt].info.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc6 in position 1: invalid continuation byte
joshschmelzle commented 3 years ago

Unable to reproduce at the moment.