Mycroft with Google AIY Voice kit - Button Not Working after the first press



I am using Mycroft with Google AIY Voice kit (BLUE BUTTON).

AIM: Every time the button is pressed, I want to Activate the “hello-world skill” and say something to the user.

WHAT I TRIED: Modified the “” code as follows:

------START OF CODE----------------------------------------------------------------
import subprocess
import time
import RPi.GPIO as GPIO
from subprocess import call

gpio_pin = 23
GPIO.setup(gpio_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)

while True:
if GPIO.input(gpio_pin) == False: # Listen for the press
call([‘python’, “/home/pi/”, “localhost”, “Emergency”])
----------END OF CODE-----------------------------------------------------------

Note: Emergency is the intent in the “vocab/en-us” folder

PROBLEM: When the button is pressed after reboot,
the “skill-hello-world” skill is activated and speaks out what is present in the dialog folder of “skill-hello-world”, but ONLY ONCE (sometimes twice).
After which when the button is pressed, there is no response from the R-Pi.

Can somebody please give me a solution to this?

Best regards,

Using Buttons to control a Skill

Hi there @vailshery, thanks for reaching out to us, and huge well done on extending Mycroft so far!
I’m going to ping my colleague @forslund here to see if he may have any advice.

What would be useful here is if you have the mycroft-skills.log available for us to review?

Best, Kathy



it’s hard to say since the formatting of the code is missing. But I tried the from the commandline and the first time I ran it it hanged. This might be what’s causing your issue. The call() method hangs and blocks subsequent calls.

Try the command from the command line and see if you get similar behaviour. You could try using the send function in the mycroft.messagebus.send instead of using the


Hey @KathyReid , Thank you for your response. I am travelling right now and can try to get the logs on Monday.



Hi @forslund ,

Sorry for the improper formatting since I just did a copy+paste.
When I run “ Emergency”, my skill is activated and runs once or sometimes at least for 5 times.
The behaviour is similar when i use the call() method in “”

I will try using the send function and check the results.

Best regards,


Hello Team,

I fixed the issue. I will share the details tomorrow.



Any updates on how to fix this issue?



Awesome news @vailshery! We’d love to share your write-up / video when it’s done! :+1:



I edited the code in the “” script as mentioned in the code section below.
I also edited the skill folders (cd skills) as mentioned just below this line under the NOTE section.


  1. “introduction” is the utterance which should be in the “/home/pi/skills/skill-intro/vocab/en- us/intro.voc”.
    (1.a) Change the contents of the .dialog file in the dialog folder of the particular skill you are using as per
    your requirments. (what the assistant speaks ;)).

  2. “call” is the utterance which should be in the “/home/pi/skills/skill-call/vocab/en-us/call.voc”.
    (2.a) Change the contents of the .dialog file in the dialog folder of the particular skill you are using as per
    your requirements. (Lights up the LED in my case;)).
    (2.b) In my case, the GPIO which provides LOGIC HIGH as output is used to trigger a GSM module.

I will attach the video of the same.

The solution to the problem is

"call([‘python’, ‘-m’, ‘mycroft.messagebus.send’, ‘recognizer_loop:utterance’, ‘{“utterances”: [“call”]}’])"
PS: Use without quotes :stuck_out_tongue:


while True:
    if GPIO.input(gpio_pin) == False: # Listen for the press, the loop until it steps
        print "Started press"
        while GPIO.input(gpio_pin) == False:
        print "Button pressed %d" % pressed_time
        if pressed_time<longpress_threshold:
            call(['python', '-m', 'mycroft.messagebus.send', 'recognizer_loop:utterance', '{"utterances": ["introduction"]}'])
            call(['python', "/home/pi/", "localhost", "mycroft.mic.listen"])  
            call(['python', '-m', 'mycroft.messagebus.send', 'recognizer_loop:utterance', '{"utterances": ["call"]}'])

-------------------------END --------------------------------------------------------------------------

PS: Sorry for the bad editing of the code :frowning:
Feel free to post any further questions




Please look below.



Thanks enormously for such a great writeup, @vailshery! We really appreciate it! Hope you don’t mind, I made a small edit to the formatting of the post so that the code displays as a code block :wink:

Again, many thanks both for figuring this out and also for writing it up so that others can learn from your work.


Hello @KathyReid,

No issues at all. I tried formatting but failed :wink:
Thanks for the edit.

Always happy to contribute :slight_smile: