A while ago I created a Mycroft A.I. skill for the ReSpeaker 4-Mic array HAT. It was originally only published on their skill-feedback section, however since I pushed a couple of changes a few days ago and I am not able to test it myself because of a possible hardware failure, I thought I share it here as well. Perhaps someone can pick it up, test, tweak, adjust, etc.
With the PR from the user “tgru”, which solves a stupid typo mistake, he confirms the skill does now work. The default LED pattern is the one mimicking Google. There is also a Alexa pattern. withing the library, however switching to it and the creation of a Mycroft BLUE pattern is on the ToDo list for the skill. Anyhow, here it goes…
ReSpeaker 4-Mic Array HAT Mycroft A.I. Skill.
This skill is to enable and control the Seeed – ReSpeaker 4-Mic Array for Raspberry Pi. ReSpeaker 4-Mic Array for Raspberry Pi is a quad-microphone expansion board for Raspberry Pi designed for AI and voice applications and provides a super cool LED ring, which contains 12 APA102 programable LEDs.
DISCLAIMER: At the moment this is NOT tested by me (as of yet), but as multiple people asked for a ReSpeaker 4-Mic Array HAT skill in the past, already created this topic to open the dialogue and possible feedback / testing.
CREDITS: ALL credits go to @Dominik as he created the almost exact same skill for the ReSpeaker Core V2. I only changed some small code to flip the library used (pixel-ring) to use the 4-Mic Array instead.
How to install respeaker-4mic-hat-skill
SSH into your Mycroft, then;
[bash]mycroft-msm install https://github.com/j1nx/respeaker-4mic-hat-skill.git[/bash]Or when you already have the .VENV activated or run MycroftOS;
[bash]msm install https://github.com/j1nx/respeaker-4mic-hat-skill.git[/bash]In case the requirements are not installed automatically you must perform the following;
[bash]mycroft-pip install pixel-ring gpiozero[/bash]Or again when you have the .VENV activated;
[bash]pip install pixel-ring gpiozero[/bash]Or running MycroftOS;
[bash]sudo pip install pixel-ring gpiozero[/bash]Turn on SPI on the Raspberry Pi
To make sure the RPi can control the LEDs, you need to enable SPI;
For Raspbian based systems (Picroft)
[bash]sudo raspi-config<br> Go to “Interfacing Options”<br> Go to “SPI”<br> Enable SPI<br> Exit raspi-config<br> reboot[/bash]Manually Edit the file config.txt on the boot partition of your Raspberry Pi Make sure the following content is there;
dtparam=spi=on
The user running Mycroft need to have permission to access the gpio. If you run MycroftOS this is already been taken care of. If you run pPiCroft or any other distro you most likely need one of the following commands
[bash]sudo usermod -g gpio mycroft[/bash][bash]sudo usermod -g gpio pi[/bash]
For good practice I would reboot the device, just in case. And that should be it. The four google color type of LED’s should light up when the wake word is picked up. The four LED’s will spin, giving you the answer.
Do you like what you just read? Keep me going by donating on Paypal or become a Patron.
Hi Peter! I am not able to get the Respeaker 4-Mic to even pass the basic sound test after installation. Are you aware of any blog/post/forum where detailed diagnostic was done so I could try to repeat and find out what is going wrong on my side? Thanks, JJ
Which OS are you using? And could you post the outcome of the command; “uname -a”?
FYI just did this in Picroft and worked after the raspi-config. pi user already had gpio. Anyway, thanks for this!
How do you enable Alexa style lighting?
With the latest version of the skill, Alexa is already enabled by default.
I can confirm this works with ReSpeaker 6-Mic Circular Array Kit as well
Perfect! Thanks for the confirmation.
Great skill, thank you! I have just changed hat to the geekworm raspi voice hat which also has 12 LEDs – I wonder if you could advise how this could be compatible?
Do you have a link to some more information?