Snips Led Control

To be honest I do not understand all of the python syntax. So I’ve built some on simple control and changed just the color for the different methods. As far as I can tell this is working as expected.
But in Idle mode I think the snips respeaker-skil is still active. Also the brightness of the leds seems to be conrolled by the respeaker-skil settings.

after deploying the assistant I stopped the skill service, renamed the respeaker-skill folder and restarted the service. Then restarted snipsledcontrol service,
Is there a way to disable the respeaker-skill?
In /skills/snips-skill-respeaker/config.ini maybe:

on_idle=false
on_listen=false
on_speak=false
to_mute=false
to_unmute=false

#!/usr/bin/env python

-- coding: utf-8 --

from models.LedPattern import LedPattern
import time
import threading

class CustomLedPattern(LedPattern):
def init(self, controller):
super(CustomLedPattern, self).init(controller)

	self._colors = {
		'blank' 	: (0, 0, 0),
		'blue'		: (0, 0, 255),
		'red'		: (60, 0, 0),
		'yellow'	: (255, 255, 0),
		'white'		: (255, 255, 255),
		'green'		: (0, 100, 0)

	}


def wakeup(self, direction=0):
	for i in range(self._numLeds):
		self._controller.setLedRGB(i, self._colors['blue'], brightness=1)
		self._controller.show()


def listen(self):
	pass


def think(self):
	for i in range(self._numLeds):
		self._controller.setLedRGB(i, self._colors['green'],  brightness=1)
		self._controller.show()


def speak(self):
	pass

def idle(self, *args):
	pass

def onError(self, *args):
	for i in range(self._numLeds):
		self._controller.setLedRGB(i, self._colors['red'],  brightness=1)
		self._controller.show()
	
def onSuccess(self, *args):
	for i in range(self._numLeds):
		self._controller.setLedRGB(i, self._colors['green'],  brightness=1)
		self._controller.show()


def off(self, *args):
	pass

def onButton1(self, *args):
	# When mic mute button pressed
	for i in range(self._numLeds):
		self._controller.setLed(i, 0, 0, 255, brightness=1)
	self._controller.show()


def onStart(self, *args):
	self._controller.wakeup()

When installing SLC, did you install your hardware? It removes snips-respeaker-skill

Version 1.7 is out

1 Like

@psycho: What can i do to get SLC running? Any hints?

Open a bug report on my git repo to leave this topic clean please

Ok. Thanks for your reply. Opened a issue on github.

  • Respeaker Core V2 is now totally working, including auto install
  • Respeaker Mic array gets setVolume and setVADLed
  • Core V2 missing hex and vid parameters
  • Fixed Alexa pattern out of range led error
  • Subscribing to some missing events
  • Kiboost pattern in installer
  • Not refering to pi anymore in the installer but the logged in user
  • Hidding mqtt password in console
  • Fixed wrong core V2 interface
  • endFrame is configurable through arguments
  • Google AIY uses pin 25 by default
  • Added Matrix Creator
1 Like

Hello - this LED control is working great on my respeaker 2 mic’s leds. I’m making a box that I want to use a 4 lead LED light, thinking I should use the gp12 pin with a groove plug. I have tried to add
ExecStart=/usr/bin/python main.py --hardware=respeaker2 --gpioPin=gp12 --pattern=google
Which does turn off the on board LEDs, but my 4 pin led on gp12 is now green nd not working.
I have tried several different --gpioPin options, I think that is my problem. What is the correct syntax for using the gp12 groove pins on the respeaker. Once I know that I can hopefully do a custom led.
thanks
jim

Hey! GPIO pin is used to control leds like neopixels, that are driven by on gpio. You cannot use it with the “respeaker” hardware option as it is not using that option. By the way “gp12” is not the correct syntax for gpio numbering. You have to use the broadcom pin number
What leds are you looking to control?

Hello, I installed your software on my Raspberry with a MatrixVoice and I have a small problem: with the pattern “Alexa”, a led stays constantly on… with the pattern “Google” all leds remain on…
I don’t get it at all.
I try to reduce the number of leds, sometimes it works a little better.
Can you give me some advice?
Thank you very much. :slight_smile:

Hi Tengu.
Same here with matrix voice.

Same problem here as well with the MatrixVoice.

Unfortunately I don’t have any matrix hardware to test with. But on github there’s a but report system… and some issues with matrix have been resolved already.

Has anyone tried this with a Google AIY v2?
I have it working on the original AIY kit, but the new one has a different hat and a multi-color led button now.

How’s the button wired? On what pins? I can quickly add it

Looks like @shilbert posted the Pinout link.
I followed your link @Psycho, but it jumps to a git branch comparison. It didn’t seem to show any recent changes, so I’m confused if there was a change related to the AIY v2 Voice Hat?

It’s an invitation to pull request, since I got a plain link, which I know, without any explanation on how the aiy kit works or whatever. I can google of course, I just have other things to do than implement hardware I don’t have and most prolly never will. So with no effort comes no help, that’s the way I function :wink:

Thanks for the explanation. I was really only asking if anyone had tried it yet before I dug into it. Unfortunately I haven’t had a chance to play with it yet.
I’ll try to spend some time with it and post my results if I get it working.