ReSpeaker 4-Mic Array HAT Mycroft A.I. Skill


#1

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

Install respeaker-4mic-hat-skill by …

  • SSH into your Mycroft, then

In case the requirements are not installed automatically you must perform the following;

  • mycroft-pip install pixel-ring gpiozero

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)
  • sudo raspi-config
  • Go to “Interfacing Options”
  • Go to “SPI”
  • Enable SPI
  • Exit raspi-config
  • ? reboot ?
Manually
  • Edit the file config.txt on the boot partition of your Raspberry Pi
  • Make sure the following content is there;

dtparam=spi=on

Ideas & Additions for later

Finish / Start enabling and disabling the pixel ring
  • “Hey Mycroft”, “Enable pixel ring”
  • “Hey Mycroft”, “Disable pixel ring”
Change LED mode
  • “Hey Mycroft”, “Set pixel ring to Alexa”
  • “Hey Mycroft”, “Set pixel ring to Google”
Add Mycroft LED mode
  • “Hey Mycroft”, “Set pixel ring to Mycroft”
DOA (Direction Of Arrival) of keyword

Where feedback should be directed a

Feedback on the skill should be provided through:


ReSpeaker 4 mic LEDs
#2

WARNING !!! Just installed on Raspbian and 18.8.12 but it hangs the RPI !!!

DO NOT INSTALL (yet)


#3

Now only need to figure out how to debug this?

a) I don’t know Python yet
b) Loading the skill brings the RPi on it’s knees

Running out of time for now. Must be somewhere in spidev <-> gpiozero as only hardware thingies can bring computers on its knees I think.


#4

I would try to debug it like following:

LOG.debug("initialising")
power = LED(5)
LOG.debug("power set to LED(5)")
power.on()
LOG.debug("power on")

Maybe user mycroft is missing permissions:
sudo usermod -g gpio mycroft


#5

Yeah, will start playing around with the ezample code first;

Highly doubt it is the Mycroft part, or your code in that regard.

When I first run the Skill on MycroftOS I was missing lsusb libs, which brought up errors in the section that checks which HAT/Hardware is present via pyusb. Now that error is gone and the PI was bought on it’s knees.

Because of that searched that old Raspbian based SDcard, updated everything and tested there as well. Same thing, so suspect it hangs on either that checking hardware thing with lsusb/pyusb or one step further in actually controllinig the SPI via spidev/gpiozero.

Oh well, a good first project to start learning some Python. Did my fair share of coding with other languages in the past, so can easily read the code. Will see how far I can get…