Intent recognized but not paresed, function onIntentDetected(intent) not called

Hello.
I am completly new to Snips. I make my Action with two Intents “Ein” and “Aus”, Two Slots and 15 Training Examples in the Editor and deployed it onto my raspberrypi.
I’m hope i got the right topic.

I currently have the problem, that the intent is recognized in the console logs (sam-watch). It says

Blockquote [Nlu] was asked to parse input “schalte stereoanlage ein”

but nothing happens.

I changed the index.js file so it fits my purpose:
I want that “Test4” is printed in the console.
The function

Blockquote function onIntentDetected(intent)

is not called.

Blockquote var mqtt = require(‘mqtt’);

var hostname = “mqtt://raspberrypi.local”;
var client = mqtt.connect(hostname);

client.on(‘connect’, function () {
console.log("[Snips Log] Connected to MQTT broker " + hostname);
client.subscribe(‘hermes/#’);
client.subscribe(‘steckdose/sonoff1’);
});

client.on(‘message’, function (topic, message) {
if (topic === “hermes/asr/startListening”) {
onListeningStateChanged(true);
console.log(“Test1”);
} else if (topic === “hermes/asr/stopListening”) {
onListeningStateChanged(false);
console.log(“Test2”);
} else if (topic.match(/hermes/hotword/.+/detected/g) !== null) {
onHotwordDetected();
console.log(“Test3”);
} else if (topic.match(/hermes/intent/.+/g) !== null) {
onIntentDetected(JSON.parse(message));
console.log(“Test4”);
}
});

function onListeningStateChanged(listening) {
console.log("[Snips Log] " + (listening ? “Start” : “Stop”) + " listening");
}

function onHotwordDetected() {
console.log("[Snips Log] Hotword detected");
}

function onIntentDetected(intent) {
console.log("[Snips Log] Intent detected: " + JSON.stringify(intent));
console.log("Daten: ");
var json_string = JSON.stringify(intent);
console.log(JSON.parse(json_string));
console.log(“Test5”);
console.log(intent.sessionId[0]);
console.log(intent.sessionId[2]);

console.log(intent.slots[0].rawValue);

}

client.on(‘message’, function (topic, message) {
if (topic == ‘hermes/hotword/default/detected’) {
console.log(“Hotword detected!”);
} else if (topic == ‘hermes/intent/MatthiasMatze:Ein’) {
console.log(“Intent detected!”);
}
});

client.on(‘message’, function (topic, message) {
if (topic.startsWith(‘hermes/intent/MatthiasMatze:Ein’)) {
var payload = JSON.parse(message);
var name = payload[“intent”][“intentName”];
var slots = payload[“slots”];
console.log(Intent ${name} detected with slots +
{JSON.stringify(slots)});
}
});

Thank you.
Matt

index_js

Hi! What does snips-watch -vvv say?
Most likely your audio server is not running? sudo systemctl status snips-*
If so, add rate 16000to your output device in /etc/asound.conf

Hey.

It says: see pic.
Audio server was running. I stopped it and now i can’t restart it. Status says that it is running but i don’t see “Hotword detected” in the logs.
I used:
sudo systemctl stop snips-*
sudo systemctl status snips-*
sudo systemctl start snips-*
sudo systemctl status snips-*
and it shows me that its running

It says a component is not answering, the intent is not caught by your script

Hi.
It should be detected. I tested it with:

client.on(‘message’, function (topic, message) {
if (topic == ‘hermes/hotword/default/detected’) {
console.log(“Hotword detected!”);
} else if (topic == ‘hermes/intent/MatthiasMatze:Ein’) {
console.log(“Intent detected!”);
}
});

and varied between

Preformatted textelse if (topic == ‘hermes/intent/Ein’)

and

else if (topic == ‘hermes/intent/MatthiasMatze:Ein’)

Am i right with this code?

ok, now nothing is working.

Normaly Snips makes a Sound when the WakeWord is detected but now it doesn’t.

I used “sam status” and saw that everything is running except snips-nlu and snips-skill-server.
And i can’t restart them with “sudo systemctl start snips-nlu”

Microphone is working. I successfully recorded my voice with audacity and played it back.

Edit: PS: My original question is still not answered

A complete re-installation of the Pi solved every problem. Everythings works as i want.