16.0.0 seem to have problems with newer versions of system installed
openSSL stack. Discussion in issue #705
Thanks to BoBeR182 for providing this solution.
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)
Several changes:
* Removed old references to skills/* subdirectories (now skills are not a part of mycroft-core, so unneeded)
* Added includes for mycroft/res files
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.
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.
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.
* 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"
Developers do not expect a function called "find" to execute an API request, this is a "get". (I verified this with several other devs.) Renamed and added a Deprecated comment for now. Also:
* Added missing standard mycroft-core copyright.
* Added docstrings for basic objects and the STTApi in particular.