Problem installing google assistant

I am following the directions on the web page:

Everything works until I reach the following line and error message.

Suggestions?

Yoav

(env) pi@raspberrypi:~ $ python -m pip install --upgrade google-assistant-sdk[samples]==0.5.1
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting google-assistant-sdk[samples]==0.5.1
Using cached https://files.pythonhosted.org/packages/47/26/b405a0236ea5dd128f4b9c00806f4c457904309e1a6c60ec590e46cc19c4/google_assistant_sdk-0.5.1-py2.py3-none-any.whl
Collecting google-auth-oauthlib[tool]>=0.1.0 (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/74/a2/1323b1bce9935ac948cd4863509de16cf852cd80b12dd29e648c65fea93d/google_auth_oauthlib-0.4.0-py2.py3-none-any.whl
Collecting google-assistant-grpc==0.2.1; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/4b/5d/50dbb8197961acf8a4339e8950e0110159456c4ef48234751d1b5f2e919b/google_assistant_grpc-0.2.1-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: pathlib2<3,>=2.3.0; extra == “samples” in ./env/lib/python3.6/site-packages (from google-assistant-sdk[samples]==0.5.1) (2.3.3)
Collecting click<7,>=6.7; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl
Collecting futures<4,>=3.1.1; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://www.piwheels.org/simple/futures/futures-3.1.1-py3-none-any.whl
Requirement already satisfied, skipping upgrade: urllib3[secure]<2,>=1.21; extra == “samples” in ./env/lib/python3.6/site-packages (from google-assistant-sdk[samples]==0.5.1) (1.25.3)
Collecting tenacity<5,>=4.1.0; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/75/1b/46a6a7b7c2b16811665ea09b7e63e7e6b7f9b5dedf2d0ba67e029668403c/tenacity-4.12.0-py2.py3-none-any.whl
Collecting sounddevice<0.4,>=0.3.7; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/d1/f2/7cb487ac7171dfade8af7a368bd8806ecff82016f4ac9894835cd7de9ecc/sounddevice-0.3.13-py2.py3-none-any.whl
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/c2/e2/9fd03d55ffb70fe51f587f20bcf407a6927eb121de86928b34d162f0b1ac/requests_oauthlib-1.2.0-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: google-auth in ./env/lib/python3.6/site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.5.1) (1.6.3)
Collecting grpcio>=1.3.5 (from google-assistant-grpc==0.2.1; extra == “samples”->google-assistant-sdk[samples]==0.5.1)
Downloading https://files.pythonhosted.org/packages/28/3d/eff8fe5948376253d18721c965e9b0077a6e2bf95e4619415947a17b9780/grpcio-1.21.1-cp36-cp36m-linux_armv7l.whl (11.2MB)
|████████████████████████████████| 11.2MB 7.4MB/s
Collecting googleapis-common-protos>=1.5.2 (from google-assistant-grpc==0.2.1; extra == “samples”->google-assistant-sdk[samples]==0.5.1)
Downloading https://files.pythonhosted.org/packages/eb/ee/e59e74ecac678a14d6abefb9054f0bbcb318a6452a30df3776f133886d7d/googleapis-common-protos-1.6.0.tar.gz
Requirement already satisfied, skipping upgrade: six in ./env/lib/python3.6/site-packages (from pathlib2<3,>=2.3.0; extra == “samples”->google-assistant-sdk[samples]==0.5.1) (1.12.0)
Collecting cryptography>=1.3.4; extra == “secure” (from urllib3[secure]<2,>=1.21; extra == “samples”->google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/c2/95/f43d02315f4ec074219c6e3124a87eba1d2d12196c2767fadfdc07a83884/cryptography-2.7.tar.gz
Installing build dependencies … error
ERROR: Complete output from command /home/pi/env/bin/python /home/pi/env/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-553ata7s/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple – ‘setuptools>=40.6.0’ wheel ‘cffi>=1.8,!=1.11.3; python_implementation != ‘"’"‘PyPy’"’"’’:
ERROR: Traceback (most recent call last):
File “/usr/local/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/local/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/pi/env/lib/python3.6/site-packages/pip/main.py”, line 16, in
from pip._internal import main as _main # isort:skip # noqa
File “/home/pi/env/lib/python3.6/site-packages/pip/_internal/init.py”, line 4, in
import locale
File “/usr/local/lib/python3.6/locale.py”, line 16, in
import re
File “/usr/local/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’

ERROR: Command “/home/pi/env/bin/python /home/pi/env/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-553ata7s/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple – ‘setuptools>=40.6.0’ wheel 'cffi>=1.8,!=1.11.3; python_implementation != '”’"‘PyPy’"’"’’" failed with error code 1 in None

Hi @yoavfreund,

I haven’t received those errors before, but I recall you mentioning you got a MATRIX Creator kit. That was shipped out before we had a fix with our kernel modules for the latest Raspbian Linux kernels (4.19). You can check what version of the Linux kernels you have by typing the following.

uname -a

If the Linux kernels are version 4.14, then you can update it.

sudo apt update
sudo apt upgrade

Then you can update to the latest MATRIX kernel modules.

Purge your old kernel modules

sudo apt purge matrixio-kernel-modules

Then reboot

sudo reboot

Install the latest kernel modules

sudo apt install matrixio-kernel-modules

Then reboot

sudo reboot

Since the Google assistant guide relies on the MATRIX kernel modules. It is possible that this is the root cause of your issue. I would recommend starting the guide over after the above process.

If everything is already up to date- you have Raspbian Linux 4.19 with MATRIX kernel modules 0.1.7 (you can check with dpkg -l | grep matrix), then let us know and I can try to replicate the issue. I tried out the Google Assistant guide after all our latest updates, and got it working though so I know it will work!

Best,
Samreen

P.S. Our latest kit image has the latest Raspbian with the updated kernel modules and also includes MATRIX Lite Py. Here is the new kit image in case you ever want to flash it!

Hi Sarmeen,

My flash was corrupted, so I created a new image by myself. Indeed when I check I get:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux

Maybe this kernel is still wrong or missing something?

Yoav

Can you send me the output of dpkg -l | grep matrix?

Here it is,

I have just done the purge and reinstall, so the google assistant install might work now…

pi@raspberrypi:~ $ dpkg -l | grep matrix
ii libmatrixio-creator-hal:armhf 0.3.7 armhf Hardware Abstraction Layer for MATRIX.
ii libmatrixio-creator-hal-dev 0.3.7 armhf Hardware Abstraction Layer for MATRIX (headers)
ii libmatrixio-malos:armhf 0.1.3 armhf Libraries of MATRIX abstraction layer for MOS
ii libmatrixio-protos:armhf 0.1.5 armhf Protocolbuffers for MATRIX abstraction layer
ii libswresample2:armhf 7:3.2.14-1~deb9u1+rpt1 armhf FFmpeg library for audio resampling, rematrixing etc. - runtime files
ii matrixio-creator-init 0.4.13 armhf Install scripts that can program the MATRIX Creator FPGA and SAM3 IMU.
ii matrixio-kernel-modules 0.1.7 armhf Install kernel modules for MATRIX devices.
ii matrixio-malos 0.3.5 armhf Allows queries to MATRIX Creator hardware via ZMQ.
ii matrixio-openocd 1.0.1 armhf Open on-chip JTAG debug solution for ARM and MIPS systems
ii matrixio-protobuf 3.5.0 armhf Protocol Buffers - Google’s data interchange format. (From GRPC 3.5.0)
ii matrixio-xc3sprog 1.1.1 armhf Spartan3, XCF and CPLD JTAG programmer and other utilities.

Alright, looks like you’re all updated. Let me know how it goes!

Same problem, sigh

Below is a pretty complete log.

Yoav

pi@raspberrypi:~ pi@raspberrypi:~ sudo apt-get update
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Ign:2 http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0 ./ InRelease
Get:3 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Hit:4 https://apt.matrix.one/raspbian stretch InRelease
Get:5 http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0 ./ Release [1,077 B]
Get:6 http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0 ./ Release.gpg [481 B]
Get:7 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Get:8 http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0 ./ Packages [11.1 kB]
Fetched 11.7 MB in 41s (284 kB/s)
Reading package lists… Done
pi@raspberrypi:~ sudo apt-get install python3-dev python3-venv Reading package lists... Done Building dependency tree Reading state information... Done python3-dev is already the newest version (3.5.3-1). python3-venv is already the newest version (3.5.3-1). The following packages were automatically installed and are no longer required: erlang-base erlang-crypto erlang-syntax-tools fonts-lato libboost-thread1.62.0 libqt5opengl5 libqt5scintilla2-12v5 libqt5scintilla2-l10n libqt5x11extras5 libqwt-qt5-6 libruby2.3 libscsynth1 libsctp1 libyaml-0-2 rake ruby ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.3 rubygems-integration Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. pi@raspberrypi:~ python3 -m venv env
pi@raspberrypi:~ env/bin/python -m pip install --upgrade pip setuptools wheel Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already up-to-date: pip in ./env/lib/python3.6/site-packages (19.1.1) Requirement already up-to-date: setuptools in ./env/lib/python3.6/site-packages (41.0.1) Requirement already up-to-date: wheel in ./env/lib/python3.6/site-packages (0.33.4) pi@raspberrypi:~ source env/bin/activate
(env) pi@raspberrypi:~ sudo apt-get install portaudio19-dev libffi-dev libssl-dev libmpg123-dev Reading package lists... Done Building dependency tree Reading state information... Done libffi-dev is already the newest version (3.2.1-6). libmpg123-dev is already the newest version (1.23.8-1). libssl-dev is already the newest version (1.1.0j-1~deb9u1). portaudio19-dev is already the newest version (19.6.0-1). The following packages were automatically installed and are no longer required: erlang-base erlang-crypto erlang-syntax-tools fonts-lato libboost-thread1.62.0 libqt5opengl5 libqt5scintilla2-12v5 libqt5scintilla2-l10n libqt5x11extras5 libqwt-qt5-6 libruby2.3 libscsynth1 libsctp1 libyaml-0-2 rake ruby ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.3 rubygems-integration Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. (env) pi@raspberrypi:~ python -m pip install --upgrade google-assistant-library==1.0.1
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: google-assistant-library==1.0.1 in ./env/lib/python3.6/site-packages (1.0.1)
Requirement already satisfied, skipping upgrade: requests<3,>=2.14.2 in ./env/lib/python3.6/site-packages (from google-assistant-library==1.0.1) (2.22.0)
Requirement already satisfied, skipping upgrade: argparse<2,>=1.4.0 in ./env/lib/python3.6/site-packages (from google-assistant-library==1.0.1) (1.4.0)
Requirement already satisfied, skipping upgrade: google-auth<2,>=1.0.1 in ./env/lib/python3.6/site-packages (from google-assistant-library==1.0.1) (1.6.3)
Requirement already satisfied, skipping upgrade: pathlib2<3,>=2.3.0 in ./env/lib/python3.6/site-packages (from google-assistant-library==1.0.1) (2.3.3)
Requirement already satisfied, skipping upgrade: enum34<2,>=1.1.6 in ./env/lib/python3.6/site-packages (from google-assistant-library==1.0.1) (1.1.6)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in ./env/lib/python3.6/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.0.1) (2019.6.16)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in ./env/lib/python3.6/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.0.1) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in ./env/lib/python3.6/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.0.1) (2.8)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./env/lib/python3.6/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.0.1) (1.25.3)
Requirement already satisfied, skipping upgrade: rsa>=3.1.4 in ./env/lib/python3.6/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.0.1) (4.0)
Requirement already satisfied, skipping upgrade: cachetools>=2.0.0 in ./env/lib/python3.6/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.0.1) (3.1.1)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in ./env/lib/python3.6/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.0.1) (1.12.0)
Requirement already satisfied, skipping upgrade: pyasn1-modules>=0.2.1 in ./env/lib/python3.6/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.0.1) (0.2.5)
Requirement already satisfied, skipping upgrade: pyasn1>=0.1.3 in ./env/lib/python3.6/site-packages (from rsa>=3.1.4->google-auth<2,>=1.0.1->google-assistant-library==1.0.1) (0.4.5)
(env) pi@raspberrypi:~ $ python -m pip install --upgrade google-assistant-sdk[samples]==0.5.1
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting google-assistant-sdk[samples]==0.5.1
Using cached https://files.pythonhosted.org/packages/47/26/b405a0236ea5dd128f4b9c00806f4c457904309e1a6c60ec590e46cc19c4/google_assistant_sdk-0.5.1-py2.py3-none-any.whl
Collecting google-auth-oauthlib[tool]>=0.1.0 (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/74/a2/1323b1bce9935ac948cd4863509de16cf852cd80b12dd29e648c65fea93d/google_auth_oauthlib-0.4.0-py2.py3-none-any.whl
Collecting futures<4,>=3.1.1; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://www.piwheels.org/simple/futures/futures-3.1.1-py3-none-any.whl
Collecting tenacity<5,>=4.1.0; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/75/1b/46a6a7b7c2b16811665ea09b7e63e7e6b7f9b5dedf2d0ba67e029668403c/tenacity-4.12.0-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: pathlib2<3,>=2.3.0; extra == “samples” in ./env/lib/python3.6/site-packages (from google-assistant-sdk[samples]==0.5.1) (2.3.3)
Collecting click<7,>=6.7; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl
Collecting sounddevice<0.4,>=0.3.7; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/d1/f2/7cb487ac7171dfade8af7a368bd8806ecff82016f4ac9894835cd7de9ecc/sounddevice-0.3.13-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: urllib3[secure]<2,>=1.21; extra == “samples” in ./env/lib/python3.6/site-packages (from google-assistant-sdk[samples]==0.5.1) (1.25.3)
Collecting google-assistant-grpc==0.2.1; extra == “samples” (from google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/4b/5d/50dbb8197961acf8a4339e8950e0110159456c4ef48234751d1b5f2e919b/google_assistant_grpc-0.2.1-py2.py3-none-any.whl
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/c2/e2/9fd03d55ffb70fe51f587f20bcf407a6927eb121de86928b34d162f0b1ac/requests_oauthlib-1.2.0-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: google-auth in ./env/lib/python3.6/site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.5.1) (1.6.3)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in ./env/lib/python3.6/site-packages (from tenacity<5,>=4.1.0; extra == “samples”->google-assistant-sdk[samples]==0.5.1) (1.12.0)
Collecting CFFI>=1.0 (from sounddevice<0.4,>=0.3.7; extra == “samples”->google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/93/1a/ab8c62b5838722f29f3daffcc8d4bd61844aa9b5f437341cc890ceee483b/cffi-1.12.3.tar.gz
Requirement already satisfied, skipping upgrade: idna>=2.0.0; extra == “secure” in ./env/lib/python3.6/site-packages (from urllib3[secure]<2,>=1.21; extra == “samples”->google-assistant-sdk[samples]==0.5.1) (2.8)
Collecting pyOpenSSL>=0.14; extra == “secure” (from urllib3[secure]<2,>=1.21; extra == “samples”->google-assistant-sdk[samples]==0.5.1)
Downloading https://files.pythonhosted.org/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl (53kB)
|████████████████████████████████| 61kB 4.0MB/s
Requirement already satisfied, skipping upgrade: certifi; extra == “secure” in ./env/lib/python3.6/site-packages (from urllib3[secure]<2,>=1.21; extra == “samples”->google-assistant-sdk[samples]==0.5.1) (2019.6.16)
Collecting cryptography>=1.3.4; extra == “secure” (from urllib3[secure]<2,>=1.21; extra == “samples”->google-assistant-sdk[samples]==0.5.1)
Using cached https://files.pythonhosted.org/packages/c2/95/f43d02315f4ec074219c6e3124a87eba1d2d12196c2767fadfdc07a83884/cryptography-2.7.tar.gz
Installing build dependencies … error
ERROR: Complete output from command /home/pi/env/bin/python /home/pi/env/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-6_tbupw6/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple – ‘setuptools>=40.6.0’ wheel ‘cffi>=1.8,!=1.11.3; python_implementation != ‘"’"‘PyPy’"’"’’:
ERROR: Traceback (most recent call last):
File “/usr/local/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/local/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/pi/env/lib/python3.6/site-packages/pip/main.py”, line 16, in
from pip._internal import main as _main # isort:skip # noqa
File “/home/pi/env/lib/python3.6/site-packages/pip/_internal/init.py”, line 4, in
import locale
File “/usr/local/lib/python3.6/locale.py”, line 16, in
import re
File “/usr/local/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’

ERROR: Command “/home/pi/env/bin/python /home/pi/env/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-6_tbupw6/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple – ‘setuptools>=40.6.0’ wheel 'cffi>=1.8,!=1.11.3; python_implementation != '”’"‘PyPy’"’"’’" failed with error code 1 in None
(env) pi@raspberrypi:~ $

Is there a way to circumvent this? For example, is there an image I can download and flash that has all of the libraries pre-installed? I have a 128GB SD card, so space should not be a problem.

Yoav

Could you try one thing?

sudo nano /etc/asound.conf

Then add the following line in pcm.speaker section like below.

rate 16000

image

Save with Ctrl+X, then Y.

This is a workaround for an issue portaudio is having with the latest Raspbian, and it may be causing some issue. After implementing the above, try running the following line again, and see if you still get errors.

python -m pip install --upgrade google-assistant-sdk[samples]==0.5.1

Let me know how it goes. We can troubleshoot more/find a way to circumvent if this doesn’t work.

Best,
Samreen

Another question, did you copy paste these one by one?

sudo apt-get update
sudo apt-get install python3-dev python3-venv
python3 -m venv env
env/bin/python -m pip install --upgrade pip setuptools wheel
source env/bin/activate

That worked! Thank you! I also ran the other commands at the end of your message. All successfully.

Do I need to activate the virtual environment every before working with any of these libraries?

As much as I like cutting and pasting and emailing and fixing, it would be great if there was a more streamlined approach to setting up the matrix context. maybe images or maybe scripts that can be run to perform the installation?

I am asking because I plan to have several of these devices…

Thanks
Yoav

@yoavfreund,

I’m glad it worked :smiley:

For the Google Assistant, yes, since they have you create a virtual environment with the packages, you will need to activate it before working with them. You can check what packages are installed on the virtual environment using pip list and install them directly on your Pi as well. Then, you don’t need the venv.

When setting up similar things on multiple devices, it helps to make images of your working setup. So, for example, if you want to run Google Assistant on several devices without installing from scratch every time, you can make an image of your working setup and flash to the SD cards for your additional devices. Keep in mind, for Google Assistant, you will have to run through the device configuration and registration online every time.

For my Linux PC, I use the following steps to make an image, it can take several minutes, especially if you have a large SD card which you said you do, but the return is great because you can flash as many times as you want!

Copy paste the following one by one. Be very deliberate & careful to change the fields as necessary. Mess-ups can cause issues for your system!

List all the partitions & discs in your system, find address of SD card (example /dev/sdc), size of SD card may help with identification

sudo fdisk -l

The following line writes a certain disc space into an image, make sure if= it points to your microSD which you can find from above command

sudo dd if=/dev/sdc of=~/NAME_OF_IMG.img

Then install pishrink to shrink the image to a reasonable size

wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh

Make pishrink an executable

chmod +x ./pishrink.sh

Make sure the pishrink executable and your image are in the same folder. Then

sudo ./pishrink.sh ./NAME_OF_IMG.img

Zip it to further compress!

zip ./NAME_OF_IMG.zip ./NAME_OF_IMG.img

^This may work on a Mac, but I haven’t tried that yet!

For windows, you should be able to find disc imaging software online.

Best,
Samreen

P.S. If you want an image with all of the MATRIX packages and libraries installed with examples, here is the kit image that you can flash at any time! It is Raspbian Stretch Desktop with Linux kernel 4.19. The MATRIX library examples are all on the desktop.

Hi Samreen,

Thank you for all of you help, you have been a true life saver!

Does Matrix accept donations?

Yoav

Still having trouble,

I registered the device with Oauth and all that seems to work, however, where I try to run the assistant, it gets stuck after the following lines:

pi@raspberrypi:~/google-assistant-matrixio $ ~/google-assistant-matrixio/google-matrixio-assistant-hotword --device_mol_id assistant1-12263-yoav-matrix-5xssdl --project_id assistant1-12263
device_model_id: assistant1-12263-yoav-matrix-5xssdl
device_id: 1CC55FAB3ED08DB45897D22071EDE1BD

https://embeddedassistant.googleapis.com/v1alpha2/projects/assistant1-12263/devices/1CC55FAB3ED08DB45897D22071EDE1BD 403
EventType.ON_MUTED_CHANGED

only ^c seems to get it unstuck.

Suggestions?

Yoav

Interesting, so it seems you have a typo in there. You have --device_mol_id instead of --device_model_id.

I don’t know if that’s what’s causing the issue, but try it out!

Best,
Samreen

The error was just in the cut and paste to the message, here it is again:

(env) pi@raspberrypi:~/google-assistant-matrixio $ ~/google-assistant-matrixio/google-matrixio-assistant-hotword --device_model_id assistant1-12263-yoav-matrix-5xssdl --project_id assistant1-12263
device_model_id: assistant1-12263-yoav-matrix-5xssdl
device_id: 1CC55FAB3ED08DB45897D22071EDE1BD

https://embeddedassistant.googleapis.com/v1alpha2/projects/assistant1-12263/devices/1CC55FAB3ED08DB45897D22071EDE1BD 403
EventType.ON_MUTED_CHANGED

You can see that the program echos device_mode_id and device_id correctly. The following lines also are the expected ones, but for some reason it gets stuck. I wonder if it has something to do with configuring the hardware.

Yoav

It seems like it has to do with device registration. From our video tutorial, what it should do is register the device.
image

Maybe verify your device registration steps, and see if that helps.

Maybe also the configurations steps.

Does your Creator have any response at all when you say “Hey Google”?

Hi,

I am trying to install Jupyter Notebook on the raspberry pie and am having trouble.

Does the flash that you shared with me include jupyter notebook?

I will try to install the google assistant again next week. For now I am trying to figure out how to record from the microphones, translate the raw files to wave, and send them to the cloud. I am very used to jupyter notebooks, so I think that will help me make faster progress. I have spent some 10 hours trying to configure the Raspberry pie in a way that would make further development and research easier. What would you suggest?

Yoav

I think I will use this one. I started with a Raspibian stretch image and installed everything myself, doubtlessly I made some mistakes.

Is this image accessible from the matrix website?

Is the google assistant preinstalled? I know I will still need to register and authorize on the google app web site.

Are there other images with, for instance, jupyter notebook pre-installed?

Yoav

Hi @yoavfreund,

The kit image has Raspbian Stretch Desktop version with all the MATRIX Library packages installed.

You can follow our guides to install any other additional services & create an image using the steps above for easy replication.

Regarding Jupyter notebook, I found this guide that may be helpful for you.

Best,
Samreen