- Engines now specify if they support ssml rather than the configuration
- The text client strips out ssml tags
- Engines can modify tags via the `self.modify_tag` method
This sends a ctrl+c signal to each process which will allow code to exit properly by handling KeyboardInterrupt
Other notable changes:
- create_daemon method used to clean up create daemon threads
- create_echo_function used to reduce code duplication with messagebus
echo functions
- wait_for_exit_signal used to wait for ctrl+c (SIGINT)
- reset_sigint_handler used to ensure SIGINT will raise KeyboardInterrupt
This can be replaced by ensuring the final except clause is 'except Exceptions'. This works because SystemExit and KeyboardInterrupt do not inherit from the base 'Exception' class
Several tweaks to CLI behavior
* The "show/hide meter" setting is now persisted
* Fix behavior when scrolled back and logs are rolling off
* Fix potential crash when no logs exist
* Add Ctrl+R to force a refresh (undocumented for now-- help page is getting long and we need an automated system to resize help for smaller screens)
The calulated limit ensures that at least one message will be displayed.
Using a hard-coded constant is ugly, but such are scattered throughout
the script. Untangling those constants has been left for future patch.
* Add interface to Mark 1 faceplace capabilities
This adds API interfaces for two Mark 1 faceplace capabilities to the
mycroft.client.enclosure.EnclosureAPI()
EnclosureAPI.setpixel(index, r,g,b)
- Set individual eye pixels to any color. The indices go from 0-23 with
the 0-12 corresponding to the right eye and 11-23 to the left.
EnclosureAPI.fill(percentage)
- Fill the eyes to a percentage, for use in meters or countdowns. The
right eye is 0-50%, the left eye also fills if going up to 100%.
Many thanks to mikonse for troubleshooting and suggesting this fix.
==== Fixed Issues ====
==== Tech Notes ====
Disabling this exception should free up the audio producer thread to
continue deliver the available sound data.
* Add wait_for_response method to Websock client
The client handles the basic case when wanting to do a syncronous
request-response action.
The method sets up a handler waits for the response and handles timeout.
The expected format is that the reply message should have the same type as
the original message with ".response" appended.
An method in the Message class has been added to create a standard response for
a message.
* Let the :skills command use wait_for_response
* Minor docstring changes
Fixed typos and refined text
* Made MycroftSkill.remove_event() return a bool, preventing unnecessary/misleading message from being posted by MycroftSkill.cancel_scheduled_event()
* More doc and several minor renames around intent processing
* Several minor typo and doc corrections
SkillManager now handles the skillmanager.list message and will reply with the
mycroft.skills.list message including a list of the loaded skills.
==== Protocol Notes ====
Added messages:
- skillmanager.list: skill manager send list of skills on messagebus
- mycroft.skills.list message with skill list
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.
* 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.
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
*
==== 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
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.
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
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.
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.
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
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.
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
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
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.
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.
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
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
When (re)booting a Mark 1 unit will show rolling eyes until it reaches
a "ready" state. This happens by sending a command to the Arduino.
There is also code that prevents sending commands our the serial port
if not running on a Mark 1. In certain situations, the message
indicating that the Mark 1 Arduino was found was posted to the
messagebus before it was fully open. When this was missed, the system
didn't think it was on a Mark 1 and the command to stop the eyes from
rolling (and for further interactions with the Mark 1 hardware) were
not sent.
The Mark 1 Arduino detection is now triggered when the messagebus
'open' notification is generated rather than when the object is
constructed.
==== Fixed Issues ====
#967 - Eyes never stop spinning on startup (Mark 1)
This fixes at least a potential issue with the Mark 1 boot sequence.
The system posts a "system.version" message then registers a
listener for the response. There is a chance that the response
sneaks in before the handler is registered. This just reorders the
sequence of that code.
==== Fixed Issues ====
ISSUE #967 - Eyes never stop spinning on startup (Mark 1)
This commit officially switches the mycroft-core repository from
GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code
have been removed and we have contacted all previous contributors
with still-existing code in the repository to agree to this change.
Going forward, all contributors will sign a Contributor License
Agreement (CLA) by visiting https://mycroft.ai/cla, then they will
be included in the Mycroft Project's overall Contributor list,
found at: https://github.com/MycroftAI/contributors. This cleanly
protects the project, the contributor and all who use the technology
to build upon.
Futher discussion can be found at this blog post:
https://mycroft.ai/blog/right-license/
This commit also removes all __author__="" from the code. These
lines are painful to maintain and the etiquette surrounding their
maintainence is unclear. Do you remove a name from the list if the
last line of code the wrote gets replaced? Etc. Now all
contributors are publicly acknowledged in the aforementioned repo,
and actual authorship is maintained by Github in a much more
effective and elegant way!
Finally, a few references to "Mycroft AI" were changed to the correct
legal entity name "Mycroft AI Inc."
==== Fixed Issues ====
#403 Update License.md and file headers to Apache 2.0
#400 Update LICENSE.md
==== Documentation Notes ====
Deprecated the ScheduledSkill and ScheduledCRUDSkill classes.
These capabilities have been superceded by the more flexible MycroftSkill
class methods schedule_event(), schedule_repeating_event(), update_event(),
and cancel_event().