Snips Led Control

led
leds
hack
respeaker
respeaker-2
#122

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()
0 Likes

#123

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

0 Likes

#124

Version 1.7 is out

1 Like

#126

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

0 Likes

#127

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

0 Likes

#128

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

0 Likes

#129
  • 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

#130

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

0 Likes

#131

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?

0 Likes