Commit Graph

173 Commits (384c66cbd23c0488097473d77650c17ba25c0809)

Author SHA1 Message Date
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
penrods e80029c1b9 Handle 'None' more gracefully in exception
The exception handler was generating a secondary warning when executing with
a None value for the serial port.
2017-10-27 17:14:02 -05:00
penrods d6b24af14c Fix enclosure client broken by #1110
Syntax error, needed Configuration.get().get("enclosure")
instead of just Configuration.get("enclosure")
2017-10-27 17:14:02 -05:00
Åke Forslund 52a89327fe Fix storing settings in enclosure client
====  Tech Notes ====
- Fix save in enclosure client
- Add tests for save and merge
2017-10-26 19:02:32 -04:00
Åke Forslund ea020eab4f Refactor configuration handling
====  Tech Notes ====
- Rewrite of configuration module. Reduced number of calls and simplified
logic.
- Patched configs now survives reload of config
2017-10-26 19:02:32 -04:00
penrods e1b4ad0400 Fixed silly typo... 2017-10-16 19:20:22 -05:00
penrods 47e2df1722 Prevent the "rolling eye" syndrome
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)
2017-10-16 19:20:22 -05:00
penrods 8c696b0586 Issue #967 - eyes keep spinning on boot
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)
2017-10-15 12:27:55 -05:00
penrods 8f2e5d9498 Change to Apache 2.0 license from GPLv3.0
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().
2017-10-04 01:28:44 -05:00
Matthew D. Scholefield 0569ba40f7 Use opt in value to record wake words 2017-10-03 13:24:09 -05:00
Matthew D. Scholefield 5e392f34aa Optimize imports
Remove unused imports and group local vs external alphabetically
2017-09-18 16:07:50 -05:00
Matthew D. Scholefield cfdc405da5 Add new LOG class 2017-09-18 13:56:06 -05:00
Åke Forslund 23444c65ee Replace Intent invocation with specific messages
==== Protocol Notes ====
New messages on the message bus:
- mycroft.volume.increase
- mycroft.volume.decrease
2017-09-15 12:14:35 -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
Å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
Brian Hopkins c2aa2ebb97 fixing typo (#1052)
* fixing typo

fixing color function
2017-09-04 00:49:08 +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
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
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
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
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
Michael Nguyen 25a457083d fixed function names 2017-07-06 16:58:24 -05:00
Steve Penrod 96c08189ed Revert "This add comments to document the message class" 2017-06-30 00:41:20 +02:00
Art McGee 355225ee3d Merge branch 'dev' into amcgee7_docs 2017-06-29 07:17:19 -07:00
Michael Nguyen eeda583576 rename functions, delete extra code comment 2017-06-21 13:19:00 -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
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 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
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 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
Arron Atchison 7c05b51195 Update version.txt 2017-05-18 16:53:10 -03:00