Giter VIP home page Giter VIP logo

google-assistant-matrixio's Introduction

Setup Google Assistant with MATRIX Creator/Voice boards.

Checkout also this guide in Hackster!

Required Hardware

Before get started, let's review what you'll need.

Raspberry Pi 3 (Recommended) or Pi 2 Model B (Supported).

  • MATRIX Voice - Raspberry Pi does not have a built-in microphone, the MATRIX Voice has an 8 mic array - Buy MATRIX Voice.
  • Micro-USB power adapter for Raspberry Pi.
  • Micro SD Card (Minimum 8 GB) - An operating system is required to get started. You can download Raspbian Stretch and use the guides for Mac OS, Linux and Windows in the Raspberry Pi website.
  • External Speaker with 3.5 mm audio cable.
  • A USB Keyboard & Mouse, and an external HDMI Monitor - we also recommend having a USB keyboard and mouse as well as an HDMI monitor handy. You can also use the Raspberry Pi remotely, see this guide from Google.
  • Internet connection (Ethernet or WiFi)
  • (Optional) WiFi Wireless Adapter for Pi 2. Note: Pi 3 has built-in WiFi.

Let's get started

Once you have the Raspberry Pi with the SD Card inserted, the MATRIX Voice connected to it, power up the Raspberry Pi and open a terminal either in the Raspbian Desktop or just by ssh into it ( if you are you are using the Raspbian Lite version, in this case see guide on how to ssh here).

1. Installing MATRIX software

In order to allow the Google Assistant software to have access to MATRIX Voice microphones you need to first install:

# Add repo and key
curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
# Update packages and install
sudo apt-get update
sudo apt-get upgrade
# Installation MATRIX Pacakages
sudo apt install matrixio-creator-init
# Installation Kernel Packages
sudo apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel git 
# Reboot
sudo reboot

After rebooting go and clone, build, and install the kernel repository following this steps:

# Clone, build and install kernel modules
git clone https://github.com/matrix-io/matrixio-kernel-modules
cd matrixio-kernel-modules
make && make install

and finally:

# Adding kernel module
echo "matrixio-everloop" | sudo tee -a /etc/modules
# Adding overlay
echo "dtoverlay=matrixio" | sudo tee -a /boot/config.txt
# reboot
sudo reboot

2. Configure and Test

# Setting up the asoundrc file
cd ~/matrixio-kernel-modules
cp misc/asoundrc ~/.asoundrc

Run this command to record a 5 sec audio and play it back

cd ~/
arecord --duration 5 --rate 16000 --format S16_LE test.wav && aplay ./test.wav

You should hear the recorded audio, then setup is good and you can move forward.

3. Setup Google Assistant.

In this step you will setup all the required software to finally run the Assistant. Make sure you are in the /home/pi directory before starting.

Follow the guides in the links below :

4. Get code to use the Everloop

git clone https://github.com/matrix-io/google-assistant-matrixio.git
cd google-assistant-matrixio/

5. Run the Google Assistant!

Now you are ready. Just run the following line making sure you put your project id and device model id from previous steps :

~/google-assistant-matrixio/google-matrixio-assistant-hotword --project_id your-dev-project-id --device_model_id your-model-id

The output should be like this:

(env) pi@raspberrypi:~ $ ~/google-assistant-matrixio/google-matrixio-assistant-hotword --project_id your-dev-project-id --device_model_id your-model-id
device_model_id: your-model-id
device_id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
https://embeddedassistant.googleapis.com/v1alpha2/projects/your-dev-project-id/devices/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 403
[3140:3159:ERROR:assistant_nupnp_client.cc(103)] Cloud discovery nupnp request failed: [60] Peer certificate cannot be authenticated with given CA certificates
[3140:3159:ERROR:assistant_nupnp_client.cc(103)] Cloud discovery nupnp request failed: [60] Peer certificate cannot be authenticated with given CA certificates
EventType.ON_MUTED_CHANGED
EventType.ON_START_FINISHED
[3140:3159:ERROR:assistant_nupnp_client.cc(103)] Cloud discovery nupnp request failed: [60] Peer certificate cannot be authenticated with given CA certificates 

Now you can talk to the Assistant starting with "OK Google" or just "Hey Google"!

google-assistant-matrixio's People

Contributors

samreenislam avatar yoelrc88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-assistant-matrixio's Issues

No playback device detected

Hi,

I'm trying to follow this installation on my Pi3, but without any luck for now... I cannot get any sound out of the system.

The capture device is correctly found:

pi@ullr:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: SOUND [MATRIXIO SOUND], device 0: matrixio.mic.0 snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

But I don't have any playback device:

pi@ullr:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****

If I try to force the sound via jack headphone with raspi-config, I get this error:

amixer: Cannot find the given element from control default

What can I do to fix this ?

audio open error: Device or resource busy

when running this command:

arecord --duration 5 --rate 16000 --format S16_LE test.wav && aplay ./test.wav

I get the following error:

arecord: main:788: audio open error: Device or resource busy

It's interesting that you aren't specifying the --device flag, what would it be in this case?
I'm used to seeing "mic_channel1" or another channel.
I also ran

sudo pkill -9 malos

To make sure that wasn't the cause. Any help would be greatly appreciated

make is not working

Hi,
i got this error while executing make command

make -C /lib/modules/4.14.27-v7+/build M=/home/pi/matrixio-kernel-modules modules
make[1]: *** /lib/modules/4.14.27-v7+/build: No such file or directory. Stop.
Makefile:17: recipe for target 'all' failed
make: *** [all] Error 2

what's the problem?

NodeJS implementation

Hey guys!

Congratulations for the amazing job on Matrix voice!

Can you guys provide an example or way to integrate Matrix Voice with google assistant Nodejs SDK:
https://github.com/endoplasmic/google-assistant

Appreciate the help!

Segmentation Fault

While running the google assistant sample app, getting seg fault

(env) pi@matrix:~ $ ~/google-assistant-matrixio/google-matrixio-assistant-hotword --project_id gaweb --device_model_id gaweb-805b9-matrix-j0l3ip
Segmentation fault

No input sound

Hi,

I've finished the installation but cannot record any sound.

If I try the google assistant, I got this error:

[5088:5120:ERROR:mic_failure_detector.cc(140)] [assistant] Channel 1 has failed. Powers -inf and -inf

arecord seems to see my card:

pi@ullr:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: SOUND [MATRIXIO SOUND], device 0: matrixio.mic.0 snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

If I record with arecord (as instructed in the readme), the test.wav failed only produces a low static sound.

You got any idea what I could do ?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.