razzo04 / rhasspy-mobile-app

A simple mobile app for rhasspy.
MIT License
118 stars 13 forks source link

When pressing the mic no recording takes place. #7

Closed gribouk closed 2 years ago

gribouk commented 3 years ago

Hello there! This is a great app you've made. I have some issues making it work however... When I just installed it, it used to record commands but no speachvto text activity was set up. Then I turned on the the set up of the rhasspy server, it started to do text to speach, but now it does not do recording... I the logs I have this: Screenshot_20210131-022830 What do I have to do to make it work? Thanks!

razzo04 commented 3 years ago

From the logs, it seems that the app is sending a hotwork detected message but rhasspy is not responding. You have probably enabled the option "use external Dialogue manager" this in a normal configuration should not be enabled since the app already takes care of managing the session this is useful if you want to have more control over how the session is handled. If it doesn’t work after disabling it, you might want to try sending the logs after you run auto set-up.

gribouk commented 3 years ago

Thanks for your reply. Unfortunatelly, when I've read this I already reinstalled the app and it did start to send records to rhasspy, thus I cannot determine what was wrong that time, but it deffinetely was not for the MQQT since I was not running it at that time. But now I have new issues:

  1. I cannot make the wake word work. I have set up the wake word, I launch it in the app and it says it is listening to the wake word - but when I say the wake word 'terminator' - no reaction...
  2. When I establish MQTT connection no speach recognition takes place. It only says in the log MQTT keepAlive every 15 sec and no othe activity...
  3. . Below is my rhaspy setup,

{ "command": { "webrtcvad": { "max_sec": "30", "silence_method": "all", "vad_mode": "3" } }, "dialogue": { "system": "rhasspy" }, "handle": { "system": "hass" }, "home_assistant": { "access_token": "handle_type": "event", "url": "http://192.168.1.3:8123/" }, "intent": { "fuzzywuzzy": { "min_confidence": "0" }, "system": "fsticuffs" }, "microphone": { "system": "pyaudio" }, "mqtt": { "enabled": "true", "host": "192.168.1.3", "password": "pass", "username": "user" }, "sounds": { "system": "aplay" }, "speech_to_text": { "kaldi": { "open_transcription": true }, "pocketsphinx": { "mix_weight": "0" }, "system": "pocketsphinx" }, "text_to_speech": { "espeak": { "voice": "ru", "volume": "1" }, "system": "espeak" }, "wake": { "porcupine": { "keyword_path": "terminator_linux.ppn" }, "system": "porcupine" } }

razzo04 commented 3 years ago

From the configuration of rhasspy, it seems that the auto-setup was not run because there is no site-id of the app and therefore rhasspy won't respond to the messages of the app. Try to do auto-setup again as described in the documentation and then check the logs for errors.

For the wake word configuration, I had done a little guide. I hope it will be useful.

gribouk commented 3 years ago
  1. This manual is not fully applicable to my case since I rum rhasspy as add-on in Home Assistant meaning that though I have portainer add-on installed, but rhasspy cantainer is hidden from me by the hassos and I cannot see its internal port and ip. In the add-on config I have port 12333 dedicated for UDP input stream. So, I did what I could - local_ip:12333 in the App and in the Rhasspy wake word config. Just like this:

    
    {
    "command": {
        "webrtcvad": {
            "max_sec": "30",
            "silence_method": "all",
            "vad_mode": "3"
        }
    },
    "dialogue": {
        "system": "rhasspy"
    },
    "handle": {
        "system": "hass"
    },
    "home_assistant": {
        "access_token": token",
        "handle_type": "event",
        "url": "http://192.168.1.3:8123/"
    },
    "intent": {
        "fuzzywuzzy": {
            "min_confidence": "0.5"
        }
    },
    "microphone": {
        "system": "pyaudio"
    },
    "mqtt": {
        "enabled": "",
        "host": "192.168.1.3",
        "password": "pass",
        "site_id": "mobile-app1",
        "username": "user"
    },
    "sounds": {
        "system": "aplay"
    },
    "speech_to_text": {
        "pocketsphinx": {
            "mix_weight": "0"
        },
        "system": "pocketsphinx"
    },
    "text_to_speech": {
        "espeak": {
            "voice": "ru",
            "volume": "1"
        },
        "marytts": {
            "locale": "ru",
            "url": "http://192.168.1.3:59125/process",
            "voice": "ac-irina-hsmm"
        },
        "system": "marytts"
    },
    "wake": {
        "porcupine": {
            "keyword_path": "porcupine_linux.ppn",
            "sensitivity": "0.9",
            "udp_audio": "192.168.1.3:12333:mobile-app1"
        },
        "system": "porcupine"
    }
    }
    '''
    no result, I mean, as before it says it listens to the wake word, but no metter what, it does not wake...
  2. You have huge security leak in your app - no cridentials to connect to rhasspy server! Give you an example - anyone, who knows the ip of the rhasspy server and tcp port can install the app and connect directly to the HomeAssistant, and give it the comands rhasspy was trained for...

  3. The MQQT passes auto-setup, now it has the device-id, but when I turn it on - command recognition just stops - it stops doing anything.

razzo04 commented 3 years ago
  1. Docker by default applies isolation between the host network and the container network so you can't then bind the ip of the host machine instead you have to use the docker container ip or "0.0.0.0" which indicates that we listen for any interface. This is an example of a working configuration.
{
    "dialogue": {
        "system": "rhasspy"
    },
    "handle": {
        "system": "hass"
    },
    "intent": {
        "system": "fsticuffs"
    },
    "mqtt": {
        "enabled": true,
        "host": "host",
        "password": "pass",
        "site_id": "mobile-app3",
        "username": "user"
    },
    "speech_to_text": {
        "system": "kaldi"
    },
    "text_to_speech": {
        "system": "nanotts"
    },
    "wake": {
        "porcupine": {
            "keyword_path": "alexa_linux.ppn",
            "sensitivity": "0.99",
            "udp_audio": "0.0.0.0:12333:mobile-app3"
        },
        "system": "porcupine"
    }
}
  1. the app itself has no security issues because the rhasspy API does not require any password, so anyone who knows the ip and port can access the MQTT credentials without the need for the app.

  2. the configuration seems successful the only thing I notice is that instead of "enabled":true there is "enabled":""

gribouk commented 3 years ago

Hello, I have a brief question:

Do you have a sample piece of code to demonstrate have to send a message back to your APP with the text for TTS to read it from the phome? I am abit confused with the infop from the forums...

For example HA gets event from Rhasspy and sends back a respont to site_id: 'Ok'.

Thanks!

razzo04 commented 3 years ago

Hi, sorry for the late answer. Rhasspy is a very modular system and therefore there is no unique way to receive and send messages. Some people use Node-RED others instead use the home assistant intent. I use appdaemon to answer the events from rhasspy because I find myself more comfortable with python. For starting you could use home assistants intent even if the approach is not very flexible.