Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

ReSpeaker LED manager

A simple management daemon for the ReSpeaker 4-mic LED ring

What is it?

The ReSpeaker 4-mic is a Raspberry Pi "hat" which provides an array of 4 microphones and an LED ring, and is used for audio input and user feedback for Pi-based voice control devices such as my own contraptions. This repository provides a simple daemon to manage the LED components in an asynchronous and extensible way, suitable to be called from another application such as Kalliope or via the CLI directly.

This daemon is based on the following components:

How to use it


  1. Clone this repo into an available directory (I use /srv):
    cd /srv
    git clone <repo>
  2. Enable the service unit file:
    systemctl enable /srv/respeaker-led/respeaker-led.service
  3. Start the service:
    systemctl start respeaker-led.service
  4. Trigger a test command:
    /srv/respeaker-led/ hold white 5

Python Dependencies

  • gpiozero

Main Files

The client command processor. It sends its arguments to the cmd_socket (by default /run/respeaker-led.sock) of the daemon and then exits.

This is the main control daemon. It first opens a command pipe at cmd_socket, then runs in a loop scanning for commands from the pipe and executing them.


A simple Systemd service unit file to run and restart it on failure. It features a nifty pre-start command to automatically git pull the repo to ensure it's up-to-date (and simplifying administrator or developer work when modifying the daemon - just restart it to get the latest code!) Note that for my own purposes, running as a dedicated user on many independent Raspbian instances and pulling from my local protected GitLab instance, this requires a Git deploy SSH key located at /srv/git-deploy.key; you should remove this if your setup does not require such security methods (which a clone from GitHub would not). You should also modify the daemon user and group as required.

Usage of

$ [<user>:<group>]


  • The user and group names that should own the cmd_socket file (mode 644); defaults to root:root if not set or invalid

Usage of

$ <action> [<colour>] [<holdtime>]


  • none: Print usage
  • off: Turn off LEDs (unless held)
  • on: Turn on LEDs until next off action
  • flash: Flash LEDs until next off action
  • hold: Keep LEDs on for some time unless overridden


  • white
  • red
  • blue
  • green
  • yellow
  • cyan
  • magenta


  • The duration in seconds to keep the LEDs on (hold action only); defaults to 3 seconds if not set

The use-case

For a full description of the entire project, please see this post on my website.

My main use-case for this daemon, and hence my selection of valid colours, "patterns", and functions, is as a visual user feedback device for a Kalliope instance which does not produce any sound responses. To achieve this, the Kalliope instance calls directly from the shell neuron inside its "hook" orders, which are built-in to Kalliope. The following Kalliope brain.yml section provides a description of how the functions and colours are used in this context.

- name: "on-triggered-synapse"
  signals: []
    - shell:
        cmd: /srv/respeaker-led/ on white

- name: "on-waiting-for-trigger-synapse"
  signals: []
    - shell:
        cmd: /srv/respeaker-led/ off

- name: "on-start-listening-synapse"
  signals: []
    - shell:
        cmd: /srv/respeaker-led/ on blue

- name: "on-stop-listening-synapse"
  signals: []
    - shell:
        cmd: /srv/respeaker-led/ off

- name: "on-order-found-synapse"
  signals: []
    - shell:
        cmd: /srv/respeaker-led/ hold green 3

- name: "on-order-not-found-synapse"
  signals: []
    - shell:
        cmd: /srv/respeaker-led/ hold red 3

- name: "on-start-synapse"
  signals: []
    - shell:
        cmd: /srv/respeaker-led/ flash magenta
    - shell:
        cmd: /bin/sleep 4.5 # Just long enough for 5 blinks

Of course, Kalliope isn't the only possible use-case for this daemon, so feel free to adapt it to suit your needs!


This project is licensed under the GNU GPL version 3.0 or any later version.


A simple management daemon for the ReSpeaker 4-mic LED ring




No releases published


No packages published