This guide is about how to install google assistant and magic mirror on latest raspbian.
I had some errors, so I made a video to share it, https://youtu.be/UBgH5hejYtM
And Here is github for this, https://github.com/makepluscode/rpi-tutorial-advanced/blob/master/006-raspbian-magicmirror-google-assistant-latest/
Dependency Versions
- OS : 2018-11-13-raspbian-stretch-full.img
- MagicMirror2 : 2.5.0
- MMM-Hotword : 1.1.0
- MMM-AssistantMk2 : 2.1.2
Install
STEP1. Rasbian installation
- Download the latest image from the RazBian website. (2018-11-13-raspbian)
- Download Rufus to write images to SD card.
- Run Rufus and select the downloaded image to burn the SD card.
STEP2. Insert SD card + LCD + Power connection
- Insert SD card and keyboardㆍmouse dongle into raspberry pi.
- Connect LCD to raspberry pi on HDMI.
STEP3. First Boot
- Connect the USB power cable to the raspberry pi
- After boot is done, connect to the Internet with WIFI
- Update packages
sudo apt-get update
STEP4. Installing a Magic Mirror
- Install the Magic Mirror using a script on the Internet
sudo apt-get install npm
sudo npm install -g npm@latest
bash -c "$(curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh)"
STEP5. Installing Magic Mirror Modules
- Go to modules directory and install the MMM-Hotword
cd ~/MagicMirror/modules/
sudo apt-get install libmagic-dev libatlas-base-dev sox libsox-fmt-all
git clone https://github.com/eouia/MMM-Hotword.git
cd MMM-Hotword
npm install
cd ~/MagicMirror/modules/MMM-Hotword/node_modules/snowboy
npm install --save-dev electron-rebuild
npm install nan
./node_modules/.bin/electron-rebuild
- Install MMM-AssistantMk2
cd ~/MagicMirror/modules/
sudo apt-get install mpg321 libasound2-dev
git clone https://github.com/eouia/MMM-AssistantMk2
cd MMM-AssistantMk2
npm install
cd scripts
chmod +x *.sh
cd ~/MagicMirror/modules/MMM-AssistantMk2
npm install --save-dev electron-rebuild
./node_modules/.bin/electron-rebuild
STEP6. Configure Google Assistant Module
- Open the Google Action Console and create a new project
https://console.actions.google.com
- Open the Google Cloud Platform Console and select the generated project
https://console.cloud.google.com
- Search for the Google Assistant API and click Enable.
- Click CONFIGURE … of Credentials and put the name and e-mail.
- Generate Other credentials with the OAuth Client ID in Create Credentials
- Download generated OAuth client ID in json format
- Move the downloaded OAuth client ID to modules/MMM-AssistantMk2/credentials.json
mv ~/Download/cre.... credentials.json
- Run auth_and_test.js to verify the generated client ID
node auth_and_test.js
- Accept the client verification process and copy and enter your Google account key
- Move the generated token.json
mv token.json ./profiles/default.json
STEP7. Edit Google assistant module config
- Open the Magic Mirror configuration file with TextEditor and modify it with the contents of github
Install USB Mic. and Speaker
https://github.com/makepluscode/rpi-tips/tree/master/001-bringup-audio-and-mic
vi ~/.asoundrc
pcm.!default{
type asym
playback.pcm{
type hw
card 0
}
capture.pcm{
type plug
slave.pcm "hw:1, 0"
}
}
ctl.!default{
type hw
card 0
}
And, change audio output from hdmi to analog.
Test
Go to the location where the Magic Mirror is and start the application
cd ~/MagicMirror
npm start