Hello community,
after some trial and errors I have managed to get a running installation of MATRIX Voice (on a Raspberry Pi 3B+) with Mycroft.AI (and connected it to my openHAB installation).
Here are the step-by-step instructions:
- Register a Mycroft account
- Download the Picroft Stretch Unstable image (find it on github) MycroftAI/enclosure-picroft/tree/stretch
- Burn the image to a micro-SD card (e.g. with Etcher)
- Optional: create a wpa_supplicant.conf file in the “boot” part of the microSD card with your Wifi Information:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid=“YOUR_SSID”
psk=“YOUR_PASSWORD”
key_mgmt=WPA-PSK
}
-
Connect your MATRIX Voice to the Raspberry Pi, insert the microSD card (Optional: Connect a monitor and keyboard and/or network cable) and boot the Raspberry Pi.
-
SSH to picroft.local (or find the IP adress from your router), login “pi” password “mycroft” (or use monitor/keyboard)
-
Follow the mycroft.AI setup, choose “other” under microphone. Wait for mycroft.AI to do it’s thing. If you end up on the mycroft.AI command line (Log Output on top), use Ctrl+C to quit.
-
Now it is time to install the MATRIX Voice Kernel Modules (see also: github: /matrix-io/matrixio-kernel-modules)
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
Reboot in case of Kernel Updates
sudo reboot
Installation MATRIX Packages
sudo apt install matrixio-kernel-modules
sudo apt-get install pulseaudio
One more reboot
sudo reboot
- Make sure that the MATRIX microphone is recognized:
pactl list sources short
The result should look something like this :
(.venv) pi@picroft:~ $ pactl list sources short
0 alsa_output.platform-snd_dummy.0.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_input.platform-snd_dummy.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_input.platform-3f204000.spi-platform-matrixio-codec.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
3 alsa_output.platform-soc_audio.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
- Make sure that the standard microphone is the MATRIX Voice (kill pulseaudio, then set default):
pulseaudio -k
pactl set-default-source 2
pulseaudio --start
- Check the output volume
amixer
The result might look like this (notice the 1%):
(.venv) pi@picroft:~ $ amixer
Simple mixer control ‘Master’,0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 450 [1%] [on]
Front Right: Playback 450 [1%] [on]
Simple mixer control ‘Capture’,0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]
To fix this, set the volume:
amixer set Master 99%
The result of ‘amixer’ should now be this:
(.venv) pi@picroft:~ $ amixer
Simple mixer control ‘Master’,0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 64881 [99%] [on]
Front Right: Playback 64881 [99%] [on]
Simple mixer control ‘Capture’,0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]
- If after a reboot the volume goes back to low, put the command in the audio_setup.sh
sudo nano audio_setup.sh
Add the following line to the end of the file, then exit and save (Strg+X, then Y):
amixer set Master 99%
- Now you can do a test (records audio and plays it back to you)
arecord --duration 5 --rate 16000 --format S16_LE test.wav && aplay ./test.wav
- And another test through mycroft.AI:
mycroft-mic-test
-
Mycroft.AI should keep telling you to register the device. Go to the Mycroft.AI website, login and add Device, then type the spoken code.
-
Optional: Install openHAB skill
cd /opt/mycroft/skills
git clone GITHUB URL HERE skill-openhab
cd skill-openhab
pip install -r requirements.txt
Then you need to add the openHAB configuration to your ‘mycroft.conf’:
sudo nano ./mycroft/mycroft.conf
Then change the file, mine looks like this:
{
“max_allowed_core_version”: 18.8,“openHABSkill”: {
“host”: “OPENHAB.IP.GOES.HERE”,
“port”: “OPENHAB-PORT”
}
}
Enjoy talking to Mycroft!