Commit Graph

372 Commits (b1082d4b27491b820ee37f8b493dee46596bd002)

Author SHA1 Message Date
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
Michael Nguyen 1302f26c32 fixed pep8 issues - added ability to encode png images to the MarkI faceplate 2017-06-07 18:08:29 -05:00
Michael Nguyen 5d40939666 Merge branch 'dev' of https://github.com/MycroftAI/mycroft-core into mouth_display_feature 2017-06-07 17:27:20 -05:00
Michael Nguyen 7df83897ba added function in api.py to encode png images and display to Mark I faceplate 2017-06-07 17:19:26 -05:00
penrods 84dd10e243 Fixing pep8 whitespace errors... grrr 2017-06-07 11:45:06 -05:00
penrods ffc3f6ec60 Implementing changes to out-of-the-box experience, providing an "onboarding" process.
* Added a mycroft.api.is_paired() method
* Added mycroft.util.is_speaking and mycroft.util.wait_while_speaking() methods
* RESET now waits for the spoken notice to complete
* Stopped the "Checking for updates" and "Skills updated" prompts (commented out for now, probably will eliminate)
* Wifi setup filters out hidden ("x00") networks
* Visemes should keep up better if they get behind (will skip)
* Mimic is now searched for on the users path
* Onboarding process:
  - wifi setup starts automatically
  - User is walked through the process
  - wake word and button pressing are ignored
  - At end, a short tutorial is given
2017-06-07 11:45:06 -05:00
Arron Atchison 7d1d2cefcf enclosure version bump to 0.3.1 2017-06-07 11:25:41 -05:00
Michael Nguyen 7e4ba487fa added display 2017-05-31 17:24:20 -05:00
kfezer 104dda1ab1 Merge pull request #774 from forslund/feature/update-config
Update TTS, STT and listener when websettings are changed
2017-05-30 16:45:42 -07:00
Åke Forslund ee90e8f50e Make wake word listener have length depending on number of phonemes 2017-05-26 07:50:49 +02:00
Arron Atchison 659d9a2bf3 removed "uppercase" from wifi setup dialog 2017-05-22 14:17:09 -05:00
aatchison 01730856aa changed wifi setup password to 12345678 2017-05-22 13:42:23 -05:00
Åke Forslund b31c7b6647 Add docstrings. 2017-05-22 19:12:00 +02:00
Åke Forslund 925cadc19e Add support for switching tts and settings
- If tts config hash has changed re-initialize tts
- Cache is cleared on mimic initialization
2017-05-20 21:43:53 +02:00
Åke Forslund 7da9f5a965 Add functionality to update listener/STT config
When a new configuration is discovered the producer and consumer is shutdown, the config is read and a new producer-consumer pair is launched.
2017-05-20 21:38:35 +02:00
penrods f9987c7c55 Converting last_internet_notification to a class instead of instance variable
I'm not 100% certain why this is needed, to be honest.  Maybe something I don't get about Python and threads?  This fixes double-announcements about connecting to the internet.
2017-05-18 16:53:10 -03:00
penrods b0559a50af User prompts to help the Mark 1 get connected to the internet didn't always occur
On the Mark 1 device, there is a sequence of events that produce a guide to the user for getting their device setup and connected to the internet.  This process is basically:
* Enclosure client starts up, sending a message to the Arduino
* When/if the Arduino responds, it checks for a live internet connection
* If no connection is found, the user is prompted
However the speech client was sometimes not fully up, so the request to speak the prompt was sent before it was listening.

Additionally, sometimes events would occur that caused the prompt to connect the unit multiple time in a row.  This commit limits the prompts to a max of once every 30 seconds.

Finally, I commented the code and renamed some of the methods to clarify this sequence of events.  The code:
   Timer(5, self.stop).start()
and:
   def stop(self):
        if not self.started:
            self.writer.stop()
Are some of the most confusing lines of code I've ever seen.  :)

Major changes:
* The messagebus message "enclosure.start" is now "enclosure.started"
* Enclosure.start() is now Enclosure.on_arduino_responded()
* Enclosure.started is now Enclosure.arduino_responded
* Added Enclosure.last_internet_notification to track notification times
* The notification call to the speech client is now delayed by 5 seconds, providing time for the speech client to come up.  (And an additional check is run to verify the connection is still down immediately before the verbal prompt is spoken)
2017-05-18 16:53:10 -03:00
penrods ce815bcfe2 Correcting spelling error
Fixed a typo:  "diferent" instead of "different"
2017-05-18 16:53:10 -03:00
penrods 83e4f9e58f Restoring initial check for network and spoken prompt
The restores the initial check on bootup for network connectivity,
prompting the user to plug in the network cable or push the button
to start Wifi setup.

NOTE: This will need to be localized and handled by different
enclosures.
2017-05-18 16:53:10 -03:00
kfezer@gmail.com 07aa2f5cde Changing how SSH is enabled.
Now using systemctl for both enabling and disabling\
	modified:   mycroft/client/wifisetup/main.py
2017-05-18 16:53:10 -03:00
Arron Atchison 62e7df5c18 Update main.py 2017-05-18 16:53:10 -03:00
Arron Atchison 7c05b51195 Update version.txt 2017-05-18 16:53:10 -03:00
kfezer@gmail.com 7bde4a78d0 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-05-18 16:53:10 -03:00
penrods 8bd9885ba4 Minor code restructure to simplify _record_phrase()
Basically just moved the signal-related code into a helper method.
2017-05-18 16:53:10 -03:00
penrods ee13925861 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-05-18 16:53:10 -03:00
penrods 1b200089c0 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-05-18 16:53:10 -03:00
penrods 317b497d5f 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-05-18 16:53:10 -03:00
Augusto Monteiro 'Sparky 0245fbe5d2 Fixing demo mode, sending two events on message bus 2017-05-18 16:53:10 -03:00
kfezer@gmail.com 570687d04a increases boot delay on reboot after ssh and reset
modified:   mycroft/client/enclosure/__init__.py
2017-05-18 16:53:10 -03:00
Arron Atchison 95a235dd6e bump enclosure version to 0.1.22 2017-05-18 16:53:10 -03:00
Augusto Monteiro 'Sparky 8232772ee6 Adding demo mode
* Sending an event to messagebus when demo button is pressed
2017-05-18 16:53:10 -03:00
kfezer@gmail.com 18e5127cf9 Fixes error with wpa_supplicant string
modified:   mycroft/client/wifisetup/main.py
2017-05-18 16:53:10 -03:00
Steve Penrod c44d386a35 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-05-18 16:53:10 -03:00
kfezer@gmail.com 8b6be6e26b modified: mycroft/client/wifisetup/main.py 2017-05-18 16:53:10 -03:00
kfezer@gmail.com 07ec6bd422 modified: mycroft/client/enclosure/__init__.py 2017-05-18 16:53:10 -03:00
kfezer@gmail.com 6f31c93fc0 modified: mycroft/client/wifisetup/main.py 2017-05-18 16:53:10 -03:00
kfezer@gmail.com ea6e3c2539 modified: mycroft/client/wifisetup/main.py 2017-05-18 16:53:10 -03:00
kfezer@gmail.com 8669599461 modified: mycroft/client/enclosure/__init__.py
modified:   mycroft/client/wifisetup/main.py
2017-05-18 16:53:10 -03:00
kfezer@gmail.com 5f70f5117c modified: mycroft/client/wifisetup/main.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com 85c6cb6a72 modified: mycroft/client/wifisetup/main.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com 8935259889 modified: mycroft/client/wifisetup/main.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com 0b8e033d1c modified: mycroft/client/enclosure/__init__.py
modified:   mycroft/client/wifisetup/main.py
2017-05-18 16:51:54 -03:00
kfezer@gmail.com 3830d619d8 modified: mycroft/client/wifisetup/main.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com ed249471f8 modified: mycroft/client/enclosure/__init__.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com bb756882d3 modified: mycroft/client/wifisetup/main.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com 46286b4cc2 modified: mycroft/client/enclosure/__init__.py
modified:   mycroft/client/wifisetup/main.py
2017-05-18 16:51:54 -03:00
kfezer@gmail.com f02470d6a0 modified: mycroft/client/enclosure/__init__.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com 353999b2a9 modified: mycroft/client/enclosure/__init__.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com d8565bb429 modified: mycroft/client/enclosure/__init__.py 2017-05-18 16:51:54 -03:00
kfezer@gmail.com 554fc09bc8 Adding SSH enable option
modified:   client/enclosure/__init__.py
2017-05-18 16:51:53 -03:00
kfezer 0c521107ab Update __init__.py
Adds delay to the wifi reset
2017-05-18 16:51:17 -03:00
kfezer@gmail.com 5731054eab modified: mycroft/client/wifisetup/main.py 2017-05-18 16:51:17 -03:00
kfezer@gmail.com 68f8bc262c deleted: mycroft/client/wifisetup/wpa_supplicant.conf.master 2017-05-18 16:51:17 -03:00
kfezer@gmail.com 65b1810b40 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-05-18 16:51:17 -03:00
Åke Forslund 0c9f3ebefb Stop multi-sentence speech 2017-05-18 16:51:17 -03:00
Art McGee f5ec8b74a3 Changes to record mycroft wake word when configured to do so. (#538)
NOTE: this doesn't check for disk space and doesn't clean up
file stored in /tmp/ called mycroft_wake_sucess<time>.wav

TODO: some cleanup should be considered.

Signed-off-by: Art McGee <amcgee7@jaguarlandrover.com>
2017-05-18 16:49:07 -03:00
Åke Forslund aa0756a3f3 Enforce float as threshold value to pocked sphinx 2017-05-18 16:49:07 -03:00
kfezer@gmail.com d68b1dddb3 Changing how SSH is enabled.
Now using systemctl for both enabling and disabling\
	modified:   mycroft/client/wifisetup/main.py
2017-05-08 19:32:56 -07:00
Arron Atchison fb912215af Update main.py 2017-05-08 19:07:24 -07:00
kfezer c7af7cfc70 Merge pull request #744 from MycroftAI/feature/ssh-disable
Support for Mark 1 SSH > BLOCK menu item
2017-05-08 17:21:48 -07:00
Arron Atchison 3c42443e04 Update version.txt 2017-05-08 16:34:16 -07:00
kfezer@gmail.com d77709e1f9 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-05-08 16:30:51 -07:00
penrods 6428063531 Minor code restructure to simplify _record_phrase()
Basically just moved the signal-related code into a helper method.
2017-05-08 15:44:36 -07:00
penrods 6399644032 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-05-08 15:44:36 -07:00
penrods 771d773931 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-05-08 13:37:18 -07:00
penrods 497de370a2 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-05-07 19:53:24 -07:00
kfezer 27c9a03a52 Merge pull request #733 from MycroftAI/hotfix/fix-demo-mode
Fixing demo mode, sending two events on message bus
2017-05-05 16:20:37 -07:00
Augusto Monteiro 'Sparky e77082baf7 Fixing demo mode, sending two events on message bus 2017-05-05 16:12:11 -07:00
kfezer@gmail.com 083ac3fb6b increases boot delay on reboot after ssh and reset
modified:   mycroft/client/enclosure/__init__.py
2017-05-05 13:25:00 -07:00