Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Error when executing src/examples/voice/assistant_grpc_demo.py #658

Open
vishwapinnawala opened this issue Dec 12, 2019 · 14 comments · May be fixed by #706
Open

Error when executing src/examples/voice/assistant_grpc_demo.py #658

vishwapinnawala opened this issue Dec 12, 2019 · 14 comments · May be fixed by #706

Comments

@vishwapinnawala
Copy link

newbie here Help!!! Tried Re enabling Assistant API and i tried installing AIY os again and again 3 times no luck

Traceback (most recent call last):
File "src/examples/voice/assistant_grpc_demo.py", line 57, in
main()
File "src/examples/voice/assistant_grpc_demo.py", line 49, in main
language_code=args.language)
File "/home/pi/AIY-projects-python/src/aiy/assistant/grpc.py", line 258, in init
super().init(language_code, volume_percentage)
File "/home/pi/AIY-projects-python/src/aiy/assistant/grpc.py", line 94, in init
credentials = auth_helpers.get_assistant_credentials()
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 151, in get_assistant_credentials
return _try_to_get_credentials(credentials_file)
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 123, in _try_to_get_credentials
credentials = _credentials_flow_interactive(client_secrets)
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 75, in _credentials_flow_interactive
webbrowser.register('chromium-browser', None, webbrowser.Chrome('chromium-browser'), -1)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given

@manoj7410
Copy link

@vishwapinnawala Which version of voice kit do you have ?
Have you reflashed the kit with the image provided at https://github.com/google/aiyprojects-raspbian/releases/tag/v20191113 ?

@vishwapinnawala
Copy link
Author

V2 yes i tried reflashing several times and nothing seems to work

@daOrangePeeler
Copy link

I'm getting an identical error with voice kit v1. I also tried reflashing the image with no success.

@daOrangePeeler
Copy link

daOrangePeeler commented Dec 24, 2019

I fixed the error for my setup with the Raspberry Pi 3B with AIY Voice Kit v1. In the file "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", I changed the last argument in webbrowser.register() (line 75) from "-1" to "preferred=True".

Here is the documentation that explains the options for webbrowser.register(). It looks like in Python 3.7, the webbrowser.register() "preferred" argument only takes keywords now.

Here is the full, edited file. GitHub wouldn't let me upload the file directly, so the file is on Google Drive.

Or, if you just want to edit the code directly, here is the new code for line 75 in the file "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py":
webbrowser.register('chromium-browser', None, webbrowser.Chrome('chromium-browser'), preferred=True)
(Make sure to leave the spaces from the original line of code in front of the new code segment as spacing matters in Python).

Please let me know if it works or not, or if you have any questions.

@stevesss
Copy link

stevesss commented Dec 26, 2019

The above solved the problem of opening the browser and authenticating the voice kit as it takes me to the web page that says the process is complete, but then the next time I do "assistant_grpc_demo.py" again, it just starts this authentication process all over again instead of starting up like it is supposed to. (I had it working before.) I am stuck at this point for now.

@vishwapinnawala
Copy link
Author

vishwapinnawala commented Dec 27, 2019 via email

@daOrangePeeler
Copy link

The above solved the problem of opening the browser and authenticating the voice kit as it takes me to the web page that says the process is complete, but then the next time I do "assistant_grpc_demo.py" again, it just starts this authentication process all over again instead of starting up like it is supposed to. (I had it working before.) I am stuck at this point for now.

I'm sorry to hear that stevesss. I just reflashed the image, created a new Google Cloud project and edited the auth_helpers.py file without success in replicating your problem. What Raspberry Pi and Voice Kit version are you using? I know it is a long process, but you might want to try reflashing your image.

@d3acon
Copy link

d3acon commented Dec 29, 2019

Editing auth_helpers.py solved it for me too. But I get a seg fault, once I did the authorisation in the browser.

@mcmanus-git
Copy link

I'm having the same issue as @d3acon

@daOrangePeeler
Copy link

I get a segmentation fault as well for every file except "assistant_grpc_demo.py"

@d3acon
Copy link

d3acon commented Dec 31, 2019

I opened a new ticket for the seg fault, as this one is for the python problem.

@2000prasanth
Copy link

please check i have written a blog on all error that i have encountered
https://2000prasanth.wixsite.com/website/blog/aiy-voice-how-i-set-up-my-voice-kit-amid-errors-my-first-raspberry-pi-project

@2000prasanth
Copy link

2000prasanth commented Feb 13, 2020 via email

@downeyjar
Copy link

downeyjar commented Feb 16, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants