Commit Graph

440 Commits (35d057ff9b448600ee951a8a0a5d9a3bf93ac7ff)

Author SHA1 Message Date
Åke Forslund 444a09587e Fix hotword override
==== Tech Notes ====
The threshold of the hotword was overritten with None since no default
threshold is in the default configuration
2017-09-15 06:29:25 -05:00
Matthew D. Scholefield af8826a1c7 Learning option for sharing wake word recordings (#1039)
* Add automatic uploading of wake words and learning option in enclosure client

* Spawn new thread and remove ping
Spawning a new thread eliminates the need to ping and eliminates additional latency. In addition, the return code of scp is now used to determine whether to delete the wake word

* Increment enclosure version number
2017-09-14 23:58:32 -05:00
Jarbas e39d013282 Hotword factory (#1062)
* Create hotword_factory.py

* hotword factory

* hotword factory

* hotword factory

* pass language

* HotwordEngine base class

* standup_word config

* missing ,

* hotword factory

* missing ,

* HotWordEngine template

* hotword factory

* pep8

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* fix unittest

* fix conflicts

* recognizer dir fix

* fix path

* fix path

* correct path

* fix path for realz

* fix path for real realz

* path fixed, end of brain fart

* fix phoneme lenght

* compatibility

* num phonemes for non pocketsphinx modules

* pep8

* bug fix

* bug hunt
2017-09-14 23:34:16 -05:00
Steve Penrod db72dde378 Fix another Codacy warning 2017-09-14 16:51:16 -05:00
Steve Penrod a268b2e0ee Fix Codacy warnings
Fixes a few minor things triggering Codacy warnings.
2017-09-14 16:51:16 -05:00
Steve Penrod 92b8b59cde CLI: Add find command and chat history sizing
This extends the Command Line Interpreter with two new features:
* Add command
    :find 'string'
  Only show log lines that match the given string, including
  newly incoming log lines.  Hit Ctrl+X to end the search.
  Ctrl+F works as a shortcut.
* Add command
    :history #
  Change the change history height to # lines.  This setting
  stays across sessions.
2017-09-14 16:51:16 -05:00
Åke Forslund 326939df35 Make muted mic stay muted when stt is restarted
====  Tech Notes ====
- Number of callers is now handled in the recognizer loop to make sure
status isn't lost when new settings is applied.
- Adds a force_unmute method to make sure the device is completely
unmuted when the user presses the top button.
2017-09-14 16:50:43 -05:00
Åke Forslund a33c07621b Reduce configuration loading in module scope
====  Tech Notes ====
Autoloading configuration in submodules is bad for testing purposes and
should be reduced. It takes time and adds the possibility of altering
the base conditions for the tests

- mycroft/skills/core: global configuration moved to main.py
- mycroft/messagebus/client/ws.py global config moved to __init__ of
Websocket
- client/speech/mic.py global config moved to ResponsiveRecognizer
__init__() method
- client/enclosure/display_manager.py
 - get_ipc_directory() called in methods where used
2017-09-13 12:51:48 -05:00
Åke Forslund 64baa7d420 Enclosure mutes the mic and should unmute it
====  Tech Notes ====
Listens for 'mycroft.paired' and will unmute the mic when this occurs.
This was handled by the pairing skill but for clarity it should be
unmuted at the same place.
2017-09-13 12:02:27 -05:00
Åke Forslund e9f8d85040 Make mic mute counting instead of boolean
====  Tech Notes ====
Mute was previously a simple boolean meaning that if two parts of the
code wanted to mute it it would unmute the mic as soon as the first of
the two pieces of code wanted to unmute.

For example tts output will mute the mic and unmute it when the audio
output is complete. During first start up of a mark-1 the enclosure
mutes the mic and expects it to be muted until the pairing is complete.
This doesn't work. The mic get's unmuted as soon as the first sentence
has been spoken.

This counts the number of times mute is called and will not unmute until
as many unmute calls has been made.
2017-09-13 12:02:27 -05:00
esoleyman c8c5afdeaf Change instance of ConfigurationManager().get to ConfigurationManager.get 2017-09-13 10:41:02 -05:00
Brian Hopkins c2aa2ebb97 fixing typo (#1052)
* fixing typo

fixing color function
2017-09-04 00:49:08 +02:00
jarbasai b6e89f02b0 pep8 2017-09-01 12:28:37 -05:00
Jarbas c05590bc7c save utterances 2017-09-01 12:28:37 -05:00
Michael Nguyen 2dab08f483 Merge pull request #1035 from forslund/bugfix/localization
Bugfix/localization
2017-08-31 15:58:02 -05:00
Steve Penrod ae2583662f Correcting CLI handling of main() for issue #1036
The idiom for handling main() was incorrect to allow the CLI
to be invoked by the mycroft-cli-clent script.

==== Fixed Issues ====
2017-08-30 22:45:16 -05:00
Steve Penrod f9702157a6 Minor CLI fixes and enhancements
Several changes to CLI behavior, all minor:
* Inverted the behavior or PgUp/PgDn.  I think it was just wrong
* Added "oldest" and "newest" indicators to the log listing to
  simplify finding your way inside the logs
* Added support for _not_ scrolling when in the middle of the log
  output.  It will now only auto-scroll when already at the front
  of the log so you keep seeing new messages automatically.
* Added a heading for the mic output level
* Limited the mic output level to just the size of the bottom
  area (previously it was proportional to the screen height)
* FIX: Changed the default filter string for viseme
* FIX: The saving of settings was broken
* Ran autopep8 which added a few bits of whitespace here and there
2017-08-30 22:45:16 -05:00
Åke Forslund 9a6d282435 Warn when pocket sphinx model file is missing
====  Tech Notes ====
When a pocket sphinx model is missing an error is logged and the default
(us english) model is tried.
2017-08-31 00:19:00 +02:00
reginaneon c96d0a3d5b Bug Fix
Bug fix proposed for success wake-word recording. 
Opt: Suggestion to change the save location of recording files as well. 
Otherwise, the user could potentially get the permission denial. 
-NeonGecko.com Inc
2017-08-08 15:38:58 -07:00
Åke ab22106659 Merge pull request #938 from MycroftAI/feature/fallbacks
Add intent fallback system

==== Fixed Issues ====
NONE - replace with issue numbers, e.g. #123, #304

====  Tech Notes ==== 
NONE - explain new algorithms in detail, tool changes, etc.

====  Documentation Notes ==== 
The FallbackSkill needs to be documented in detail for skill creators.


==== Environment Notes ==== 
NONE

==== Protocol Notes ====
multi_utterance_intent_failure replaced with complete_intent_failure
2017-08-08 21:00:51 +02:00
Michael Nguyen 4ae511812c Merge pull request #962 from MycroftAI/feature/display_state_manager
Feature/display state manager
2017-08-03 14:21:40 -05:00
Matthew D. Scholefield 4afe6687c4 Fix intent failed messages before running fallbacks 2017-08-03 13:49:02 -05:00
Matthew D. Scholefield a86f0478a4 Add intent fallback system
Also removes multi utterence intent fail. Only makes sense to emit an intent_failure regardless of the amount of intents
2017-08-03 13:49:02 -05:00
Michael Nguyen ee3391db29 pep8.. 2017-08-03 13:04:12 -05:00
Michael Nguyen 4355dad333 moved init disp websocket to enclosure 2017-08-03 13:01:11 -05:00
Åke Forslund a0ac65ac35 Fix rebase issues introduced with audio subsystem
util/signal.py add missing import time
move tts thread shutdown/clear to audio/speech.py
2017-08-02 16:53:48 -05:00
Michael Nguyen 58288b4c11 fixed permissions bug 2017-08-02 12:46:05 -05:00
Michael Nguyen c1041b9902 fixed permissions bug 2017-08-02 12:34:04 -05:00
Åke Forslund 3aee40274a Fix pep8 issue introduced during rebase. 2017-07-31 13:37:18 +02:00
Åke Forslund 769b4f900e Move text to speech to audio service 2017-07-31 13:37:17 +02:00
Arron Atchison 2a595931ba bump enclosure version to 1.0.0 2017-07-24 17:16:32 -05:00
Steve Penrod e8e0853825 Merge pull request #838 from MycroftAI/feature/display_state_manager
Feature/display state manager
2017-07-21 19:58:07 -05:00
Åke Forslund f843e758d3 Make expect respones trigger when mycroft stops speaking 2017-07-19 11:36:03 -05:00
Matthew D. Scholefield 90aff68034 Reverting "Add intent fallback system (#899)"
This is because this will break wolfra alpha skill unless they update
skills, but if they update before getting the new version, it will also
break wolfram

This reverts commit 6ca4161335.
2017-07-14 17:53:42 -05:00
Matthew D. Scholefield 6ca4161335 Add intent fallback system (#899)
* Create new FallbackSkill base class for implementing fallback behavior
Also removes multi utterance intent fail. Only makes sense to emit an intent_failure regardless of the amount of intents
2017-07-14 17:27:26 -05:00
penrods e307df2bb4 Duplicate service hack #2... performing check in the Enclosure client after a
60 second delay.  The packaging system was preventing the previous approach
from rebooting.
2017-07-10 23:22:29 -05:00
penrods 8cbc73e98c Added same kind of hack for mycroft-speech-client 2017-07-10 22:12:59 -05:00
Sujan Patel 668eefe74f Issue-895 - Adding uppercase support to wake words 2017-07-08 11:35:58 -04:00
Matthew D. Scholefield 0a09e6b91e Move audio output start and end messages to TTS class
This prevents them from being outputted too early if playback is run on another thread
2017-07-06 20:18:59 -05:00
Michael Nguyen f62a771e28 merge changes 2017-07-06 16:59:26 -05:00
Michael Nguyen 25a457083d fixed function names 2017-07-06 16:58:24 -05:00
Åke 7bab1d1e21 Merge pull request #804 from forslund/feature/issue-803
TTS playback thread
2017-07-06 12:15:48 +02:00
Åke Forslund 3be91fb84c Allow "Stop" to clear playback queue 2017-07-06 09:41:22 +02:00
Åke Forslund e528fa0bd3 Stop tts playback thread when needed
When
- Updating tts config
- KeyboardInterrupt
2017-07-06 09:39:28 +02:00
Matthew D. Scholefield a33cc35b39 Fully fix wake up functionality 2017-07-05 17:37:26 -05:00
Matthew D. Scholefield e11bb52853 Fix wake up 2017-07-05 17:11:26 -05:00
Matthew D. Scholefield c2b2134a12 Make Wake Word detection modular (#876)
This separates Pocketsphinx into its own class allowing other wake word recognizes to be switched in easier.
2017-07-05 14:26:34 -05:00
Steve Penrod 96c08189ed Revert "This add comments to document the message class" 2017-06-30 00:41:20 +02:00
penrods 0eee71d90f Fixed the allow_timeout (used in out-of-the-box); and a wifi setup disconnect tweak
* The allow_timeout value was tested poorly, preventing it from actually doing anything
* Upped the number of arp/ping test failures from 3 to 6 when validating the connection.  This makes falsely detecting a wifi setup disconnect pretty unlikely.
2017-06-29 17:10:14 -05:00
Art McGee 355225ee3d Merge branch 'dev' into amcgee7_docs 2017-06-29 07:17:19 -07:00
Art McGee 8323f193f0 Merge branch 'amcgee7_docs' of https://github.com/amcgee7/mycroft-core into amcgee7_docs 2017-06-26 13:55:27 -07:00
kfezer@gmail.com 12ebabb70f Changing how SSH is enabled.
Now using systemctl for both enabling and disabling\
	modified:   mycroft/client/wifisetup/main.py
2017-06-26 13:52:52 -07:00
Arron Atchison cf14c64f5a Update main.py 2017-06-26 13:52:52 -07:00
Arron Atchison 9d36ad5d20 Update version.txt 2017-06-26 13:52:52 -07:00
kfezer@gmail.com 517034bd73 Added command line calls to enable/ disable ssh
Fixed issue where ssh.enable was emitting wrong message
	Tested mycroft.dialog.get
	modified:   mycroft/client/enclosure/__init__.py
	modified:   mycroft/client/wifisetup/main.py
2017-06-26 13:52:52 -07:00
penrods 7b1cfbca1f Minor code restructure to simplify _record_phrase()
Basically just moved the signal-related code into a helper method.
2017-06-26 13:52:52 -07:00
penrods bd4e3836d3 Improved handling of button press
Improved the way the button press is handled.  Now the listener gives the rest
of the system a moment to consume the button press before it interprets it
as a request to begin listening.

Also replaced the use of the "buttonPress" signal when "expect_response"
was indicated with an utterance.  Now the signal "startListening" is
created, differentiating it from a buttonPress.
2017-06-26 13:52:52 -07:00
penrods 8bd28e11ce Support for Mark 1 SSH > BLOCK menu item
This implements the handler for the Mark 1 menu item SSH > BLOCK (the inverse of SSH > ALLOW)
* Added handler for "unit.disable-ssh" on the serial line. This turns around and emits "mycroft.disable.ssh" on the messagebus.
* Removed the automatic reboot, just let the user know it will be different after a restart
* Made the spoken message translatable
* Changed mycroft.dialog.get() to not require the "lang" parameter.  It will default to the mycroft.conf value.
2017-06-26 13:52:52 -07:00
penrods fa32ff303a Restore the drawing of icons when showing weather.py
This implements the image drawing functionality of the lastest Mark 1 enclosure instead of the old numeric weather icon codes.
2017-06-26 13:52:52 -07:00
Augusto Monteiro 'Sparky 55780dbc4a Fixing demo mode, sending two events on message bus 2017-06-26 13:52:52 -07:00
kfezer@gmail.com c851461c4e increases boot delay on reboot after ssh and reset
modified:   mycroft/client/enclosure/__init__.py
2017-06-26 13:52:52 -07:00
Arron Atchison 0cdfaf3ae7 bump enclosure version to 0.1.22 2017-06-26 13:52:52 -07:00
Augusto Monteiro 'Sparky bd93b1f2dc Adding demo mode
* Sending an event to messagebus when demo button is pressed
2017-06-26 13:52:52 -07:00
kfezer@gmail.com 551b4d4da3 Fixes error with wpa_supplicant string
modified:   mycroft/client/wifisetup/main.py
2017-06-26 13:52:52 -07:00
Steve Penrod faa3070f3c Adding localization mechanism for strings embedded in mycroft-core code (#717)
* Adding localization mechanism for strings embedded in mycroft-core code

Added mycroft.dialog.get() function.  This behaves much like the localization
mechanism for dialogs in Skills.  So you can do things like this:

   lang = "en-us"
   str = mycroft.dialog.get("how are you", lang)

Which will look in mycroft/res/text for the dialog file containing strings to
use as templates for the actual output.  This depends on the language being
currently used.  When operating in English this would be:

   mycroft/res/text/en-us/how are you.dialog

This function will pick a random line from that file to assign to str.

A more advanced use is to embed placeholders in the strings within the
template file.

   lang = "en-us"
   ctx = {"time" : "noon"}
   str = mycroft.dialog.get("current time", lang, ctx)

And the random template line picked was "the current time is {{time}} ", then
the output would be:

   "the current time is noon"
2017-06-26 13:52:52 -07:00
kfezer@gmail.com 0a358faf79 modified: mycroft/client/wifisetup/main.py 2017-06-26 13:52:52 -07:00
kfezer@gmail.com 1cc2964999 modified: mycroft/client/enclosure/__init__.py 2017-06-26 13:52:52 -07:00
kfezer@gmail.com bc94caab84 modified: mycroft/client/wifisetup/main.py 2017-06-26 13:52:52 -07:00
kfezer@gmail.com cd75da2b5b modified: mycroft/client/wifisetup/main.py 2017-06-26 13:52:52 -07:00
kfezer@gmail.com b5ec28ed27 modified: mycroft/client/enclosure/__init__.py
modified:   mycroft/client/wifisetup/main.py
2017-06-26 13:52:52 -07:00
kfezer@gmail.com 579ddef45a modified: mycroft/client/wifisetup/main.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com 93b7b84642 modified: mycroft/client/wifisetup/main.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com c6302cfe1f modified: mycroft/client/wifisetup/main.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com 227d9c6772 modified: mycroft/client/enclosure/__init__.py
modified:   mycroft/client/wifisetup/main.py
2017-06-26 13:50:06 -07:00
kfezer@gmail.com 19529472d7 modified: mycroft/client/wifisetup/main.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com 96caff8d32 modified: mycroft/client/enclosure/__init__.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com fa404d8ada modified: mycroft/client/wifisetup/main.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com 73f6442b8d modified: mycroft/client/enclosure/__init__.py
modified:   mycroft/client/wifisetup/main.py
2017-06-26 13:50:06 -07:00
kfezer@gmail.com b3a5990c08 modified: mycroft/client/enclosure/__init__.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com 52dc611aea modified: mycroft/client/enclosure/__init__.py 2017-06-26 13:50:06 -07:00
kfezer@gmail.com 176c8ffdb9 modified: mycroft/client/enclosure/__init__.py 2017-06-26 13:50:06 -07:00
kfezer 900d12138a Update __init__.py
Adds delay to the wifi reset
2017-06-26 13:48:09 -07:00
kfezer@gmail.com ec47a9de34 modified: mycroft/client/wifisetup/main.py 2017-06-26 13:48:09 -07:00
kfezer@gmail.com 05e42938e9 deleted: mycroft/client/wifisetup/wpa_supplicant.conf.master 2017-06-26 13:48:09 -07:00
kfezer@gmail.com 7b9ec9c326 modified: mycroft/client/enclosure/__init__.py
modified:   mycroft/client/speech/mic.py
	modified:   mycroft/client/wifisetup/main.py
	new file:   mycroft/client/wifisetup/wpa_supplicant.conf.master
2017-06-26 13:48:09 -07:00
Åke Forslund 856d3b3dff Stop multi-sentence speech 2017-06-26 13:48:09 -07:00
Åke Forslund 72dcc233d1 Enforce float as threshold value to pocked sphinx 2017-06-26 13:45:23 -07:00
Michael Nguyen eeda583576 rename functions, delete extra code comment 2017-06-21 13:19:00 -05:00
Matthew D. Scholefield fc3ede120c Fix cli bugs
- Add keycode 127 as backspace
 - Run tts in another thread to suppress output
2017-06-20 13:37:51 -05:00
Michael Nguyen 09cd00a31b darn pep8 2017-06-16 16:14:16 -05:00
Michael Nguyen 3ce86ebba4 fixed bugs in display manager 2017-06-16 15:54:55 -05:00
Michael Nguyen a2853e2288 fixed merge conflict 2017-06-16 13:34:40 -05:00
Michael Nguyen c0b603ab51 state manager implemented 2017-06-16 13:31:44 -05:00
Ethan Ward c9893806ea #824 Change has_been_paired to load the current identity file (#825)
* Change has_been_paired to load the current identity file

* Add clarifying comment and fix pep8
2017-06-13 17:32:14 -05:00
Åke Forslund b38af90fac fix pep8 2017-06-13 14:17:21 +02:00
penrods 582b77891e One more pass at onboarding, including a major bug fix:
* BUGFIX: The big bug was calling is_paired() during wake_word_in_audio().  When not paired, that call hit the server, taking about a second.  Since it happened multiple times a second, the audio buffers got backed up hugely.  This resulted in weird behavior later as the buffers get cleared out.
* Added mycroft.api.has_been_paired(), which just looks for the pairing key (it does not validate it is still active with the server, like is_paired())
* The enclosure now checks for internet connectivity and kicks off the wifisetup process, not the wifisetup client itself.
* During the "onboarding" process, the microphone is muted using the new "mycroft.mic.mute" message.  After pairing completes, the "mycroft.mic.unmute" is expected to be sent from the pairing skill.  Unmuting again after a re-pairing is harmless.
* mute_and_speak() is smart enough to not unmute itself when complete if muted before
* util.check_for_signal() now accepts -1 as the lifetime.  This means it never times out.
* util.stop_speaking() is more intelligent about shutting down the spoken text (including text that has been split at periods) and visemes
2017-06-13 05:35:06 -05:00
penrods 32e32ed185 Minor onboarding refinements
* The wifi setup no longer stops after 5 minutes unless already paired (i.e. still onboarding)
* The mouth resets on wifisetup stop (clearing the scrolling home.mycroft.ai)
* Changed several ConfigurationManager.get() calls to ConfigurationManager.instance().  Exactly the same, but .instance() is clearer/preferred.
* Added a mycroft.util.stop_speaking() method.  Not perfect, but works for now and can be replaced later when AudioManager is in place.

A forthcoming change to the pairing skill will utilize the stop_speaking method.
2017-06-12 02:57:22 -05:00
Michael Nguyen a6917c7712 added info to docstring information 2017-06-08 14:35:31 -05:00
Michael Nguyen 6fc9e034f7 extracted encode png function into mouth_display_png function for a cleaner interface 2017-06-08 12:39:42 -05:00
Michael Nguyen 17d0c418c6 syntax issues 2017-06-07 18:25:43 -05:00