Snips Led Control

led
leds
respeaker
hack
respeaker-2

#82

In snips.toml, mosquitto.conf or is there a paho-config file?


#83

I don’t know, test it yourself gosh, try to use another adress, maybe 127.0.0.1 or something else, I can’t just help with everything bud, it says it can’t connect to mqtt there’s surely a reason to that


#84

Okay. Thank you. Don’t get angry :wink: I’m just new to all this stuff and trying to get a working snips :slight_smile: Thanks a lot


#85

Your own posted mosquitto configuration state that the server is on 10.1.1.85:1883 so why do you try to use “localhost” for the mqttServer option?

P.S.
The error shown in your logs about stopping not possible is fixed in 1.6


#86

I wanted to create a mqtt server on my snips and make a bridge between HomeAssistant (10.1.1.85) and the snips mqtt server (localhost).

I will read more docs about mqtt and try to get better at this stuff.


#87

I am back. After starting my snips i have to use:

sudo systemctl restart mosquitto.service

and all the mqtt problems are gone.

5 hours of reinstall etc. and it was just this command -.-

Back to what you said.

sudo systemctl stop snipsLedControl did not work i had to cd into snipsledcontrol and use sudo systemctl stop snipsledcontrol

LEDs turned off than.

pi@raspberrypi:~/snipsLedControl_v1.6 $ python main.py --hardware=respeaker4 --mqttServer=localhost --pattern=alexa
Traceback (most recent call last):
  File "main.py", line 19, in <module>
    rotatingHandler = logging.handlers.RotatingFileHandler(filename='./logs/{}-logs.log'.format(date), mode='a', maxBytes=100000, backupCount=5)
  File "/usr/lib/python2.7/logging/handlers.py", line 117, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/handlers.py", line 64, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/__init__.py", line 913, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 943, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/home/pi/snipsLedControl_v1.6/logs/20181226-logs.log'

with a sudo it worked without problems:

pi@raspberrypi:~/snipsLedControl_v1.6 $ sudo python main.py --hardware=respeaker4 --mqttServer=localhost --pattern=alexa
Starting Snips Led Control
Initializing SnipsLedControl v1.6
Loading configurations
Loaded 9 hardware references
- Mqtt server set to localhost
- Mqtt port set to 1883
- Client id set to wohnzimmer
- Hardware set to ReSpeaker 4
- Using alexa as pattern with 12 leds
Initializing leds controller
Snips Led Control started

#88

Glad to hear. I told you 2 times already about the logs, permission denied, let’s clarify again:

The service runs as root, everytime your pi is booting. It creates logs, as root, so of course, trying to run SLC manually, as user pi ends up in a permission error. If you want to manually start SLC without sudo, you have to reset the logs owner using: sudo chown -R pi logs so that user pi can access the files. That being said, you don’t need to run manually, the service takes care of everything, reboot after reboot


#89

Thank you for your patience. I did that and now its working fine without sudo.

Now the LEDs of my speakers are always on in one mode and dont even change when i say something.

I will try to solve the problem on my own. If I cant i’ll be back. Hope thats okay :slight_smile:

edit: Could fix it. Now i am back with the same error like in the video above.

I tried the following

python main.py --hardware=respeaker4 --pattern=alexa --wakeupPattern=off --errorPattern=off --successPattern=off --updatingPattern=off --callPattern=off --wakeupPattern=off --conErrorPattern=off --messagePattern=off --dndPattern=off --setupModePattern=off --idlePattern=off --speakPattern=off --thinkPattern=off --listenPattern=off

In the beginning the leds are off. When i say “hey snips” the leds turn on and everything is as in the video.


#90

I see you updated to 1.6. I added a “–debug=True” argument yesterday after me going a bit nuts (sry) . Try to start with that argument, manually, to see if the topics are caught or not


#91

did just the
python main.py --debug=True

and its giving me:
Starting Snips Led Control
Initializing SnipsLedControl v1.6
Loading configurations
Loaded 9 hardware references
- Mqtt server set to 127.0.0.1
- Mqtt port set to 1883
- Client id set to wohnzimmer
- 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
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
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
Button 1 not implemented, override it in CustomLedPattern
Button 1 not implemented, override it in CustomLedPattern

with --hardware and --pattern…

pi@snips-wohnzimmer:~/snipsLedControl_v1.6 $ sudo systemctl stop snipsledcontrol
pi@snips-wohnzimmer:~/snipsLedControl_v1.6 $ python main.py --debug=True --hardware=respeaker4 --pattern=alexa
Starting Snips Led Control
Initializing SnipsLedControl v1.6
Loading configurations
Loaded 9 hardware references
- Mqtt server set to 127.0.0.1
- Mqtt port set to 1883
- Client id set to wohnzimmer
- Hardware set to ReSpeaker 4
- Using alexa as pattern with 12 leds
Initializing leds controller
Snips Led Control started

respeaker4 means 4mic array right?

I said two times: "hey snips"without a command afterwards but nothing is shown in console.

The logs do not show more than that.

I looked into this log:
pi@snips-wohnzimmer:~/snipsLedControl_v1.6/logs $ sudo nano 20181227-logs.log

My /var/log/syslog looks like this:

Dec 27 11:30:02 snips-wohnzimmer snips-hotword[1958]: INFO:snips_hotword_hermes        : Hotword detected: site_id:wohnzimmer model:hey_snips (333ms ago)
Dec 27 11:30:02 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [wohnzimmer]: reset site -> turn off ASR and turn off Hotword
Dec 27 11:30:02 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [a7f34d21-e010-4d0c-af25-e83cef13047b]: The session has been created because the site "wohnzimmer" is free
Dec 27 11:30:02 snips-wohnzimmer snips-hotword[1958]: INFO:snips_hotword_lib::audio    : Audio thread for site wohnzimmer stopped.
Dec 27 11:30:02 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing "34e728d5-f6d4-4409-a5dd-b26673ffa413" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bit$
Dec 27 11:30:02 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing of "34e728d5-f6d4-4409-a5dd-b26673ffa413" finished
Dec 27 11:30:02 snips-wohnzimmer snips-tts[1961]: WARN:snips_tts_hermes: Received a "play finished" message from audio server with an unknown id '34e728d5-f6d4-4409-a5dd-b26673ffa413'. It could be normal if you have more$
Dec 27 11:30:02 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Listening
Dec 27 11:30:02 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0       entered AsrRunner::run
Dec 27 11:30:02 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+0.000 capture started
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.527 endpoint detected (rule:1) frame:273 samples:69888 signal_time:4.368 rtf:0.493
Dec 27 11:30:07 snips-wohnzimmer systemd[1]: Starting Cleanup of Temporary Directories...
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : Source thread stop on push: "Disconnected(..)"
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.544 capture ended
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.558 decoder finalized
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.561 lookup and post-processing done
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : decoded: [Recognition { decoded_string: "", likelihood: 0.0, tokens: Some([]) }]
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Cleanup
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Preparing decoder
Dec 27 11:30:07 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing "a4581b98-804f-4e16-9240-b42e056b9d4d" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bit$
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Preparing decoder
Dec 27 11:30:07 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing "a4581b98-804f-4e16-9240-b42e056b9d4d" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bit$
Dec 27 11:30:07 snips-wohnzimmer systemd[1]: Started Cleanup of Temporary Directories.
Dec 27 11:30:07 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Idle
Dec 27 11:30:08 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing of "a4581b98-804f-4e16-9240-b42e056b9d4d" finished
Dec 27 11:30:08 snips-wohnzimmer snips-tts[1961]: WARN:snips_tts_hermes: Received a "play finished" message from audio server with an unknown id 'a4581b98-804f-4e16-9240-b42e056b9d4d'. It could be normal if you have more$
Dec 27 11:30:08 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing "fe261393-43e5-44d3-b1ca-f57effe6cc62" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 44100, bit$
Dec 27 11:30:08 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing of "fe261393-43e5-44d3-b1ca-f57effe6cc62" finished
Dec 27 11:30:08 snips-wohnzimmer snips-tts[1961]: WARN:snips_tts_hermes: Received a "play finished" message from audio server with an unknown id 'fe261393-43e5-44d3-b1ca-f57effe6cc62'. It could be normal if you have more$
Dec 27 11:30:08 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [a7f34d21-e010-4d0c-af25-e83cef13047b]: closing session which was active: IntentNotRecognized
Dec 27 11:30:08 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [wohnzimmer]: reset site -> turn off ASR and turn on Hotword
Dec 27 11:30:08 snips-wohnzimmer snips-hotword[1958]: INFO:snips_hotword_lib::audio    : Audio thread for site wohnzimmer started.
Dec 27 11:31:43 snips-wohnzimmer snips-hotword[1958]: INFO:snips_hotword_hermes        : Hotword detected: site_id:wohnzimmer model:hey_snips (410ms ago)
Dec 27 11:31:43 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [wohnzimmer]: reset site -> turn off ASR and turn off Hotword
Dec 27 11:31:43 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [91b8f8b1-6646-4f34-b1c4-9b5fa8fa1714]: The session has been created because the site "wohnzimmer" is free
Dec 27 11:31:43 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing "acce4e2d-7212-4cd6-901f-962ae38c60bf" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bit$
Dec 27 11:31:43 snips-wohnzimmer snips-hotword[1958]: INFO:snips_hotword_lib::audio    : Audio thread for site wohnzimmer stopped.
Dec 27 11:31:44 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing of "acce4e2d-7212-4cd6-901f-962ae38c60bf" finished
Dec 27 11:31:44 snips-wohnzimmer snips-tts[1961]: WARN:snips_tts_hermes: Received a "play finished" message from audio server with an unknown id 'acce4e2d-7212-4cd6-901f-962ae38c60bf'. It could be normal if you have more$
Dec 27 11:31:44 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Listening
Dec 27 11:31:44 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0       entered AsrRunner::run
Dec 27 11:31:44 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+0.000 capture started
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.527 endpoint detected (rule:1) frame:273 samples:69888 signal_time:4.368 rtf:0.476
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : Source thread stop on push: "Disconnected(..)"
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.528 capture ended
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.541 decoder finalized
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : T0+4.544 lookup and post-processing done
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_lib::asr        : decoded: [Recognition { decoded_string: "", likelihood: 0.0, tokens: Some([]) }]
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Cleanup
Dec 27 11:31:48 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Preparing decoder
Dec 27 11:31:48 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing "9683eb13-dc9b-4c32-95da-e8883ab3db94" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bit$
Dec 27 11:31:49 snips-wohnzimmer snips-asr[2023]: INFO:snips_asr_hermes          : Idle
Dec 27 11:31:50 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing of "9683eb13-dc9b-4c32-95da-e8883ab3db94" finished
Dec 27 11:31:50 snips-wohnzimmer snips-tts[1961]: WARN:snips_tts_hermes: Received a "play finished" message from audio server with an unknown id '9683eb13-dc9b-4c32-95da-e8883ab3db94'. It could be normal if you have more$
Dec 27 11:31:50 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing "3e71056f-c37a-44fd-b50b-aa3081ff55f0" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 44100, bit$
Dec 27 11:31:50 snips-wohnzimmer snips-audio-server[1960]: INFO:snips_audio_portaudio      : Playing of "3e71056f-c37a-44fd-b50b-aa3081ff55f0" finished
Dec 27 11:31:50 snips-wohnzimmer snips-tts[1961]: WARN:snips_tts_hermes: Received a "play finished" message from audio server with an unknown id '3e71056f-c37a-44fd-b50b-aa3081ff55f0'. It could be normal if you have more$
Dec 27 11:31:50 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [91b8f8b1-6646-4f34-b1c4-9b5fa8fa1714]: closing session which was active: IntentNotRecognized
Dec 27 11:31:50 snips-wohnzimmer snips-dialogue[1959]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [wohnzimmer]: reset site -> turn off ASR and turn on Hotword
Dec 27 11:31:50 snips-wohnzimmer snips-hotword[1958]: INFO:snips_hotword_lib::audio    : Audio thread for site wohnzimmer started.

#92

Entirely my fault, I missed the debug level. You can either update to 1.6.1 or mod yourself like in this commit: https://github.com/Psychokiller1888/snipsLedControl/commit/bd40642cd00a6b27729827e9e706462264ffd7e6

You will see what mqtt topics are caught and follow the leds logic if you use --debug=True . Past that, I see that you are pressing the button. Alexa doesn’t have the button implemented, that’s why you see the “Button 1 not implemented” If you want to use it, you have to create your own custom pattern


#93

Hi. Glad its not me again :smiley:

  1. I will update
  2. I did not press a button?

I will try it now and write again :slight_smile: Thank you


#94

BTW respeaker 4 is not respeaker 4 mic array


#95

oh wow okay. So what do i have to select for 4mic array?


#96

Sorry my bad: http://wiki.seeedstudio.com/ReSpeaker_4_Mic_Array_for_Raspberry_Pi/ This is respeaker 4

This is mic array: http://wiki.seeedstudio.com/ReSpeaker_Mic_Array_v2.0/


#97

Okay. I have the first one. Respeaker 4 Mic array. I know the names are a little bith confusion :slight_smile:


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

You don’t have a respeaker 2 in your living room but a respeaker 4

If this is indeed a respeaker 2 and you didn’t press the button, you should worry for your device, this button is surely constantly pressed. But It’s coming from the fact that if you don’t specify the hardware, it falls back to respeaker 2 by default.


#99

Finally… i have a better output for you.

First on hotword triggered i said nothing after “hey sips”

and on the second on hotword triggered i gave it a command.

Starting Snips Led Control v. 1.6.1
Initializing SnipsLedControl
Loading configurations
Loaded 9 hardware references
- Mqtt server set to 127.0.0.1
- Mqtt port set to 1883
- Client id set to wohnzimmer
- Hardware set to ReSpeaker 4
- Using alexa as pattern with 12 leds
Initializing leds controller
Snips Led Control started
On hotword triggered
On listen triggered
On think triggered
On hotword toggle on triggered
On hotword triggered
On listen triggered
On think triggered
On hotword toggle on triggered

#100

If it still gives you a mess, I think you have something running on background taking over your leds. As we clearly see it goes up until “hotword toggle on” that turns the leds off


#101

The strange thing is that it worked when i installed it with SAM. Than i reinstalled it the manual way and the leds where always on. Both have the same config.

I plugged the SAM SD card back in and made a video

I will install the new version with debug function too and compare it. Does it make sense to compare the taskmanager htop

by the way… I installed a lot on the SAM server. So it might be the problem that i missed a skill or something else on the manual installation?!

edit: I have the same output

Starting Snips Led Control v. 1.6.1
Initializing SnipsLedControl
Loading configurations
Loaded 9 hardware references
- Mqtt server set to localhost
- Mqtt port set to 1883
- Client id set to wohnzimmer
- Hardware set to ReSpeaker 4
- Using alexa as pattern with 12 leds
Initializing leds controller
Snips Led Control started
On hotword triggered
On listen triggered
On think triggered
On hotword toggle on triggered

LEDs are working fine. So you are right that something else takes over control.