Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsonschema has been updated to 3.0.0 (incompatible update) #130

Closed
1 of 4 tasks
Zachary3352 opened this issue Mar 2, 2019 · 8 comments
Closed
1 of 4 tasks

jsonschema has been updated to 3.0.0 (incompatible update) #130

Zachary3352 opened this issue Mar 2, 2019 · 8 comments
Milestone

Comments

@Zachary3352
Copy link

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

Description

I'm trying to install Amazon Dash on my Raspberry Pi. I've gotten pretty far, but it wasn't working correctly when I just started the utility, so I did a little more digging...

What I Did

I tried running sudo amazon-dash check-config --config /etc/amazon-dash.yml and here's what comes up:
Welcome to Amazon-dash v1.3.2 using Python 2.7.9 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/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/amazon_dash/management.py", line 109, in check_config from amazon_dash.config import check_config File "/usr/local/lib/python2.7/dist-packages/amazon_dash/config.py", line 7, in <module> from jsonschema import validate, ValidationError File "/usr/local/lib/python2.7/dist-packages/jsonschema/__init__.py", line 12, in <module> from jsonschema.exceptions import ( File "/usr/local/lib/python2.7/dist-packages/jsonschema/exceptions.py", line 141, in <module> @attr.s(hash=True) AttributeError: 'module' object has no attribute 's'

When I run sudo systemctl status amazon-dash here's what I get:
● amazon-dash.service - Amazon Dash service Loaded: loaded (/usr/lib/systemd/system/amazon-dash.service; disabled) Active: activating (auto-restart) (Result: exit-code) since Sat 2019-03-02 03:24:03 EST; 627ms ago Process: 19691 ExecStart=/usr/bin/env amazon-dash run --config /etc/amazon-dash.yml (code=exited, status=1/FAILURE) Main PID: 19691 (code=exited, status=1/FAILURE)

I would really appreciate your help trying to solve these issues! Thanks!

@Nekmo
Copy link
Owner

Nekmo commented Mar 3, 2019

Try installing jsonschema 2.6.0:

pip install jsonschema==2.6.0

A new version has been released recently and may have broken the backward compatibility.

@Zachary3352
Copy link
Author

Thanks for your help. This seems to have made the issue a bit better, but I'm still having some other issues.

First, how do I turn debugging/logging on? I've tried amazon-dash run* --info and amazon-dash --info run* but neither of them are working. I thought this was how I was supposed to do it, but if you could please tell me the correct way I would really appreciate it.

Back to the original question: Now, my config checks out, so that's great, but when I run sudo systemctl status amazon-dash I get this most of the time:
sudo systemctl status amazon-dash ● amazon-dash.service - Amazon Dash service Loaded: loaded (/usr/lib/systemd/system/amazon-dash.service; disabled) Active: activating (auto-restart) (Result: exit-code) since Sun 2019-03-03 23:03:10 EST; 51ms ago Process: 23284 ExecStart=/usr/bin/env amazon-dash run --config /etc/amazon-dash.yml (code=exited, status=1/FAILURE) Main PID: 23284 (code=exited, status=1/FAILURE)
But I get this some of the time (maybe one in five times):
sudo systemctl status amazon-dash ● amazon-dash.service - Amazon Dash service Loaded: loaded (/usr/lib/systemd/system/amazon-dash.service; disabled) Active: active (running) since Sun 2019-03-03 23:03:13 EST; 269ms ago Main PID: 23312 (amazon-dash) CGroup: /system.slice/amazon-dash.service └─23312 /usr/bin/python /usr/local/bin/amazon-dash run --config /etc/amazon-dash.yml Mar 03 23:03:13 raspberrypi2 systemd[1]: Started Amazon Dash service. Mar 03 23:03:13 raspberrypi2 env[23312]: Welcome to Amazon-dash v1.3.2 using Python 2.7.9 Mar 03 23:03:13 raspberrypi2 env[23312]: Listening for events. Amazon-dash will execute the events associated with the registered buttons.

Unfortunately, no matter what, it doesn't seem like my commands are being sent. I get the notification on my phone that Amazon wants me to complete button setup, so I know the button is working right. I've also confirmed my MAC address is correct. Here's my config for IFTTT in amazon-dash.yml:

[REDACTED]: name: LIFX ifttt: [REDACTED] event: light data: {}

Does this code look right? If so, might you know what's going on? I really appreciate your help. Thanks!

@Nekmo
Copy link
Owner

Nekmo commented Mar 4, 2019

You have to remove the asterisk (*) from the run command.

@Zachary3352
Copy link
Author

Here's what I get when I run sudo amazon-dash run --info:
Welcome to Amazon-dash v1.3.2 using Python 2.7.9 Usage: amazon-dash run [OPTIONS] Try "amazon-dash run --help" for help. Error: no such option: --info

Am I making another mistake? Thank you for your help!

@Nekmo
Copy link
Owner

Nekmo commented Mar 6, 2019

Use amazon-dash --info run instead amazon-dash run --info

@Zachary3352
Copy link
Author

Thanks! The command seems to run now. I'm not at home right now, but when I am I'll try it with a button and let you know if it works.

BTW, for anyone looking later at this string, Amazon Dash uses Python 2.7 for me, so I had to change the last line in my _compat.py by removing "subprocess32 as" and that fixed it for me. If you have trouble doing this, please let me know and I can help you.

@Zachary3352
Copy link
Author

Everything is working! Thanks again @Nekmo for your help.

@Nekmo Nekmo reopened this Mar 9, 2019
@Nekmo
Copy link
Owner

Nekmo commented Mar 9, 2019

Thanks! I will fix the requeriment in the next version.

@Nekmo Nekmo added this to the v1.3.3 milestone Mar 11, 2019
@Nekmo Nekmo changed the title Issue setting up Amazon Dash on Raspberry Pi jsonschema has been updated to 3.0.0 (incompatible update) Mar 12, 2019
@Nekmo Nekmo closed this as completed Mar 13, 2019
@Nekmo Nekmo modified the milestones: v1.3.3, v1.4.0 Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants