Nekmo / amazon-dash

Hack your Amazon Dash to run what you want.
MIT License
828 stars 67 forks source link

Doubts in the installation between python2 and python3. #129

Closed LeidenSpain closed 5 years ago

LeidenSpain commented 5 years ago

What is the purpose of your issue?

Guideline for bug reports

feb 27 22:26:09 home-server systemd[1]: Started Amazon Dash service. feb 27 22:26:10 home-server env[628]: Welcome to Amazon-dash v1.3.2 using Python 3.6.7 feb 27 22:26:10 home-server env[628]: Listening for events. Amazon-dash will execute the events associated with the regi lines 1-11/11 (END)


#### Description
Everything worked perfectly, although a few days ago I did not use the button.
Since the last use I have also updated home assistant to version 0.88.1. I do not know if it will have anything to do with it.

The service is OK.
If I press the button, I see it in the console.

home-server@home-server:~$ sudo amazon-dash discovery Welcome to Amazon-dash v1.3.2 using Python 3.6.7 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. 52:c7:be:xx:xx:xx 00:fc:8b:xx:xx:xx (Amazon Device)


If you activate the service from the console, the home assistant event is activated

home-server@home-server:~sudo amazon-dash test-device 00:FC:8B:xx:xx:xx --config /etc/amazon-dash.yml Welcome to Amazon-dash v1.3.2 using Python 3.6.7 /usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) 2019-02-28 20:47:32,314 - amazon-dash - INFO - {"message": "Event dash1 fired."}



But if I press the button, nothing happens, nor do I see any record in home assistant.

I am totally and completely lost....

**HELP** 😄 
Nekmo commented 5 years ago

Hello, if test-device works and the device is recognized using discovery, everything should work. Maybe there is a problem with your network or with your computer. Some network cards may be suspended, or there may be Wifi issues after a while.

LeidenSpain commented 5 years ago

It is the same team as always, with the same configuration. The equipment shares files by SMB, therefore the wifi works perfectly.

LeidenSpain commented 5 years ago

I think I've discovered where it fails. I have decided to follow all the installation steps again, at one point I get an error (previously it worked):

sudo python -m amazon_dash.install
/usr/bin/python: No module named amazon_dash

I'm reading this post, but at the moment the error wins :( https://github.com/Nekmo/amazon-dash/issues/36

LeidenSpain commented 5 years ago

HI,

More info (I hope not to saturate the thread): I have reinstalled amazon-dash and it gives me this message:

home-server@home-server:~$ sudo pip install amazon-dash
The directory '/home/home-server/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/home-server/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.**
Collecting amazon-dash
  Downloading https://files.pythonhosted.org/packages/05/7a/564d0ea6e9dad48394ac055098541086b95fbee45123dcc64eee9dee84f2/amazon-dash-1.3.2.tar.gz
Requirement already satisfied: PyYAML>=3.0 in /usr/local/lib/python3.6/dist-packages (from amazon-dash) (3.13)
Requirement already satisfied: click in /usr/local/lib/python3.6/dist-packages (from amazon-dash) (7.0)
Requirement already satisfied: click-default-group in /usr/local/lib/python3.6/dist-packages (from amazon-dash) (1.2)
Requirement already satisfied: jsonschema in /usr/local/lib/python3.6/dist-packages (from amazon-dash) (2.6.0)
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from amazon-dash) (2.21.0)
Requirement already satisfied: scapy>=2.4.0 in /usr/local/lib/python3.6/dist-packages (from amazon-dash) (2.4.2)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->amazon-dash) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->amazon-dash) (2018.11.29)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->amazon-dash) (1.24.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3/dist-packages (from requests->amazon-dash) (3.0.4)
Installing collected packages: amazon-dash
  Running setup.py install for amazon-dash ... done
Successfully installed amazon-dash-1.3.2

I do not remember the other time he gave me this message

LeidenSpain commented 5 years ago

Finally: https://github.com/Nekmo/amazon-dash/issues/105#issuecomment-435635303

sudo python3 -m amazon_dash.install
Nekmo commented 5 years ago

Yes, this is a problem in some distributions. Thanks for notifying.