Creating New skill Picroft

I have been trying for days to make a simple skill on picroft without success. I am using picroft V 0.9

I first tried to modify a default skill, without success. It seems like it was ignoring the modifications i was making. So i started a new one from scratch.

I am using the command line to test the skill. And i always get the answer « sorry i dont understand the phrase…. »

i used once for the skill i have created :
sudo chown -R mycroft /opt/mycroft/skills/

Here is what is the code :
in /opt/mycroft/skills/a-marvin-skill/dialog/en-us/marvinspeaks.dialog
I do not know I have never been there

in /opt/mycroft/skills/a-marvin-skill/vocab/en-us/MarvinKeyword.voc
what is up marvin

in /opt/mycroft/skills/a-marvin-skill/init.py

from os.path import dirname
from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill
from mycroft.util.log import getLogger

author = ‘stevedee’

LOGGER = getLogger(name)

class MarvinSkill(MycroftSkill):
def init(self):
super(MarvinSkill, self).init(name=“MarvinSkill”)

def initialize(self):

    self.load_data_files(dirname(__file__))

    marvin_intent = IntentBuilder("MarvinIntent").\
       require("MarvinKeyword").build()
    self.register_intent(marvin_intent, self.handle_marvin_intent)

 def handle_marvin_intent(self, message):
    self.speak_dialog("marvinspeaks")

 def stop(self):
    pass

 def create_skill():
     return MarvinSkill()

in cd /var/log, tail -f mycroft-skills.log

2017-11-22 02:24:44,328 - Skills - DEBUG - {“type”: “enclosure.mouth.viseme”, “data”: {“code”: “3”}, “context”: null}
2017-11-22 02:24:44,393 - Skills - DEBUG - {“type”: “enclosure.mouth.viseme”, “data”: {“code”: “0”}, “context”: null}
2017-11-22 02:24:44,455 - Skills - DEBUG - {“type”: “enclosure.mouth.viseme”, “data”: {“code”: “3”}, “context”: null}
2017-11-22 02:24:44,586 - Skills - DEBUG - {“type”: “enclosure.mouth.viseme”, “data”: {“code”: “0”}, “context”: null}
2017-11-22 02:24:44,715 - Skills - DEBUG - {“type”: “enclosure.mouth.viseme”, “data”: {“code”: “3”}, “context”: null}
2017-11-22 02:24:44,844 - Skills - DEBUG - {“type”: “enclosure.mouth.viseme”, “data”: {“code”: “4”}, “context”: null}
2017-11-22 02:24:45,204 - Skills - DEBUG - {“type”: “recognizer_loop:audio_output_end”, “data”: {}, “context”: null}
2017-11-22 02:24:51,994 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
2017-11-22 02:24:52,509 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/0a41c152-0aed-4cf1-a570-a2e660dc5509/setting HTTP/1.1” 200 2908
2017-11-22 02:24:52,555 - Skills - DEBUG - {“type”: “configuration.updated”, “data”: {“systemUnit”: “imperial”, “uuid”: “ed60eda7-a519-45da-8668-f4758307f633”, “sttSettings”: [{“credential”: {“uuid”: “7704500c-8ed9-462c-acf2-631e1bb54d03”, “@type”: “token”, “createdAt”: 1509062491143, “updatedAt”: 1509062491143}, “uuid”: “aa5e3309-205b-44a8-8ecf-b560af9eaabe”, “updatedAt”: 1509062491143, “active”: true, “@type”: “mycroft”, “createdAt”: 1509062491143}, {“credential”: {“uuid”: “80718ab2-d5e5-4c51-8a7f-d059c6afe5bb”, “@type”: “token”, “createdAt”: 1509062491150, “updatedAt”: 1509062491150}, “uuid”: “94ff37b5-7ff3-4cd5-86eb-b0d4a9aba389”, “updatedAt”: 1509062491150, “active”: false, “@type”: “openstt”, “createdAt”: 1509062491150}, {“credential”: {“uuid”: “98e04800-0ede-4337-8981-3ded8fdc6904”, “@type”: “token”, “createdAt”: 1509062491154, “updatedAt”: 1509062491154}, “uuid”: “d7b3f078-c364-42fe-9f43-8c35862605d7”, “updatedAt”: 1509062491154, “active”: false, “@type”: “wit”, “createdAt”: 1509062491154}, {“credential”: {“uuid”: “daeca075-bcd5-4a72-88ea-ef7d39cbdb72”, “@type”: “token”, “createdAt”: 1509062491158, “updatedAt”: 1509062491158}, “uuid”: “e6cb5510-19dc-42c6-b037-f88513352a79”, “updatedAt”: 1509062491158, “active”: false, “@type”: “google”, “createdAt”: 1509062491158}, {“credential”: {“uuid”: “00f11d39-e384-47d0-af18-63d4a259c9cc”, “@type”: “basic”, “createdAt”: 1509062491161, “updatedAt”: 1509062491161}, “uuid”: “c6343f16-e40b-4e3c-94bc-479598eb546a”, “updatedAt”: 1509062491161, “active”: false, “@type”: “ibm”, “createdAt”: 1509062491161}], “dateFormat”: “MDY”, “ttsSettings”: [{“active”: true, “uuid”: “13b5bee2-b898-43b1-af23-8fdf13febd61”, “@type”: “mimic”, “createdAt”: 1509062491165, “updatedAt”: 1509062491165}, {“active”: false, “uuid”: “eba7e32c-e67a-4735-a5be-c332e425d2e7”, “@type”: “marytts”, “createdAt”: 1509062491166, “updatedAt”: 1509062491166}, {“active”: false, “uuid”: “4d5842a4-6751-40e8-a7ca-4b908c014602”, “@type”: “fatts”, “createdAt”: 1509062491169, “updatedAt”: 1509062491169}, {“active”: false, “uuid”: “1076f378-ed10-495f-b277-366e7d27ea26”, “@type”: “google”, “createdAt”: 1509062491171, “updatedAt”: 1509062491171}, {“active”: false, “uuid”: “7b8a5422-1650-421c-94e6-ffa8a76f6eec”, “@type”: “espeak”, “createdAt”: 1509062491172, “updatedAt”: 1509062491172}], “timeFormat”: “half”, “listenerSetting”: {“uuid”: “2057b617-39ac-4485-8a85-86ea4e2cdeab”, “multiplier”: 1.0, “channels”: 1, “wakeWord”: “hey mycroft”, “createdAt”: 1509062491174, “updatedAt”: 1509062491174, “threshold”: 1e-90, “phonemes”: “HH EY . M AY K R AO F T”, “sampleRate”: 16000, “energyRatio”: 1.5}, “user”: {“updatedAt”: 1509062490903, “socialAccounts”: [], “uuid”: “2a7fdbff-eb4d-4804-812c-12f4935c0751”, “createdAt”: 1509062490903, “unsubscriptionHistory”: []}, “updatedAt”: 1509062491129, “enclosureSetting”: {“uuid”: “acf0ec74-7018-4cf9-baa6-1f5c5a217cdc”, “rate”: 9600, “timeout”: 5.0, “updatedAt”: 1509062491176, “port”: “/dev/ttyAMA0”, “createdAt”: 1509062491176}, “createdAt”: 1509062491129, “skillsSetting”: {“directory”: “~/.mycroft/skills”, “stopThreshold”: 2.0, “uuid”: “bb41fca7-6b05-41f5-afc9-6f6952f27906”, “createdAt”: 1509062491173, “updatedAt”: 1509062491173}}, “context”: null}

in cd /var/log, cat mycroft-skills.log | grep « ERROR »

gives no output

i don’t have a test directory.

I dont understand why picroft cant recognize the skill. I have tried to change the keywords a couple of time without success.

is there any other way to debug skill other than generating the logg file?

Hello Yassah, first and foremost, thank you for your patients. Trying something out for days without getting it to work can be pretty frustrating. Here are a few tips to follow when writing a skill.

Use the built-in CLI. For the raspbian based devices (mark 1, picroft) there are easy to access commands for that.

mycroft-cli-client

That will bring you into the CLI where you can interact with Mycroft using text. If you type in :help, you will find a list of useful tools for debugging. One that I find extremely useful is the :filter command and the :find command. :filter will help you filter out all of the noise. Simply type in the string you don’t want to be displayed and any line containing that string will not be displayed. :find is good to only display lines with that string. I use it to only display skill related stuff when I am creating a skill. Below are examples of how to use each command.

:filter "viseme"
:find "my-skill-name"

Also, if you want to debug your mic, on the bottom right corner you will be able to see a tool that can recognize if audio is being picked up by the mic.

Another useful tool is a command that can start, stop, and restart different services. Like above, these can only be used for the raspbian based devices.

sudo service mycroft-skills start
sudo service mycroft-skills restart
sudo service mycroft-skills stop

You can replace skills with other services like enclosure, bus, wifi, etc. I usually do this to make sure my skills get’s loaded when I am making changes to it. It usually auto loads but this makes me confident that it does.

Also if you would like you can try to update Mycroft on picroft with

sudo apt-get update && sudo apt-get install mycroft-picroft

Hope this helps.

Hello Mn0491,

Thanks for the reply.

i usually using mycroft-cli-client to test skills.

I have tried to update Mycroft and it said that Mycroft was uptodate.

Can you be more specific about how to use find and filter method ? are you talking about default Linux command line ?

The mic and the speaker are working well. in my case the mic is integrated into the speaker. I can test them with defaults skills.

what i find hard to understand is that whatever the skill i am installing with git clone or with msm skill manager, Mycroft can’t recognize them. the latest skills i added today was « singing skill » and « skill version checker »

i usually restart raspberry pi for updating skills. But the result is still the same.

Is it possible to have access to defaults skill and modify them ?

any idea from where the problem come from ?

I think that it may be a good thing that on the PI image, the template skill, ( which is the hello world skill) is available on the Mycroft skill repository and excluded from Mycroft defaults skills. It will help newbies like me to start with a skill that works, and with which they can easily modify , experiment and upgrade.

Hello Mn0491,

After more digging, i found out that i was actually using v0.8 not 0.9. I downloaded it 2 days before v0.9 was released, and wasn’t expecting to be a new version that soon.

After upgrading to V0.9, all the skills are working well. Looks like all the defaults skill are now available in the skill directory, which is really great. Same for the new debug tool you talked on your reply. I have tried some modifications and Mycroft was able to detect it.

I have some issues with my usb speaker with integrated mic(I am using Jabra Speaker 510). But the main issue is definitively solved by the new version.

Thanks for your Help on that subject

@Yassah good to hear! let me know if you have any more questions. Happy Hacking :slight_smile: