Commit Graph

460 Commits (02eb1b8277d06c61a2448a6a9e2767f7cb1cc54a)

Author SHA1 Message Date
Matthew D. Scholefield 856fed036b Restore captured text on cli exceptions 2018-01-19 16:46:51 -06:00
penrods 26444c9c5f Tweak UI for NTP checking
Withe the NTP checks in place, the sequence of visual and audio queues
was a little clunky.  This refines it slightly for normal use and to
play better with the pairing process.
2018-01-18 14:44:53 -06:00
Steve Penrod 4a62ab5a40 Implement max-line to limit memory usage (#1369)
* Implement max-line to limit memory usage

The major point of the PR is to limit the memory usage of the CLI by
implementing a maximum log limit.  It defaults to 5000.

Other changes:
* Add "--debug" option to support troubleshooting/debugging the CLI itself
* Add support for jumping to the top (Ctrl+T/Ctrl+PgUp) or bottom (Ctrl+B/Ctrl+PgDn) of the logs.
* Remove the "OLDEST" message from the log.  It was really no longer necessary since the log navigation issues got straightened out, and it complicated the max log line logic.
2018-01-18 09:44:29 +01:00
penrods 6c1cdb47b3 Fix startup time-warp issue
Raspberry Pi's don't have a built-in clock, so at boot-up the clock just picks up from when they were last running.  Normally this is corrected very quickly by NTP from an internet server, but if there is no network connection that cannot happen.

When an out-of-the-box Mark 1 or Picroft is being setup, the clock is set to whenever the image was created.  Upon completing the Wifi setup step the NTP service can finally sync with the internet, so time suddenly "jumps" to weeks later -- usually.  In either case (when the date jumps or when the date is erronously months old), there is potential for havoc.

These changes deal with that situation.  Upon network connection, an NTP synchonization is forced.  If it is detected that a major time jump happened
(more than 1 hour), then the user is notified that the clock change requires
a reboot and the system restarts.

Other changes:
* use the new "system." message namespace
* add pause before the system.reboot during a WIPE, allowing reset to totally complete
*
2018-01-17 21:05:51 -06:00
Åke Forslund c2a5288407 Update for latest changes 2018-01-08 18:04:07 -06:00
Åke Forslund a701e782e0 Replace open with more modern io.open
io.open is the default open in python 3 and sets encoding to unicode by
default.
2018-01-08 18:04:07 -06:00
Åke Forslund 6550b9c115 Attempt to allow CLI to display utf-8 encoded text. 2018-01-08 18:04:07 -06:00
Åke Forslund 4ac720ec53 Report None type as transcription when STT fails 2018-01-08 18:01:03 -06:00
Åke Forslund 936bd54180 Add a function to build the standard timing report 2018-01-08 18:01:03 -06:00
Åke Forslund baa15b98aa Send timing metrics for various subsystems
====  Tech Notes ====
STT, intent handling, intent fallbacks, skill handlers are now timed and
tied together with a ident (consistent through the chain so the flow from
STT until completion of the skill handler can be follewed.

TTS execution time is also measured, right now this is not tied into the
ident due to the nature of the speech.

The report is always called "timing" and always contain the following
fields:

- id: Identifier grouping the metrics into interactions
- system: Which part (STT, intent service, skill handler, etc)
- start_time: timestamp for when the action started
- time: how long it took to execute the action

The different system adds their own specific information, for example
the intent_service adds the intent_type, i.e. which handler was matched.

==== Protocol Notes ====
mycroft.skills.loaded is sent togheter with skill id and skill name
whenever a skill is loaded. This is used in the intent_service to
convert from id to skill name when reporting
2018-01-08 18:01:03 -06:00
Matthew D. Scholefield 716032215d Add model hash to wake word upload 2018-01-03 20:29:27 -06:00
penrods 5832cfafde Bump the required enclosure version to 1.3.0. This pulls in
the changes needed for upload.sh to not lock-up on a Picroft
installation of mycroft-core.
2017-12-22 12:32:40 -06:00
penrods 54bdf0d392 Add pause in out-of-box speech
The out-of-box spiel given by Mycroft was coming at the user pretty fast.
This adds a momentary pause in the spoken text.

Also cleaned up some ugly messagebus interaction to use the speak() method.
2017-12-22 01:48:45 -06:00
Åke 742558046d Python 2/3 compatibility (#1259)
Add Python 2/3 compatibility

====  Tech Notes ====
This allows the main bus, skills and cli to be run in both python 2.7 and
3.5+.

Mainly trivial changes
- syntax for exceptions
- logic for importing correct Queue module
- .iteritems -> future.utils.iteritems when accessing dicts key value
pairs

* Allow audio service to be run in python 3
* Make speech client work with python 3
* Importing of Queue version dependent
* Exception syntax corrected
* Creating sound buffer is version dependant
- Adapt context use range from builtins
- Use compatible next() instead of .next() when walking the skill
directory

* Make CLI Python 3 Compatible
- Use compatible BytesIO instead of StringsIO
- Open files as text instead of binary
- Make sure integer divisions are used

* Make messagebus send compatible
* Fix failing travis

Re-add future 0.16.0

* Make string checks compatible
* basestring doesn't exist in python 3 so it's imported from the "past"
* Fix latest compatibility issues in speech client
- handle urllib
- handle encoding before calling md5

* Make Api.build_json() python 2/3 compatible
2017-12-18 17:24:21 -06:00
penrods fb9f6bb5f6 CLI: interpretation of VT100 keys was flipped
The mapping from a VT100 key to NCURSES PgUp/PgDn was inverted,
resulting in different behavior for a keyboard and monitor plugged
in to the Pi than when SSH'ed in to the unit.
2017-12-15 01:41:03 -06:00
Åke f61ccfeed7
Merge pull request #1308 from MycroftAI/feature/boot-sequence
Add boot sequence visual indicators
2017-12-13 19:47:25 +01:00
penrods e3988e6cdc Add boot sequence visual indicators
Creating several visual feedback points to let users know what is
occurring in the boot sequence.  This also expects a new version
of the enclosure.

* On shutdown and reset, change eye color to a dark gray
* On initial startup the enclosure will have left the eyes at a
  yellow color, indicating that it is on but not fully running yet.
  When the enclosure comes up (and doesn't kick off the out-of-box
  or the notice that they need to run wifi setup) it will begin to
  scroll an "UPDATING" message.

This assumes that someone else will remove the "UPDATING" message.
That gets handled by the Mycroft-Mark-1 skill, which resets the
mouth and sets the eye color to default.
2017-12-13 12:23:42 -06:00
jarbasai 5c367e079a fix _hack_check_for_duplicates 2017-12-12 04:00:01 +00:00
Steve Penrod b56159f7d7 Fix pep8 issue 2017-12-10 06:09:18 -05:00
Steve Penrod d0e7c10800 Add CLI log clearing and other tweaks
Several more tweaks for the CLI:
* Ctrl+Left and Ctrl+Right are now available to cycle through previous
  entries, just like Ctrl+P and Ctrl+N
* Added ":clear log" command
2017-12-10 04:41:47 -05:00
Matthew D. Scholefield 35d057ff9b Add get_response method as a synchronous alternative to converse 2017-12-07 16:11:35 -06:00
Åke 18adeaac96
Merge pull request #1284 from MycroftAI/feature/cli-scrolling-etc
Tweaks for Command Line Interface (CLI)
2017-12-07 20:18:13 +01:00
Åke Forslund 15821fad25 Add lang as parameter to EnclosureReader 2017-12-07 10:25:51 -06:00
penrods 90d37498f0 PgUp/PgDn correction
The functionality of the PgUp and PgDn buttons was inverted in previous
commit.

Also added support for a ":keycode show" to assist in debugging things like
this, plus dropped support the "555" and "500" support which aren't obvious
why they were implemented in the first place.  If users encounter problems
under different terminal emulators or whatever, we can use ":keycode show"
to track it down.

Finally, made the inital refresh occur in 1s to clean up any screen
corruption created by messages put out from import of packages at startup.
2017-12-06 14:52:31 -06:00
penrods e5c91a55d1 Tweaks for Command Line Interface (CLI)
Several minor changes to the CLI:
* Placed lock on screen refresh from a new log message
* Slowed frequency of mic updates to limit opportunity for screen corruption.
  Still happening occasionally, which is vexing.
* Up/Down arrow now scroll logs by a single line
* Ctrl+P/Ctrl+N (Previous/Next) now scroll through the command history
* Ensured that the "Oldest" line is always the first in the log
2017-12-06 04:33:11 -06:00
Åke 68c1683dd7
Merge pull request #1281 from MycroftAI/feature/wifisetup-rework
Modifications for wifi-setup rework
2017-12-06 11:11:18 +01:00
Åke Forslund 4018c550c1 Add mycroft.awoken message
Instead of speaking directly from the listener send a message that the
naptime_skill can use to trigger speech and/or other indications that
the listener is awake
2017-12-06 03:42:43 -06:00
Matthew D. Scholefield 0f9df9efa0 Modifications for wifi-setup rework 2017-12-05 17:47:00 -06:00
JarbasAI 53481a265d allow phonemes in any lang (#1264)
Add possibility to set language per hotword. If not specified will use global language setting.
2017-11-29 10:56:35 +01:00
Åke Forslund 6083cbce07 Handle ConnectionError when retrieving user id
If the machine is not connected to the network getting the user uuid in MutableMic.__init__ will fail, raising ConnectionError. This caused the speech client to crash.

Adding handler for ConnectionError resolves this issue.
2017-11-24 10:54:36 +01:00
penrods 8cb1e80bbe Fix viseme bug from PR #1242
I merged code and left out the 'until' value from the api call.  This
corrects that and deals with a missing 'until' cleaner.
2017-11-22 17:08:35 -06:00
Åke Forslund 2c3e5c3885 Minor correction of mouth_visime docstring 2017-11-21 12:41:36 +01:00
penrods c1e1b935ee Improve mouth synchronization with speech
When the TTS engine provides visemes to the faceplate, the information
passed along consists of the mouth shape and the duration to display it.
When the system get backed-up for some reason (e.g. the CPU is briefly
overloaded), the code would attempt to catch up the animation but would
still send the 'expired' viseme across the serial port to the faceplate
with no wait-time.  This results in a fast-moving mouth to catch up,
which isn't very pleasing.

Now the viseme is passed along with an expiration date, so if the time
to display it has already passed then the viseme code gets thrown away
instead of being sent across the (relatively slow) serial port.  This
allows better catch-up.
2017-11-20 21:22:48 -06:00
Åke ed061df519
Merge pull request #1223 from MycroftAI/feature/improve-metrics-naming
Improve accuracy of metrics naming
2017-11-19 08:19:43 +01:00
penrods 1d4c614a36 Enhance CLI and screen corruption fix
Several refinements:
* Remove the "What time is it" preloaded example
* Page up/down now moves by 1/2 the # visible log lines instead of always 10 lines
* Reduce the frequency of full-screen redraws to 10 secs instead of 5 (because less needed with the corruption fix)
* Add the version of mycroft-core in the upper-right corner
* FIX: screen redraw now uses a lock, preventing corruption from drawing simultaneously from multiple threads
2017-11-17 19:25:16 -06:00
Matthew D. Scholefield 168a2b660f Improve accuracy of metrics naming
- md5 is consistent across architectures
 - Account ID is now consistent per user. Previously was using the device id
2017-11-15 19:35:53 -06:00
Matthew D. Scholefield 66540d9a9b Fix typo when enabling learn 2017-11-10 12:34:34 -06:00
Åke 01d47fb849
Merge pull request #1199 from MycroftAI/feature/precise
Precise Wake Word Listener
2017-11-09 21:27:46 +01:00
Matthew D. Scholefield ec223dcec9 Add wake word module hash to filename 2017-11-09 13:58:44 -06:00
Åke Forslund b08cf2bf42 Add tests for creating pocketsphinx hotwords
Default to pocketsphinx when hotword config doesn't hit a predefined
hotword config
2017-11-09 13:54:48 -06:00
Matthew D. Scholefield ed1deeb259 Make bool assignment more concise 2017-11-09 13:36:03 -06:00
Matthew D. Scholefield 5694b7f645 Extract precise server settings into config file
This allows changing the server in the future without an upgrade
2017-11-09 13:36:03 -06:00
Matthew D. Scholefield 788dc5d492 Fix downloading precise every startup 2017-11-09 13:36:03 -06:00
Matthew D. Scholefield b3f11d849a Add Precise hotword engine 2017-11-09 13:36:03 -06:00
Matthew D. Scholefield 0dc3dc1eab Fix sec_to_bytes 2017-11-09 11:30:30 -06:00
Matthew D. Scholefield d67f8b4bcf Change unit back to milliseconds and length back to 120ms 2017-11-09 11:30:30 -06:00
Matthew D. Scholefield 18690d358e Add user id to wake word upload
This is used to remove data retroactively from dataset
2017-11-09 11:30:26 -06:00
Matthew D. Scholefield dba2c540af Fix wake word record length 2017-11-08 14:21:07 -06:00
penrods f8824aab1d Cleanup of CLI filters and logged messages
This cleans up the amount of noise in the logs:
* Removed logging of the serial port raw read/writes.
* Removed the "Setting active skill" log in display_manager.py
* Corrected typo "dispaly"
* Added default CLI filter for mouth.display and mouth.icon messages
* Fixed bug when adding new filters
2017-10-28 01:42:19 -05:00
penrods 081da75fd5 Fix pep8 error 2017-10-27 17:14:02 -05:00