I build Google Home Assistant for Armbian (S905x) based on NodeJS (because Python eating more resources)
For installation you need:
- NodeJS 14 and PM2
- Microphone and Speaker
- Device ID and Device Model ID (Create it on Google Cloud Console)
PM2 monitoring (Start -> Mic -> Detector -> Google Home Assist -> Audio -> Terminate)
- PM2 started the app
- Detecting wakeword/hotword
- If wakeword/hotword detected, send your voice to Google Assistant API
- Google Assistant will respons your voice
- App terminated and PM2 will restart this app
I don't know the efficient way to run this app.
Add all of your configuration on .env file
DEVICE_ID=YOUR_DEVICE_ID // Obtained from GCP
DEVICE_MODEL_ID=YOUR_DEVICE_MODEL_ID // Obtained from GCP
LATITUDE=YOUR_LATITUDE //
LONGITUDE=YOUR_LONGITUDE //
MIC_HW='plughw:1,0'
For MIC_HW, you can get from arecord
command
$ arecord -l
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice # 350: subdevice #350
You can see is the card number is 1 and device is 0 so your plughw is plughw:1,0
Install audio dependencies
# apt install libmagic-dev libatlas-base-dev sox libsox-fmt-all build-essential
Install alsalib
or pulseaudio lib
for compiling backend
# apt install libasound2/pulseaudio-libs-devel
Install speaker-arm64
with your audio backend (example pulseaudio)
$ npm install speaker-arm64 --mpg123-backend=pulse/alsa
Install all dependencies
$ npm install
Install pm2
# npm install -g pm2
Run with pm2
$ pm2 start index.js
This repo is only for personal use. You cannot create a commercial product with this repo because of Google Assistant Policy.
This script was based on / modified from:
Copyright (c) 2023 Palguno Wicaksono
The copyright holders grant the freedom to copy, modify, convey, adapt, and/or redistribute this work under the terms of the Massachusetts Institute of Technology License.
A copy of that license is available at LICENSE