After the build I wanted a way to start the Google Voice Python script on startup. The AIY project site has great instructions that I will summarize here.
- Create a new file in /home/pi called voice_assistant.service using the command: sudo nano /home/pi/voice_assistant.service
- Enter the following text into the file
Description=My awesome assistant app
[Service]
ExecStart=/bin/bash -c '/home/pi/AIY-voice-kit-python/env/bin/python3 -u src/assistant_library_demo.py'
WorkingDirectory=/home/pi/AIY-voice-kit-python
Restart=always
User=pi
[Install]
WantedBy=multi-user.target - Move the file to the correct folder using this command: sudo mv voice_assistant.service /lib/systemd/system
- Enable your service: sudo systemctl enable voice_assistant.service
- Start your service: sudo service voice_assistant start
- Reboot the pi: reboot
- After reboot check the status of the service: sudo service voice_assistant status
- The status should be started and you should be able to say "Okay Google"
0 comments:
Post a Comment