Closed Colin1964 closed 6 years ago
It sounds like you are editing the right .py file, make sure that the phrases you say are exactly identical to the phrases in the `if text == "{phrase}" lines in the code. If I say "Ok Google, what's my IP", I get the same response as you, but if I say the exact phrase "Ok Google, IP address" then the local command works and is in a different voice.
@t1m0thyj thanks. I will give this a try when I get home.
Ok so i tried saying exactly what is in the {phrase] i.e. just the words "OK Google, IP address" but still getting no response at all. I'm wondering if I need to install/activate some other voice recogniser or speech engine for this. You say when you get the local command response it is in a different voice. Is your setup unchanged from the standard install or did you add any custom pieces. It seems strange that the .py file is being called correctly by the AIY service and the Pi responds perfectly to all other commands yet none of the custom commands seem to work? I am running my Pi in headless mode - could that be anything to do with it? Is your Pi connected to a screen or headless?
I decided to try and run AssistantPi in a console via VNC and I seem to be making progress. After the initial install I have always used the Assistant in auto run mode i.e via the Service when the Pi boots up. I've never tried to manually start the thing - it has always just worked when I turn the Pi on! SO.. I'm not entirely convinced I have got the manual starting process fully correct but here's what I did.
First of all CD'd to AIY-projects-python directory and stopped the service with: `sudo service AssistantPi stop"
Then activated dev environment with source env/bin/activate
and started AssistantPi using Python src/AssistantPi.py
Now I was getting output to the console as well as speech. I asked a quick test question about Greece first (worked fine) and then said "OK Google, IP address" and below is the error output:
(env) pi@raspberrypi:~/AIY-projects-python $ python src/AssistantPi.py
ON_MUTED_CHANGED:
{'is_muted': False}
/home/pi/AIY-projects-python/src/aiy/_drivers/_led.py:51: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
GPIO.setup(channel, GPIO.OUT)
ON_START_FINISHED
Say "OK, Google" then speak, or press Ctrl+C to quit...
ON_CONVERSATION_TURN_STARTED
ON_END_OF_UTTERANCE
ON_RECOGNIZING_SPEECH_FINISHED:
{'text': 'tell me about Greece'}
You said: tell me about Greece
ON_RESPONDING_STARTED:
{'is_error_response': False}
ON_RESPONDING_FINISHED
ON_CONVERSATION_TURN_FINISHED:
{'with_follow_on_turn': False}
ON_CONVERSATION_TURN_STARTED
ON_END_OF_UTTERANCE
ON_RECOGNIZING_SPEECH_FINISHED:
{'text': 'IP address'}
You said: IP address
/bin/sh: 1: pico2wave: not found
aplay: playback:2787: read error
Traceback (most recent call last):
File "src/AssistantPi.py", line 110, in
It looks like it can't find pico2wave. Is this required just for the local commands and if so how/where do I need to install this?
OK that was easier than I thought.
Installed pico2wav using sudo apt-get install libttspico-utils
and now everything is working perfectly. Normal Google voice response when asking standard commands and now the slightly robot version of her voice when responding to local commands. Now off to write some spooky halloween commands!!! @t1m0thyj thanks for all the help and maybe this will help anyone else having the same problem.
Glad you were able to figure it out, I'll add a line to install.sh
to install that package. When I wrote this script I had already set up Assistant on my Pi previously so I missed some of the dependencies.
Added the libttspico-utils
package to install.sh
Trying to use this code and followed the instructions by @RichardBronsky. I am editing the AssistantPi.py file located in /home/pi/AIY-projects-python/src to include the local custom commands. I reboot the Pi with the changes made to the file but the local commands do not work. Not sure this is relevant to my issue but I did notice that the original AssistantPi.py file has this code
def say_ip(): ip_address = subprocess.check_output("hostname -I | cut -d' ' -f1", shell=True) aiy.audio.say('My IP address is %s' % ip_address.decode('utf-8'))
however the response I get from "OK Google, what's my IP?" is "Your Public IP address is 144.123........" and not "My IP address is..." Also none of the "reboot", "shutdown" commands work either so it seems like the AssistantPi.py file is not even being used. Am I editing the right .py file and if so do I have to manually run the file?