Mycroft Community Forum

Messagebus Wakeword not working?

So, Im trying to have Mycroft ‘reprompt’ with the listening tone in one of the fallback skills, Unknown-skill, so I can retry my vocal command directly. (Ill put a limit of 1-3 attempts to ‘re-recognize’)

The problem is similar to this post (linked below) trying to programmatically trigger the wakeword. They used a CLI messagebus command python -m mycroft.messagebus.send "mycroft.mic.listen". Whereas Im trying to provoke the response from within the Python ini.py. So I found an entry in the docs for (https://mycroft-ai.gitbook.io/docs/mycroft-technologies/mycroft-core/message-types#recognizer_loop-wakeword) it, but it doesnt seem to be triggering the wakeword.

Code added:
self.emitter.emit(Message('recognizer_loop:wakeword', {"utterance": "homie"}))

Error:
AttributeError: 'UnknownSkill' object has no attribute 'emitter'

So I tried the respective CLI command below and its not working as expected either. Any ideas?

python3 -m mycroft.messagebus.send 'recognizer_loop:wakeword' '{ "utterance": "homie"}'

Also, which of the Fallback-skills is most generic to put such a ‘please repeat’ trigger in?

So, Im reading more about the Fallback in the docs (https://mycroft-ai.gitbook.io/docs/skill-development/skill-types/fallback-skill) and I dont understand why the Fallback skill needs to be ‘removed’ on shutdown.

Is there a native method for using emitter inside a skill (as the name of the code flavor tab ‘Generating Message from MycroftSkill’ implies) or do I need to use a 3rd party package such as this: https://github.com/JarbasAl/local_listener

According to this the Docs are all old on the use of ‘emitter’ and should be changed to ‘bus’. I did this and is no longer throwing an error on ‘emitter’

@gez-mycroft

Have this working, see here:

dont use my local listener

you want the get_response method

https://mycroft-core.readthedocs.io/en/latest/source/mycroft.html#mycroft.MycroftSkill.get_response

if you really want to trigger regular listening, the correct message is “mycroft.mic.listen”

Thanks for the link, those docs look more complete. But I was able to solve my issue… the syntax was changed from self.emitter.emit to self.bus. emit, and then I needed to import the Message package.

Im going to look at your code because it contains some phonemes for basic commands I might be able to use. Im hoping to create a section in the main repository where people can add to those, along with Python code for basic commands that the Kubuntu plasmoid uses, etc.