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

Async Error - Python 3.7 #82

Open
truejp opened this issue Mar 12, 2021 · 5 comments
Open

Async Error - Python 3.7 #82

truejp opened this issue Mar 12, 2021 · 5 comments

Comments

@truejp
Copy link

truejp commented Mar 12, 2021

Hey there,
I'm facing the following issue with the assistant.py script:

pi@raspberrypi:~/MagicMirror/modules/MMM-GoogleAssistant/pi $ python3 assistant.py
File "assistant.py", line 64
pubnub.publish().channel("magicmirror").message("hello from python!!").async(my_publish_callback)
^
SyntaxError: invalid syntax

Looks like there is either dependency missing on my side, but it might also be a change within the syntax of the more recent python versions? I can't find useful information on that online, maybe anyone over here can help me fix this.

Best regards,
Philipp

Edit: I'm not that familiar with code quoting on GitHub, the issue points at the 'c' of .async(...). :)

@truejp
Copy link
Author

truejp commented Mar 12, 2021

Worked out some changes, still need to further analyze how the script works. At least I'm able compile it by now.

assistant.zip

@truejp
Copy link
Author

truejp commented Mar 12, 2021

Looks like the issue could be fixed using ".pn_async(callback_function)" instead of ".async(callback_function)". See "other examples" over here: https://www.pubnub.com/docs/sdks/python/api-reference/publish-and-subscribe

Still need to double check tho, stay tuned.

Edit: Well, the changed script kind of works (plays a sound once I say "Hey Google"), however it crashes afterwards and MM won't start using this module.

@truejp
Copy link
Author

truejp commented Mar 16, 2021

Hey guys, my installation of the Google Assistant API had an issue. With the changes mentioned in my last comment, the service works perfectly fine!! Please consider including the changes in your assistant.py script.
Best regards,
Philipp

@varadwattamwar
Copy link

Hey guys, my installation of the Google Assistant API had an issue. With the changes mentioned in my last comment, the service works perfectly fine!! Please consider including the changes in your assistant.py script.
Best regards,
Philipp

Can you please help me out, in my code demo, google assistant is only responding 1-2 times in every 20 tries. I also changed my mic sensitivity but the results are same.
Im using Raspberry pi 3B

@burnerbmx
Copy link

pi@raspberrypi:/MagicMirror/modules/MMM-GoogleAssistant/pi $ /home/pi/env/bin/python3 -u assistant.py
File "assistant.py", line 64
pubnub.publish().channel("magicmirror").message("hello from python!!").async(my_publish_callback)
^
SyntaxError: invalid syntax
pi@raspberrypi:
/MagicMirror/modules/MMM-GoogleAssistant/pi $
hello im getting ths error ive had the google assit on in my command line and it works a treat

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

3 participants