0

I'm trying to get pyshark version 0.4.2.9 on my raspberry pi 3B and cannot capture any packets using LiveCapture. Strangely enough the following commands run perfectly fine on my desktop (both devices have the same USB wifi adapter) but will always time out on the Pi.

Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyshark
>>> cap = pyshark.LiveCapture(interface='wlan1')
>>> cap.sniff(packet_count=1, timeout=50)
>>> print(cap)
<LiveCapture (0 packets)>

Interestingly enough, tshark works just fine. I'd much rather have pyshark working, since it would work much easier with the rest of my project. Has anyone else experienced a similar issue with pyshark on Raspberry Pi?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
dropTableUsers
  • 345
  • 4
  • 14

1 Answers1

0

In a twist of events, this problem was the result of overlooking the packet sniffing privileges I'd established when installing wireshark. I was running the python shell as the pi user as opposed to root, which kept it from collecting packets. If anyone else runs into similar issues, try using captureObj.set_debug() which told me my error.

dropTableUsers
  • 345
  • 4
  • 14