Nekmo / amazon-dash

Hack your Amazon Dash to run what you want.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run discovery: tcpdump is not available

bradydowling opened this issue · comments

Put an x into all the boxes [ ] relevant to your issue (like this: [x])

What is the purpose of your issue?

  • Bug report (encountered problems with amazon-dash)
  • Feature request (request for a new functionality)
  • Question
  • Other

Guideline for bug reports

  • amazon-dash version: v1.3.2
  • Python version: 2.7.13
  • Pip version: 19.0.2
  • Setuptools version: 33.1.1
  • Operating System: Linux raspberrypi 4.9.80+ #1098 Fri Mar 9 18:51:28 GMT 2018 armv6l GNU/Linux
  • The pip install or setup install command has been completed without errors
  • The python -m amazon_dash.install command has been completed without errors
  • The amazon-dash discovery command works without errors
  • I have created/edited the configuration file
  • Amazon-dash service or amazon-dash --debug run works

Description

When I try to run the discovery command it errors out before I can even press the dash button. I expected it to run and prompt me to press the button and then it would sit and wait until I pressed something. Instead, it immediately errored out and crashed.

What I Did

$ sudo amazon-dash discovery
Welcome to Amazon-dash v1.3.2 using Python 2.7.13
The discovery command lists the devices that are connected in your network. Each device will only be listed once. After executing this command wait approximately 10 seconds before pressing the Amazon Dash button. After pressing the button, the Mac address of the button will immediately appear on the screen. Remember the address to be able to create the configuration file.
Traceback (most recent call last):
  File "/usr/local/bin/amazon-dash", line 6, in <module>
    catch(cli)()
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/exceptions.py", line 91, in wrap
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/management.py", line 127, in discovery
    discover(interface)
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/discovery.py", line 98, in discover
    scan_devices(discovery_print, lfilter=lambda d: d.src not in mac_id_list, iface=interface)
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/scan.py", line 27, in scan_devices
    lfilter=lfilter, iface=iface)
  File "/usr/local/lib/python2.7/dist-packages/scapy/sendrecv.py", line 836, in sniff
    *arg, **karg)] = iface
  File "/usr/local/lib/python2.7/dist-packages/scapy/arch/linux.py", line 454, in __init__
    attach_filter(self.ins, filter, iface)
  File "/usr/local/lib/python2.7/dist-packages/scapy/arch/linux.py", line 140, in attach_filter
    bp = compile_filter(bpf_filter, iface)
  File "/usr/local/lib/python2.7/dist-packages/scapy/arch/common.py", line 126, in compile_filter
    raise Scapy_Exception("tcpdump is not available. Cannot use filter !")
scapy.error.Scapy_Exception: tcpdump is not available. Cannot use filter !

I am having the same issue as you. Also on Raspberry Pi with Python 3.5.3. I resolved my issue by installing tcpdump with:
sudo apt-get install tcpdump

@ytulsiani ah of course! For some reason that package wasn't found for me on my Pi Zero at first so I thought I couldn't download it. After running sudo apt-get update then sudo apt-get install tcpdump it worked like a charm!