Mycroft AI
  • Documentation
  • About Mycroft AI
    • Why use Mycroft AI?
    • Glossary of terms
    • Contributing
    • FAQ
  • Using Mycroft AI
    • Get Mycroft
      • Mark II
        • Mark II Dev Kit
      • Mark 1
      • Picroft
      • Linux
      • Mac OS and Windows with VirtualBox
      • Docker
      • Android
    • Pairing Your Device
    • Basic Commands
    • Installing New Skills
    • Customizations
      • Configuration Manager
      • mycroft.conf
      • Languages
        • Français (French)
        • Deutsch (German)
      • Using a Custom Wake Word
      • Speech-To-Text
      • Text-To-Speech
    • Troubleshooting
      • General Troubleshooting
      • Audio Troubleshooting
      • Wake Word Troubleshooting
      • Log Files
      • Support Skill
      • Getting more support
  • Skill Development
    • Voice User Interface Design Guidelines
      • What can a Skill do?
      • Design Process
      • Voice Assistant Personas
      • Interactions
        • Intents
        • Statements and Prompts
        • Confirmations
      • Conversations
      • Error Handling
      • Example Interaction Script
      • Prototyping
      • Design to Development
    • Development Setup
      • Python Resources
      • Your First Skill
    • Skill Structure
      • Lifecycle Methods
      • Logging
      • Skill Settings
      • Dependencies
        • Manifest.yml
        • Requirements files
      • Filesystem access
      • Skill API
    • Integration Tests
      • Test Steps
      • Scenario Outlines
      • Test Runner
      • Reviewing the Report
      • Adding Custom Steps
      • Old Test System
    • User interaction
      • Intents
        • Padatious Intents
        • Adapt Intents
      • Statements
      • Prompts
      • Parsing Utterances
      • Confirmations
      • Conversational Context
      • Converse
    • Displaying information
      • GUI Framework
      • Show Simple Content
      • Mycroft-GUI on a PC
      • Mark 1 Display
    • Advanced Skill Types
      • Fallback Skill
      • Common Play Framework
      • Common Query Framework
      • Common IoT Framework
    • Mycroft Skills Manager
      • Troubleshooting
    • Marketplace Submission
      • Skills Acceptance Process
        • Information Review Template
        • Code Review Template
        • Functional Review Template
        • Combined Template
      • Skill README.md
    • FAQ
  • Mycroft Technologies
    • Technology Overview
    • Roadmap
    • Mycroft Core
      • MessageBus
      • Message Types
      • Services
        • Enclosure
        • Voice Service
        • Audio Service
        • Skills Service
      • Plugins
        • Audioservice Plugins
        • STT Plugins
        • TTS Plugins
        • Wake Word Plugins
      • Testing
      • Legacy Repo
    • Adapt
      • Adapt Examples
      • Adapt Tutorial
    • Lingua Franca
    • Mimic TTS
      • Mimic 3
      • Mimic 2
      • Mimic 1
      • Mimic Recording Studio
    • Mycroft GUI
      • Remote STT and TTS
    • Mycroft Skills Kit
    • Mycroft Skills Manager
    • Padatious
    • Precise
    • Platforms
Powered by GitBook
On this page
  • Mycroft Services
  • Process Status
  • Proposed Addition
  • Status/Watchdog Service

Was this helpful?

  1. Mycroft Technologies

Mycroft Core

Mycroft Core sits at the centre of all Mycroft installations. The code itself includes anything that is generic to all instances of Mycroft.

PreviousRoadmapNextMessageBus

Last updated 4 years ago

Was this helpful?

Mycroft Services

Mycroft Core includes four or more distinct Services:

Each of these is started in it's own process, and communicates with other processes by emitting and listening to messages on the MessageBus.

Process Status

Each Service includes an instance of the ProcessStatus class. This provides a consistent interface to set and query the state of a Service.

It is constructed with the following signature:

status = ProcessStatus(name, bus, on_started=None, on_alive=None, on_ready=None,
              on_stopping=None, on_error=None)

Arguments

name (str): process name, will be used to create the messagebus messagetype "mycroft.{name}..." bus (MessageBusClient): connection to the Mycroft messagebus. on_started (callable): callback to execute when process is started on_alive (callable): callback to execute when minimum operation is reached. on_ready (callable): callback to execute when loading is 100 % complete. on_stopping (callable): callback to execute when shutdown of process starts. on_error (callable): callback to execute when an unrecoverable error renders the process unusable.

State and Events

Each process tracks its state as one of:

  • NOT_STARTED

  • STARTED

  • ERROR

  • STOPPING

  • ALIVE

  • READY

These states are defined in a comparable order. This means if a Process has the state ALIVE, then it must also be STARTED. Likewise, if a Process is READY, it must also be ALIVE and STARTED.

These states can be set by calling the relevant method from the ProcessStatus class we initialized above:

  • status.set_started()

  • status.set_error()

  • status.set_alive()

  • status.set_stopping()

  • status.set_ready()

It is up to each Service to determine it's readiness and set the state accordingly.

Querying Status

The status of a Service can be queried via the MessageBus.

The request Message should be in the form - mycroft.{service_name}.{is_status}. For example, we can check if the Audio Service is ALIVE by emitting:

response = self.bus.wait_for_response(Message(
           'mycroft.audio.is_alive'))

The response message will include a status boolean in the data payload:

>>> print(response.data)
{'status': True}

Proposed Addition

Status/Watchdog Service

The status/watchdog service would be a new systemd service running on devices that run Mycroft-core. The functionality of this service could include, but would not be limited to:

  • Monitoring various aspects of the health of each core service (is service running, healthy, ready, etc.).

  • Heartbeats could be emitted from each service, or the new service could check the pulse of each service on regular intervals.

  • Actions could be taken if a service becomes unhealthy, such as attempting to restart a crashed service.

  • Specific checks, such as the existing microphone watchdog, could be included in this service.

  • Responsible for restarting services on a daily basis.

  • If a user opts in to data sharing, information about exceptions or crashes could be sent to Mycroft for diagnostic purposes.

If you have thoughts or comments on the following status proposals, please .

MessageBus
Skills
Audio
Voice
Enclosure
let us know in the Community Forums