alexylem / jarvis

Jarvis.sh is a simple configurable multi-lang assistant.
http://openjarvis.com
MIT License
810 stars 197 forks source link

Url or api for just after hotword detection. #321

Closed JZacharie closed 7 years ago

JZacharie commented 7 years ago

I d like to use a dash button to simulate the hotword detection. Is it possible to run a specifique http commande to start the after hotword process ?

alexylem commented 7 years ago

There is a flag on Jarvis to do just that:

$> ./jarvis.sh -h
    Usage: jarvis.sh [-bc:ihklnp:s:ux:z]
[...]
    -l  directly listen for one command (ex: launch from physical button)
[...]

So your button should run the following shell command:

$> path/to/jarvis.sh -l
You: #listens for a command

Is it ok or do you really need to trigger it from the network?

JZacharie commented 7 years ago

When I run ssh pi@mypi /home/pi/jarvis/jarvis.sh -l if he understand the command no problems. but if it didn't understand 3 times Jarvis stay active and I can't restart a hotwork.

image

For me a API should be better.

alexylem commented 7 years ago

Indeed I just tested, if Jarvis is launched with -l flag, after 3 failed recognitions, it goes back to hotword detection mode instead of exiting. I'll fix that first before evaluating if API could be used to do this.

alexylem commented 7 years ago

@JZacharie fixed, please update and retest.

JZacharie commented 7 years ago

I just have tested. With remote ssh the audio go thru my pulse audio : The input stay on my Jarvis box mic. but the output try to go to my remote ssh shell box . If I use the rest/API to start the after hotword detection, it will bypass the audio mecanism. I'll try implement it. I've got a plan B by using the call by another way but it don't want complicate the architecture of my project. Regards

alexylem commented 7 years ago

So @JZacharie you need to trigger the same as ./jarvis.sh -l from the API right? I can do this if you really need it.

JZacharie commented 7 years ago

For me it will be very helpfull if all commands could be run from REST/API. (Like execute and say.)

But if you implement it. Could you enable it for all commande line possibility : [-bc:ihjklmnp:qs:uvwx:z]

And is it possible to provide the only need data from the APi repond ? Not all DATA as the console do.

alexylem commented 7 years ago

Actually it's not that simple because you can't launch multiple sessions of Jarvis in parallel (concurrent use of mic / speakers). For execute & say, it's not a problem as Jarvis exists at the end. For -l (directly listen for acommand) it should be ok too, as it will exit at the end. However, for other commands that just "start Jarvis", you will run into problems.

If your project is to use a Dash button and trigger via RestAPI the hotword recognition (directly listen for a command), the -l flag on the API could be just what you need. What do you think?

alexylem commented 7 years ago

Any update on this?

wikijm commented 7 years ago

No answer of the issue creator since 10 Jan 2017 => Issue closed. Don't hesitate to reopen the issue if there is some evolution.