andgineer / docker-amazon-dash-button-hack

Amazon Dash Button hack in Docker for Synology
http://masterandrey.com/posts/en/amazon_dash_button/
11 stars 8 forks source link

Simplified fork error #5

Closed CoreyCole closed 7 years ago

CoreyCole commented 7 years ago

I'm working on a simplified fork here where I'm trying to make a simple http request on button press. I was able to get it working with a fresh clone of your repo, but once I moved to my own docker image something has gone wrong.

docker run --rm --net host -it --name amazon_dash coreyleoc/docker-amazon-dash-button-hack
WARNING: No route found for IPv6 destination :: (no default route?). This affects only IPv6
loading buttons
amazon_dash started, loaded 1 buttons
Traceback (most recent call last):
  File "wifi-sniff.py", line 51, in <module>
    main()
  File "wifi-sniff.py", line 48, in main
    sniff(prn=arp_handler, filter="arp", store=0)
  File "/usr/lib/python3.5/site-packages/scapy/sendrecv.py", line 599, in sniff
    r = prn(p)
  File "wifi-sniff.py", line 32, in arp_handler
    if pkt.haslayer(ARP):
NameError: name 'ARP' is not defined

I'm still using your Dockerfile with your docker-python-base. I know pip is installing things correctly because when I open up bash in my docker I can call python and import scapy.all and such. Any advice? I'm very new to docker. Thanks~

CoreyCole commented 7 years ago

It is because I changed

from scapy.all import *

to

from scapy.all import sniff