New Google assistant SDK for python. With hotword support


72 posts   Page 3 of 3   1, 2, 3
by nervin79 » Fri May 26, 2017 5:08 am
s3rocool wrote:
nervin79 wrote:With regard to the google.samples error I have managed to get around it by copying the google samples folder from the sdk and put it in src.
Success at last. Now to find more than just taking photos with my voice.


How would we go about doing that?


Use a file manager to copy the googlesamples folder from /home/pi/assistant-sdk-python to /home/pi/voice-recognizer-raspi/src
Posts: 16
Joined: Sat May 06, 2017 6:44 am
by wood007 » Mon May 29, 2017 3:34 pm
@Bastiaan Slee
Just like to say - followed exactly the instructions posted by "Bastiaan Slee" and now it responds to "Okay Google". Thanks vey much
Posts: 10
Joined: Tue Oct 15, 2013 8:19 pm
by cmseal84 » Tue Jun 06, 2017 6:14 pm
I've tried this today but regardless of the upgrade, the google assistant sdk version still shows as 0.1.0.

I'm using the correct shell env from the AIY image desktop too.

Running main.py now, it seems to not be able to import anything at the start :(

Thoughts/suggestions welcome. Really want to be able to yell at this rather than walk over to it and press the button.

I've no idea of the default behaviour once this works, but having the LED show that it's heard the "Ok, Google" would be helpful too.
Posts: 2
Joined: Mon Dec 19, 2016 11:39 pm
by Silverlock » Tue Jun 06, 2017 6:19 pm
cmseal84 wrote:I've no idea of the default behaviour once this works, but having the LED show that it's heard the "Ok, Google" would be helpful too.


When the unit is waiting for a trigger, it's a slow pulse.

Once a trigger (GPIO, clap or hotword) has been recognized and it's waiting for a command, the LED is solid on.

While it's processing the command (including saying any response), it's a quick pulse.
RPi3+external HDD/Raspbian/Pixel desktop
Posts: 33
Joined: Wed Apr 10, 2013 3:51 am
by Sunspot » Tue Jun 06, 2017 7:11 pm
There is some great work here - BUT you can now add "OK Google" to the cardboard AIY using official Google software !!!
I followed this -
http://eduncan911.com/stem/embedded/aiy-google-assistant-upgrades-may-2017.html
and it works as well as the Google Assistant (no delays) but has the AIY advantage of software that Lesson 1 people like me can use to control local GPIO etc.

I had previously followed -
http://www.androidauthority.com/build-google-assistant-raspberry-pi-770296/
so as to use a USB microphone and TV speaker.
If you do that first you have to restore the modified check_audio.py file by doing -

cp /home/pi/voice-recognizer-raspi/checkpoints/check_audio.py /home/pi/voice-recognizer-raspi/checkpoints/check_audio.py~
then
git checkout /home/pi/voice-recognizer-raspi/checkpoints/check_audio.py


Then restore it later - I guess you could do all the USB microphone changes after getting "OK Google" installed - not tested.

There are several other upgrades. eg Use a wav ping sound instead of the LED.
I have not tried that yet
Posts: 10
Joined: Tue Nov 17, 2015 8:46 pm
by sgmoorthy » Tue Jun 13, 2017 8:03 pm
hi i followed fist step to get latest into raspberrypi3 and got following error
any help please
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 300, in move
rmtree(src)
File "/usr/lib/python2.7/shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "/usr/lib/python2.7/shutil.py", line 250, in rmtree
os.remove(fullname)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/requests/certs.pyc'
Posts: 1
Joined: Fri May 12, 2017 7:06 am
by e.hunt » Wed Jun 14, 2017 8:19 pm
wood007 wrote:@Bastiaan Slee
Just like to say - followed exactly the instructions posted by "Bastiaan Slee" and now it responds to "Okay Google". Thanks vey much

As a complete newbie to the pi and python i've managed to get this working with hotword. So much better than getting up and pressing the button.
thanks Bastiaan Slee
Posts: 1
Joined: Sun Jun 11, 2017 8:45 pm
by andrewp85 » Wed Jun 14, 2017 9:54 pm
Any suggestions why this might not work for me? Mine does not respond in any way to Hey Google or Ok Google.

I have gone over the instructions a number of times and cannot see any differences in my code. At first I had forgot to uncomment the trigger, but changing that and restarting has made no difference.

I also noticed my version of google assistant sdk was still on 0.1.0 . I put sudo python3 at the start as suggested and that didn't work, but typing pip install --upgrade google-assistant-sdk upgraded it to 0.3.2.

Thanks
Andrew
Posts: 10
Joined: Sat Jun 10, 2017 10:02 pm
by Sunspot » Sun Jun 18, 2017 2:38 pm
For info -
I have now got the AIY cardboard kit to use USB microphone, internal speaker (headphone) output and respond to "OK Google, read the data" and run a local Bash script - so now anything is possible !!

http://www.sunspot.co.uk/Projects/raspberrypi_LAN_master/Google_Assistant/Google_Assistant_Raspberry_Pi_IFTTT_Maker.html
(see the bottom of the page)

Is it true that speech in this case is created by local TTS?
Posts: 10
Joined: Tue Nov 17, 2015 8:46 pm
by andrewp85 » Sun Jun 18, 2017 9:48 pm
I still can't get this to work for me. I have re-installed the AIY projects image to my SD card and started again from scratch and then followed these instructions.

One part which appears to differ slightly and I am not sure if it is a factor;

On the instructions it says to change the voice-recognizer.ini file in /home/pi/.config/voice-recognizer.ini
On my image this is located in /home/pi/voice-recognizer-raspi/config/voice-recognizer.ini.default

After following the instructions exactly it doesn't work with hotword, but still works via the button. I then noticed my google-assistant-sdk is still 0.1.0 and as running the command given here doesn't seem to make a difference, I installed the latest version by entering pip install --upgrade google-assistant-sdk . That is when it stops working completely including with button press.

Can anyone please advise?
Posts: 10
Joined: Sat Jun 10, 2017 10:02 pm
by sheridat » Mon Jun 19, 2017 10:05 am
Hi,
I would
1. Re-image to get to the state where you can get the AIY box to work by pressing the button.
2. Unhide the .config directory where the configuration is held. I am assuming your using the GUI. Click on the File Manager icon, click View, select Show Hidden. The .config directory and quite a few others will magically appear.
3. Read the following post about updating your AIY softwarehttp://eduncan911.com/stem/embedded/aiy-google-assistant-upgrades-may-2017.html Do what it says
4. You will find that post also tells you about changing your config file to set hotword as the activation method and copying the file to the hidden directory.

If when you test it - if it doesn't work browse the journal by typing in a terminal sudo journalctl -u voice-recognizer -n 10 -f
If the journal suggests installing some software using pip - do so.
Posts: 66
Joined: Sun May 07, 2017 11:18 am
by andrewp85 » Tue Jun 20, 2017 4:25 pm
Thanks Sheridat I will follow your instructions carefully and hopefully will do the trick.

I actually started again and followed the links in Sunspot's earlier post. It now works with button press and if I type src/main.py --trigger="ok-google" , but not if I try to use the voice command on its own. I set it to run on automatically on boot so im not sure why.

Anyway, I will start again and follow your steps
Posts: 10
Joined: Sat Jun 10, 2017 10:02 pm
by kngharv » Tue Jun 20, 2017 10:25 pm
I am trying to use my original Raspberry Pi to do this.

For those who stuck with ARMv6, we have no choice but hoping Google would update its gprc project to support hotword, right?

or there is a way we can get away with it?
Posts: 1
Joined: Tue Jun 20, 2017 10:16 pm
by topguy » Tue Jun 20, 2017 10:49 pm
Search for google assistant and snowboy ( https://github.com/Kitt-AI/snowboy )
User avatar
Posts: 3135
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway
by rocket » Wed Jun 21, 2017 2:58 pm
Silverlock wrote:one audio card for capture (the USB mic) and a second for playback (the BCM2835 through the 3.5mm connector).

This is what I've got for /etc/asound.conf
[


So I've got a similar USB mic and output via the headphone jack of the pi. Using Silverlock's asound.conf parameters I can get the hotword to work but I get the same output from the pi repeated, like an echo. I guess this is related to the duplex setting but have no idea as to how to fix this. Any help would be appreciated!

Edit: Actually it's weirder than that. I'm actually getting 2 separate responses to the query rather than an echo. If I ask google to tell me a joke I get 2 different jokes spoken at the same time!

Edit 2: ok my bad! Total noob mistake. I didn't stop the voice recognizer before running main.py manually so ended up with 2 instances of recognition running at the same time!
Last edited by rocket on Wed Jun 21, 2017 11:21 pm, edited 1 time in total.
Posts: 6
Joined: Thu Mar 07, 2013 10:46 pm
by andrewp85 » Wed Jun 21, 2017 11:07 pm
Before I gave up and started again, I tried once more to follow the instructions from the eric duncan site. It still wasn't working, so I went back to the original instructions from the google project page and did a sudo systemctl enable voice-recognizer and after I rebooted it worked. This wasn't a line stated at the end of his instructions, but its worked for me so may work for others too.
Posts: 10
Joined: Sat Jun 10, 2017 10:02 pm
by rocket » Wed Jun 21, 2017 11:50 pm
On a new note - how do I get the timers working - it says timer is set but nothing goes off at the end of the period. And if I ask it the status the response is no timers are set?
Posts: 6
Joined: Thu Mar 07, 2013 10:46 pm
by Silverlock » Wed Jun 21, 2017 11:53 pm
At the moment, the timers and alarms only work if you're using the hotword trigger. If you're using the GPIO or clap trigger, the assistant will say it's started the timer, but then promptly forgets about it.
RPi3+external HDD/Raspbian/Pixel desktop
Posts: 33
Joined: Wed Apr 10, 2013 3:51 am
by rocket » Thu Jun 22, 2017 12:09 am
Thanks, I did use the hotword but it doesn't appear to work for me. If I ask the status it will say there aren't any timers or alarms set.
Posts: 6
Joined: Thu Mar 07, 2013 10:46 pm
by Silverlock » Thu Jun 22, 2017 12:22 am
By any chance, are you using the original method shown in this post? Timers don't work with that either. You have to follow the instructions in this update for the timers to work properly. Just as an FYI, it does introduce some inconsistencies between how it responds when using the hotword trigger versus the others.
RPi3+external HDD/Raspbian/Pixel desktop
Posts: 33
Joined: Wed Apr 10, 2013 3:51 am
by eelos » Thu Jun 22, 2017 10:07 am
Hi all,

Is there any way to create an action after a specific event with a sentence. Like a led on after ON_Conversation_TURN_Started, but then after saying "led on" for example.
I'm trying to control my tv through a ESP8266 and it works at home with IFTTT.com but i need to forward a port in my router.
I want to use the google assistant as well on my work but the wifi is behind a firewall so i'm not able to send a message to a local ip address with IFTTT. It would be nice to send it from my raspberry pi after i say "tv on".
Can this be programmed in the google assistant sdk python.
Thank you for any help!
Posts: 1
Joined: Thu Jun 22, 2017 10:00 am
by rocket » Fri Jun 23, 2017 3:15 am
Silverlock wrote:By any chance, are you using the original method shown in this post? Timers don't work with that either. You have to follow the instructions in this update for the timers to work properly. .


Ahh thanks for that - I will use Eric Duncan's method shortly!
Posts: 6
Joined: Thu Mar 07, 2013 10:46 pm