tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Sun May 20, 2018 3:16 am

oss001 wrote:
Fri May 11, 2018 4:27 am
When running install-deps.sh I am getting the following error output...
google-api-core 0.1.4 has requirement requests<3.0.0dev,>=2.18.0, but you'll have requests 2.14.2 which is incompatible.
Anyone know what I can do to resolve?
I got this error too, but Assistant is working for me despite it although that might only be because I already had it installed.

The instructions on GitHub for installing the aiyprojects branch are outdated and don't work, which is why my instructions still make use of a script from the old voicekit branch. An updated version of the instructions is supposed to be published on GitHub soon, and when it does I'll update my post.

User avatar
piglet
Posts: 872
Joined: Sat Aug 27, 2011 1:16 pm

Re: GUIDE: Google Assistant on Raspbian

Sun May 20, 2018 5:23 pm

Thanks for the update instructions

I've tried several times, including entirely removing the directory and starting again - and can't get it started any longer. I'm stumped
(env) [email protected] ~/AIY-projects-python $ python3 src/main.py
python3: can't open file 'src/main.py': [Errno 2] No such file or directory
(env) [email protected] ~/AIY-projects-python $
(env) [email protected] ~/AIY-projects-python $ src/examples/voice/assistant_library_demo.py
Traceback (most recent call last):
File "src/examples/voice/assistant_library_demo.py", line 28, in <module>
import aiy.assistant.auth_helpers
ImportError: No module named 'aiy'
(env) [email protected] ~/AIY-projects-python $ python3 checkpoints/check_audio.py
Traceback (most recent call last):
File "checkpoints/check_audio.py", line 28, in <module>
import aiy.audio # noqa
ImportError: No module named 'aiy'

tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Sun May 20, 2018 6:00 pm

piglet wrote:
Sun May 20, 2018 5:23 pm
Thanks for the update instructions

I've tried several times, including entirely removing the directory and starting again - and can't get it started any longer. I'm stumped
(env) [email protected] ~/AIY-projects-python $ python3 src/main.py
python3: can't open file 'src/main.py': [Errno 2] No such file or directory
(env) [email protected] ~/AIY-projects-python $
Sorry I forgot to update the path for the "ln -s" command, it should be fixed in the instructions now. Run these commands and then the src/main.py file should exist:

Code: Select all

rm src/main.py
ln -s examples/voice/assistant_library_with_local_commands_demo.py src/main.py
piglet wrote:
Sun May 20, 2018 5:23 pm
(env) [email protected] ~/AIY-projects-python $ src/examples/voice/assistant_library_demo.py
Traceback (most recent call last):
File "src/examples/voice/assistant_library_demo.py", line 28, in <module>
import aiy.assistant.auth_helpers
ImportError: No module named 'aiy'
(env) [email protected] ~/AIY-projects-python $ python3 checkpoints/check_audio.py
Traceback (most recent call last):
File "checkpoints/check_audio.py", line 28, in <module>
import aiy.audio # noqa
ImportError: No module named 'aiy'
I encountered this error yesterday when I was figuring out how to get the new version working, but thought it was fixed by running scripts/install-deps.sh. But I just checked and that doesn't run the following command like I thought it did:

Code: Select all

echo "$HOME/AIY-projects-python/src" > $HOME/AIY-projects-python/env/lib/python3.5/site-packages/aiy.pth
Try running that command and please let me know if it fixes your issues.

User avatar
piglet
Posts: 872
Joined: Sat Aug 27, 2011 1:16 pm

Re: GUIDE: Google Assistant on Raspbian

Sun May 20, 2018 6:03 pm

Aha! OK - got somewhere:

(env) [email protected] ~/AIY-projects-python $ PYTHONPATH="src/" src/examples/voice/assistant_library_demo.py
Say "OK, Google" then speak, or press Ctrl+C to quit...
Now...how to make that permanent so that running as a service works...


I was just posting this when you replied. Yes,
the echo "$HOME/AIY-projects-python/src" > $HOME/AIY-projects-python/env/lib/python3.5/site-packages/aiy.pth
works. Thank you.

Aditya Thakur
Posts: 2
Joined: Sun May 27, 2018 12:56 pm

Re: GUIDE: Google Assistant on Raspbian

Sun May 27, 2018 1:04 pm

Hi,
When I am running the last command in the guide: python3 src/main.py
, I am getting a comment as: cannot run hotword demo on Pi Zero!
I guess that it is because of the incompatibility of the Pi Zero W that I am running. If yes, can you please somehow resolve this issue ASAP as I have this project for my school. Please help.
Thanks in advance,
Aditya Thakur

tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Sun May 27, 2018 6:21 pm

Aditya Thakur wrote:
Sun May 27, 2018 1:04 pm
Hi,
When I am running the last command in the guide: python3 src/main.py
, I am getting a comment as: cannot run hotword demo on Pi Zero!
I guess that it is because of the incompatibility of the Pi Zero W that I am running. If yes, can you please somehow resolve this issue ASAP as I have this project for my school. Please help.
Thanks in advance,
Aditya Thakur
You are correct, the hotword detection of the Assistant SDK is incompatible with the Pi Zero W. It only works on ARMv7 processors, which the Pi 2B, 3B, and 3B+ have, but the Pi Zero has an ARMv6 CPU. However, there is a project on GitHub which implements hotword detection for Assistant on the Zero W: https://github.com/warchildmd/google-as ... word-raspi

I would suggest trying it if you want something as close to the official Assistant SDK as possible, but if you want more features there is also this project which should work on all Pis (except the streaming uses too much CPU to be practical on the Zero): https://github.com/shivasiddharth/GassistPi

cobra2012
Posts: 2
Joined: Sun May 27, 2018 9:53 pm

Re: GUIDE: Google Assistant on Raspbian

Sun May 27, 2018 10:29 pm

Thanks for the guide! But I still have the error with low volume.

I can't increase the volume with the command "okay google, set up the volume to max".

Assistant aswers:
To get help with that you will need some informations....

Any fix?

Edit:

Can I change the language of the Assistant (not TTS)? :)

thanks

tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Mon May 28, 2018 8:58 pm

cobra2012 wrote:
Sun May 27, 2018 10:29 pm
Thanks for the guide! But I still have the error with low volume.

I can't increase the volume with the command "okay google, set up the volume to max".

Assistant answers:
To get help with that you will need some information....

Any fix?
Do all commands result in that answer, or just the volume one? I'm afraid I don't know what would be causing that or how to fix it, but you could ask on the AIY Projects subforum and hopefully someone there might know.
cobra2012 wrote:
Sun May 27, 2018 10:29 pm
Can I change the language of the Assistant (not TTS)? :)

thanks
When you say "not TTS", I'm guessing that means to change the language of the commands it takes in, not just what it says. I believe changing this is possible from the Assistant app on your phone. Try changing the language in the device settings as shown in the second part of this answer: https://stackoverflow.com/questions/480 ... istant-sdk

cobra2012
Posts: 2
Joined: Sun May 27, 2018 9:53 pm

Re: GUIDE: Google Assistant on Raspbian

Mon May 28, 2018 11:08 pm

tjohnson wrote:
Mon May 28, 2018 8:58 pm

Do all commands result in that answer, or just the volume one? I'm afraid I don't know what would be causing that or how to fix it, but you could ask on the AIY Projects subforum and hopefully someone there might know.

Many thanks for the fast answer! Fortunately it works now!

Yesterday, I tried all commands see here.
tjohnson wrote:
Mon May 28, 2018 8:58 pm
When you say "not TTS", I'm guessing that means to change the language of the commands it takes in, not just what it says. I believe changing this is possible from the Assistant app on your phone. Try changing the language in the device settings as shown in the second part of this answer: https://stackoverflow.com/questions/480 ... istant-sdk
Today I found the Information with Google Assistant App on the Web and I changed the Language to German. I rebooted the Pi and he speaks German now! :) Great!

And that's not all! I could set the Volume to Max with the German Command " Set volume to max". It works fluently now! I can't explain why it was not working in english yesterday. Thumbs up! Have a nice day! :) :)

Aditya Thakur
Posts: 2
Joined: Sun May 27, 2018 12:56 pm

Re: GUIDE: Google Assistant on Raspbian

Tue May 29, 2018 4:18 pm

tjohnson wrote:
Sun May 27, 2018 6:21 pm
Aditya Thakur wrote:
Sun May 27, 2018 1:04 pm
Hi,
When I am running the last command in the guide: python3 src/main.py
, I am getting a comment as: cannot run hotword demo on Pi Zero!
I guess that it is because of the incompatibility of the Pi Zero W that I am running. If yes, can you please somehow resolve this issue ASAP as I have this project for my school. Please help.
Thanks in advance,
Aditya Thakur
You are correct, the hotword detection of the Assistant SDK is incompatible with the Pi Zero W. It only works on ARMv7 processors, which the Pi 2B, 3B, and 3B+ have, but the Pi Zero has an ARMv6 CPU. However, there is a project on GitHub which implements hotword detection for Assistant on the Zero W: https://github.com/warchildmd/google-as ... word-raspi

I would suggest trying it if you want something as close to the official Assistant SDK as possible, but if you want more features there is also this project which should work on all Pis (except the streaming uses too much CPU to be practical on the Zero): https://github.com/shivasiddharth/GassistPi
Hi,
Thank you very much for your fast and helpful reply. I tried the first link you gave and it worked!
So now, instead of the official "OK Google" hotword, I designed my own hotword on Snowboy's kitt.ai and now it works perfectly!
Thank you,
Regards, Aditya

vinayrnair
Posts: 1
Joined: Fri Jun 01, 2018 8:49 pm

Re: GUIDE: Google Assistant on Raspbian

Fri Jun 01, 2018 8:55 pm

This post / instruction is so cool. thanks a lot @tjohnson. I am almost there in getting this to work. But have found few errors which I see has been discussed above. I would like to know if there is a way I can "undo" or start fresh with the installation? or is it that I run the commands again and it will overwrite itself?

tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Sat Jun 02, 2018 3:38 am

vinayrnair wrote:
Fri Jun 01, 2018 8:55 pm
This post / instruction is so cool. thanks a lot @tjohnson. I am almost there in getting this to work. But have found few errors which I see has been discussed above. I would like to know if there is a way I can "undo" or start fresh with the installation? or is it that I run the commands again and it will overwrite itself?
Glad to hear that my guide is useful. If you want to start fresh with the installation, just delete the folder you installed the Assistant SDK in (probably /home/pi/AIY-projects/python) and run through the commands in the guide again.

The AIY scripts conveniently install all their dependencies inside a virtual environment in that folder, so deleting that folder should cleanly remove Assistant from your Pi so you can start fresh (with the exception of the systemd service files, which should be fine to leave around because they will get overwritten).

savier
Posts: 2
Joined: Sat Jun 02, 2018 3:28 pm

Re: GUIDE: Google Assistant on Raspbian

Sat Jun 02, 2018 3:31 pm

Hello tjohnson, thank you for providing the guide here. When I tried to run the last command, I encountered an error:

(env) [email protected]:~/AIY-projects-python $ python3 src/main.py

Traceback (most recent call last):
File "src/main.py", line 103, in <module>
main()
File "src/main.py", line 97, in main
with Assistant(credentials) as assistant:
File "/home/pi/AIY-projects-python/src/aiy/assistant/library.py", line 33, in __init__
self._model_id = device_helpers.register_model_id(credentials)
File "/home/pi/AIY-projects-python/src/aiy/assistant/device_helpers.py", line 76, in register_model_id
project_id = _get_project_id()
File "/home/pi/AIY-projects-python/src/aiy/assistant/device_helpers.py", line 39, in _get_project_id
return client_secrets_data["installed"]["project_id"]
KeyError: 'installed'

==========
It looks like it could not find the dict named "installed". Appreciate your advice on how to solve this problem.

Thank you!

savier
Posts: 2
Joined: Sat Jun 02, 2018 3:28 pm

Re: GUIDE: Google Assistant on Raspbian

Sat Jun 02, 2018 3:45 pm

Actually, it was my mistake. I choose "web application" during the OAuth Client ID creation instead of something else. I amended the dict from "web" to "installed" in the assistant.json file and it worked.

But now, I encountered [20564:20590:ERROR:audio_input_processor.cc(748)] Input error

I had followed Google's guide to set up the USB microphone, but it looks like I missed out a step. Any guesses?

tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Sun Jun 03, 2018 4:25 am

savier wrote:
Sat Jun 02, 2018 3:45 pm
Actually, it was my mistake. I choose "web application" during the OAuth Client ID creation instead of something else. I amended the dict from "web" to "installed" in the assistant.json file and it worked.

But now, I encountered [20564:20590:ERROR:audio_input_processor.cc(748)] Input error

I had followed Google's guide to set up the USB microphone, but it looks like I missed out a step. Any guesses?
Have you tried the troubleshooting steps listed in step 3 of Google's guide? (https://developers.google.com/assistant ... mbed/audio)

Running the commands listed there should determine if there is a problem with how either the playback or recording device is set up. If one of them isn't working, you can use the commands arecord -l and aplay -l to list the sound devices connected to your Pi. This will tell you the appropriate device numbers to use in the .asoundrc file, and make sure to fill both card and device numbers in the file correctly. I've made the mistake before of forgetting to fill in the placeholder values.

If that doesn't help and you still experience this error, could you provide more details about the speaker/microphone setup you are trying to use with the Pi? Also can they play or record sound in other programs? Perhaps one of your devices will require more configuration than usual on the Pi.

p7810456
Posts: 1
Joined: Fri Jun 08, 2018 8:48 pm

Re: GUIDE: Google Assistant on Raspbian

Fri Jun 08, 2018 8:53 pm

I get an error while running the main.py script:

Code: Select all

Traceback (Most recent call last):
	File "src/main.py", line 29, in <module>
		import aiy.assistant.auth_helpers
ImportError: No module named 'aiy'

dragooner12
Posts: 1
Joined: Sat Jun 09, 2018 8:55 am

Re: GUIDE: Google Assistant on Raspbian

Sun Jun 10, 2018 8:17 pm

I am having a problem with setting up voice recognition on the raspberry pi 3b, I have google assistant up and running as per your instruction but the keyword "ok google" doesn't seem to be working. After setting up my audio configuration one thing I noticed is that playback of my voice recording is sped up, I am wondering if this has anything to do with the voice recognition. Is the pitch too high and fast for the API to recognize commands? I am using a compatible USB microphone and testing my configuration using Alsa audio. Please help, any feedback would be most appreciated!

xxTelfesxx
Posts: 1
Joined: Wed Jun 20, 2018 5:06 pm

Re: GUIDE: Google Assistant on Raspbian

Wed Jun 20, 2018 5:10 pm

Hello
I want to run the assistant on a pi wit openhabian, but i get errormessages when i run main.py

Traceback (most recent call last):
File "src/main.py", line 103, in <module>
main()
File "src/main.py", line 96, in main
credentials = aiy.assistant.auth_helpers.get_assistant_credentials()
File "/home/openhabian/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 132, in get_assistant_credentials
return _try_to_get_credentials(credentials_file)
File "/home/openhabian/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 100, in _try_to_get_credentials
return _load_credentials(_ASSISTANT_CREDENTIALS)
File "/home/openhabian/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 63, in _load_credentials
credentials.refresh(http_request)
File "/home/openhabian/AIY-projects-python/env/lib/python3.5/site-packages/google/oauth2/credentials.py", line 136, in refresh
self._client_secret))
File "/home/openhabian/AIY-projects-python/env/lib/python3.5/site-packages/google/oauth2/_client.py", line 237, in refresh_grant
response_data = _token_endpoint_request(request, token_uri, body)
File "/home/openhabian/AIY-projects-python/env/lib/python3.5/site-packages/google/oauth2/_client.py", line 111, in _token_endpoint_request
_handle_error_response(response_body)
File "/home/openhabian/AIY-projects-python/env/lib/python3.5/site-packages/google/oauth2/_client.py", line 61, in _handle_error_response
error_details, response_body)
google.auth.exceptions.RefreshError: ('deleted_client: The OAuth client was deleted.', '{\n "error" : "deleted_client",\n "error_description" : "The OAuth client was deleted."\n}')


There were also two incompatibilitys:
google-api-core 0.1.4 has requirement requests<3.0.0dev,>=2.18.0, but you'll have requests 2.14.2 which is incompatible.
google-assistant-library 0.1.0 has requirement google-auth==1.0.1, but you'll have google-auth 1.5.0 which is incompatible.

I am a beginner so any help is higly apprecheated. :)

Kuhlen
Posts: 1
Joined: Wed Aug 16, 2017 7:14 pm

Re: GUIDE: Google Assistant on Raspbian

Tue Jul 03, 2018 2:53 am

Hello, I don't know where I can find authorization code.
Can You Help Me?

greenwaydev
Posts: 1
Joined: Mon Apr 16, 2018 1:40 am

Re: GUIDE: Google Assistant on Raspbian

Wed Jul 04, 2018 4:11 pm

When I run python3 src/main.py, I am getting an Import Error on line 29 (the first import). It says there is no module named "aiy". What does this mean I did wrong? Thanks.

halomet.ncst
Posts: 1
Joined: Thu Jul 26, 2018 5:18 pm

Re: GUIDE: Google Assistant on Raspbian

Thu Jul 26, 2018 5:24 pm

Hi!
I have this error when running Google Assistant using "python -m googlesamples.assistant.grpc.pushtotalk", the error line is stated below.

INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: '/home/pi/.config/googlesamples-assistant/device_config.json'
INFO:root:Registering device
ERROR:root:Options --device-model-id required when registering a device instance.

I really hope you can help me with this. Thanks in advance!

LorenzoZappa
Posts: 4
Joined: Sun Aug 12, 2018 8:37 pm

Re: GUIDE: Google Assistant on Raspbian

Sun Aug 12, 2018 8:40 pm

Hello guys,
I have a problem and I don't know how to solve it. Basically every time I try to run
scripts/install-deps.sh
I get this error
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
And then I have no
scripts/install-services.sh file
Any help?
Thanks

tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Mon Aug 13, 2018 11:18 am

LorenzoZappa wrote:
Sun Aug 12, 2018 8:40 pm
Hello guys,
I have a problem and I don't know how to solve it. Basically every time I try to run
scripts/install-deps.sh
I get this error
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
And then I have no
scripts/install-services.sh file
Any help?
Thanks
Last week Google changed the Assistant SDK to make the installation process completely different, making my old instructions not work anymore. I've set up a GitHub repo with the new instructions, could you try it out and let me know how it goes? https://github.com/t1m0thyj/AssistantPi

LorenzoZappa
Posts: 4
Joined: Sun Aug 12, 2018 8:37 pm

Re: GUIDE: Google Assistant on Raspbian

Tue Aug 14, 2018 9:33 pm

tjohnson wrote:
Mon Aug 13, 2018 11:18 am
LorenzoZappa wrote:
Sun Aug 12, 2018 8:40 pm
Hello guys,
I have a problem and I don't know how to solve it. Basically every time I try to run
scripts/install-deps.sh
I get this error
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
And then I have no
scripts/install-services.sh file
Any help?
Thanks
Last week Google changed the Assistant SDK to make the installation process completely different, making my old instructions not work anymore. I've set up a GitHub repo with the new instructions, could you try it out and let me know how it goes? https://github.com/t1m0thyj/AssistantPi
Unfortunately I already installed it following google guides, the only problem I have is that mic is not working...

tjohnson
Posts: 27
Joined: Sat Jun 11, 2016 7:39 pm
Location: Pennsylvania, USA

Re: GUIDE: Google Assistant on Raspbian

Tue Aug 14, 2018 11:09 pm

LorenzoZappa wrote:
Tue Aug 14, 2018 9:33 pm
tjohnson wrote:
Mon Aug 13, 2018 11:18 am
LorenzoZappa wrote:
Sun Aug 12, 2018 8:40 pm
Hello guys,
I have a problem and I don't know how to solve it. Basically every time I try to run
scripts/install-deps.sh
I get this error
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
And then I have no
scripts/install-services.sh file
Any help?
Thanks
Last week Google changed the Assistant SDK to make the installation process completely different, making my old instructions not work anymore. I've set up a GitHub repo with the new instructions, could you try it out and let me know how it goes? https://github.com/t1m0thyj/AssistantPi
Unfortunately I already installed it following google guides, the only problem I have is that mic is not working...
Have you tried these instructions published by Google for configuring the audio: https://developers.google.com/assistant ... mbed/audio

Return to “General discussion”

Who is online

Users browsing this forum: 6by9, allfox, Brandon92, drgeoff, topguy and 50 guests