Snips Led Control

You need to start SLC as debug and post the debug trace on my github repo, because I can’t say like that

I did as requested and I think the issues is even known in this thread:

I added my debug output as well.

Hello Psycho,

i’m using a Matrix Voice together with your LED Control.
The problem is, that the LEDs don’t respond together with the Wakeword. It only works after restarting the service after every reboot with sudo systemctl stop snipsledcontrol ...

The file logs.log contains the following:

2019-07-20 15:05:10,043 [MainThread] - [INFO] - Starting Snips Led Control v. 1.8
2019-07-20 15:05:10,077 [MainThread] - [INFO] - Initializing SnipsLedControl
2019-07-20 15:05:10,079 [MainThread] - [INFO] - Loading configurations
2019-07-20 15:05:10,302 [MainThread] - [INFO] - Loaded 12 hardware references
2019-07-20 15:05:10,303 [MainThread] - [INFO] - - Mqtt server set to localhost
2019-07-20 15:05:10,304 [MainThread] - [INFO] - - Mqtt port set to 1883
2019-07-20 15:05:10,306 [MainThread] - [INFO] - - Client id set to default
2019-07-20 15:05:10,307 [MainThread] - [INFO] - - Hardware set to Matrix Voice
2019-07-20 15:05:10,308 [MainThread] - [INFO] - - Using alexa as pattern with 18 leds
2019-07-20 15:05:10,309 [MainThread] - [INFO] - Initializing leds controller
2019-07-20 15:05:10,582 [Thread-2] - [ERROR] - Caught exception in on_connect: ‘NoneType’ object has no attribute 'subscribe’
2019-07-20 15:05:10,592 [MainThread] - [INFO] - Snips Led Control started
2019-07-20 15:19:10,500 [MainThread] - [INFO] - Shutting down Snips Led Control

I don’t know if i did a mistake while debugging but it returns me the following:

pi@himbipi:~/snipsLedControl_v1.8.0 $ python main.py --debug=True
Traceback (most recent call last):
File “main.py”, line 10, in
from models.SnipsLedControl import SnipsLedControl
File “/home/pi/snipsLedControl_v1.8.0/models/SnipsLedControl.py”, line 236
def onMessage(self, client, userdata, message: MQTTMessage):
^
SyntaxError: invalid syntax

I already tried reinstalling it.
Would a delay for on_connect help?

Thank you for your support and your great App! :blush:

You need to use python 3

SLC v1.8.1 - Fixing apa102 led problems

SLC 1.8.2

  • New premade animations
  • Couple of fixes on some patterns
  • Project Alice patterns

SLC 1.9

  • Direction of Arrival
  • Fixed doubleSidedFilling animation
  • Enhanced Project Alice pattern with DoA
  • Fixed non stopping animations

hi all , i’ve got a error in my logs that seems to be stopping the LED script from working. Looks like it relates to the numpy module ?. There’s not too much documentation around the net that relates to this error that i can see other than uninstall and reinstall numpy which i have done but sadly did not help.
the below is my log file. Has anybody had this issue before that can enlighten me please ?

snips python3[7421]: Starting Snips Led Control v. 1.9.2
Jul 28 09:46:27 snips python3[7421]: Initializing SnipsLedControl
Jul 28 09:46:27 snips python3[7421]: Loading configurations
Jul 28 09:46:27 snips python3[7421]: Loaded 12 hardware references
Jul 28 09:46:27 snips python3[7421]: - Mqtt server set to snips.local
Jul 28 09:46:27 snips python3[7421]: - Mqtt port set to 1883
Jul 28 09:46:27 snips python3[7421]: - Mqtt username set to “hidden”
Jul 28 09:46:27 snips python3[7421]: - Mqtt password set to “hidden”
Jul 28 09:46:27 snips python3[7421]: - Client id set to master
Jul 28 09:46:27 snips python3[7421]: - Hardware set to ReSpeaker 4
Jul 28 09:46:27 snips python3[7421]: - Using alexa as pattern with 12 leds
Jul 28 09:46:27 snips python3[7421]: Initializing leds controller
Jul 28 09:46:27 snips python3[7421]: Hardware is DOA capable
Jul 28 09:46:27 snips python3[7421]: Traceback (most recent call last):
Jul 28 09:46:27 snips python3[7421]: File “main.py”, line 127, in
Jul 28 09:46:27 snips python3[7421]: main()
Jul 28 09:46:27 snips python3[7421]: File “main.py”, line 112, in main
Jul 28 09:46:27 snips python3[7421]: slc = SnipsLedControl(args)
Jul 28 09:46:27 snips python3[7421]: File “/home/pi/snipsLedControl_v1.9.2/models/SnipsLedControl.py”, line 151, in init
Jul 28 09:46:27 snips python3[7421]: self._ledsController = LedsController(self)
Jul 28 09:46:27 snips python3[7421]: File “/home/pi/snipsLedControl_v1.9.2/models/LedsController.py”, line 46, in init
Jul 28 09:46:27 snips python3[7421]: if not self.initHardware():
Jul 28 09:46:27 snips python3[7421]: File “/home/pi/snipsLedControl_v1.9.2/models/LedsController.py”, line 104, in initHardware
Jul 28 09:46:27 snips python3[7421]: self._interface = APA102(hardware=self._hardware, endFrame=self._hardware[‘endFrame’])
Jul 28 09:46:27 snips python3[7421]: File “/home/pi/snipsLedControl_v1.9.2/interfaces/apa102.py”, line 35, in init
Jul 28 09:46:27 snips python3[7421]: from libraries.seeedstudios.channel_picker import ChannelPicker
Jul 28 09:46:27 snips python3[7421]: File “/home/pi/snipsLedControl_v1.9.2/libraries/seeedstudios/channel_picker.py”, line 8, in
Jul 28 09:46:27 snips python3[7421]: import numpy as np
Jul 28 09:46:27 snips python3[7421]: ImportError: No module named ‘numpy’
Jul 28 09:46:28 snips systemd[1]: snipsledcontrol.service: Main process exited, code=exited, status=1/FAILURE
Jul 28 09:46:28 snips systemd[1]: snipsledcontrol.service: Unit entered failed state.
Jul 28 09:46:28 snips systemd[1]: snipsledcontrol.service: Failed with result ‘exit-code’.

and debug logs say

Starting Snips Led Control v. 1.9.2
Initializing SnipsLedControl
Loading configurations
Loaded 12 hardware references

  • Mqtt server set to snips.local
  • Mqtt port set to 1883
  • Mqtt username set to snips
  • Mqtt password set to “hidden”
  • Client id set to master
  • Hardware set to ReSpeaker 2
  • Using google as pattern with 3 leds
    Initializing leds controller?
    Button 1 not implemented, override it in CustomLedPattern
    Snips Led Control started
    Button 1 not implemented, override it in CustomLedPattern
    Button 1 not implemented, override it in CustomLedPattern
    Button 1 not implemented, override it in CustomLedPattern
    Button 1 not implemented, override it in CustomLedPattern
    Button 1 not implemented, override it in CustomLedPattern

and it’s just dawned on me that i used to have this working then i upgraded to v1.9.2 since then it doesnt work. When i checked my python version it says version 2.7 ( i’m on stretch) perhaps that’s the issue ?

cheers

There’s a git issue to report issues and check what others have already imported :wink:

The error is written for you, you don’t have numpy installed, simply install it in the slc python virtual environment.

cd  /home/pi/snipsLedControl_v1.9.2
./venv/bin/pip3 install numpy

thanks for that. I’m learning everyday so i will check in the git issues as well in the future :slight_smile: unfortunately the above command brought up a heap more errors so i will no doubt be posting in there if i can’t work the new errors out :slight_smile:

Hey Psycho!

Going to try your app…a few of questions:

  1. is there a way to uninstall short of starting over in the event of conflicts? (I will image my SD card prior)

  2. since the snips installation using Sam installs the snips-skill-respeaker LED-animation app if you elect/need to do the Maker kit option during setup audio, I assume it will conflict…
    a) I guess, if my audio appears to be working OK prior to installing snips, I can avoid doing the Maker Kit option and still have the Pi Hat work well?
    b) I have to delete that skill folder in my /var/lib/snips/skills directory anyway due to its not working well (maybe my app conflicts, though I do not use SPI in it), so I guess if I do/forced to install the snips one, I can always delete the folder and install yours?
    c) any conflicts if I have already installed the snips one prior?

I am not real proficient yet in Raspbian or snips, so just checking…been doing my own animation (SPI snippets) with the 2-Mics Pi Hat but not totally pleased with results…

Thanks for your efforts (if it works for me I WILL buy you some beer :partying_face: )…

Frank

Hey there!

  • Uninstalling is not really needed, you can simply turn off the service: sudo systemctl disable snipsledcontrol. You can then simply delete the SLC directory in /home/pi
  • SLC does install, if you want, your respeaker 2
  • The respeaker skill is taken care of by SLC

Custom animations are pretty easy to implement. Once you’re up and renning, check the code in the “ProjectAlice” animation I lately released, it shows use of my premade animations kit

Nice - I’ll give it a go! Frank

Hi all,

after the recent update, slc / the leds don’t respond at all. I’ve already installed python3 and i’am using a matrix voice. The ring doesn’t even light after starting.

By debugging i get the following error:

pi@himbipi:~ $ cd snipsLedControl_v1.9.7/
pi@himbipi:~/snipsLedControl_v1.9.7 $ sudo systemctl stop snipsledcontrol
pi@himbipi:~/snipsLedControl_v1.9.7 $ ./venv/bin/python3 main.py --debug=True --hardware=matrixvoice --pattern=alexa
Starting Snips Led Control v. 1.9.7
Initializing SnipsLedControl
Loading configurations
Loaded 12 hardware references
- Mqtt server set to localhost
- Mqtt port set to 1883
- Client id set to default
- Hardware set to Matrix Voice
- Using alexa as pattern with 18 leds
Initializing leds controller
Traceback (most recent call last):
  File "/home/pi/snipsLedControl_v1.9.7/venv/lib/python3.7/site-packages/halSwig.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "/home/pi/snipsLedControl_v1.9.7/venv/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 127, in <module>
    main()
  File "main.py", line 112, in main
    slc = SnipsLedControl(args)
  File "/home/pi/snipsLedControl_v1.9.7/models/SnipsLedControl.py", line 151, in __init__
    self._ledsController = LedsController(self)
  File "/home/pi/snipsLedControl_v1.9.7/models/LedsController.py", line 46, in __init__
    if not self.initHardware():
  File "/home/pi/snipsLedControl_v1.9.7/models/LedsController.py", line 115, in initHardware
    from interfaces.matrixvoice import MatrixVoice
  File "/home/pi/snipsLedControl_v1.9.7/interfaces/matrixvoice.py", line 3, in <module>
    from matrix_lite import led
  File "/home/pi/snipsLedControl_v1.9.7/venv/lib/python3.7/site-packages/matrix_lite/__init__.py", line 4, in <module>
    from matrix_lite import led, sensors, gpio
  File "/home/pi/snipsLedControl_v1.9.7/venv/lib/python3.7/site-packages/matrix_lite/led.py", line 2, in <module>
    from halSwig import everloop, led
  File "/home/pi/snipsLedControl_v1.9.7/venv/lib/python3.7/site-packages/halSwig.py", line 21, in <module>
    _halSwig = swig_import_helper()
  File "/home/pi/snipsLedControl_v1.9.7/venv/lib/python3.7/site-packages/halSwig.py", line 20, in swig_import_helper
    return importlib.import_module('_halSwig')
  File "/home/pi/snipsLedControl_v1.9.7/venv/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

Thank you for support :smiley:

This is a common python problem, when you build from sources. Either you are running on Buster inwhich case the pi fundation made a bad work, or you compiled python 3.7 by yourself but forgot the --enable-shared flag

I’ve got an installation issue - probably my fault but I can’t work it out. Installs virtualenv and then can’t find it…

The terminal shows:

Collecting virtualenv
  Using cached https://files.pythonhosted.org/packages/db/9e/df208b2baad146fe3fbe750eacadd6e49bcf2f2c3c1117b7192a7b28aec4/virtualenv-16.7.2-py2.py3-none-any.whl
Installing collected packages: virtualenv
Successfully installed virtualenv-16.7.2
bash: line 2: virtualenv: command not found
bash: line 3: /home/pi/snipsLedControl_v1.9.8/venv/bin/activate: No such file or directory

i had a similar problem during the installation. Then i’ve installed Python 3 on raspbian stretch on my own, following this instruction: https://gist.github.com/SeppPenner/6a5a30ebc8f79936fa136c524417761d

after that, i changed the ExecStart=... line

in the file:

/etc/systemd/system/snipsledcontrol.service

to

ExecStart=/usr/bin/python3 main.py --hardware=matrixvoice --pattern=alexa

In my case this fixed the issue, but no guarantee that it will help you, as i had Problems with Python 3. I’m still a beginner :sweat_smile:

Hi there! I would like to ask if it is possible to publish manually a mqtt topic such as “hermes/hotword/default/detected” or “hermes/leds/doNotDisturb” to trigger the LED ?

I published these topics to the mqtt broker in the localhost but nothing happened (LED not lighting up) even though SnipsLedControl is subscribing to these topics.

Thanks !

Of course you can. But without log I can’t help. The instructions are on github

Release 1.9.12

  • Disable DoA by default
  • Fix mqtt server if taken from snips.toml