I was disappointed with the limited skills and inability to load new skills - so I thought I would have a go at following the ‘Porting the Hello World Skill’ .
I’m coming to this without knowing anything about the pre-MK2 Mycroft so I suspect that I’m misunderstanding what I need to do to get it working. What would be really helpful would be a copy of a working hello world init.py so I can see where I’m going wrong.
I’m assuming that’s where the issue is but digging around in the files downloaded from git I can see vocab files with only a few words in them - does that mean they are the only words I can use as dialog in init.py?
I no longer have the error messages I was seeing as I have removed the hello world skill and rebooted the MK2 to reassure myself that I hadn’t permanently messed it up.
I tried again:
sudo systemctl restart dinkum-skills.service
Job for dinkum-skills.service failed because the service did not take the steps required by its unit configuration.
See “systemctl status dinkum-skills.service” and “journalctl -xe” for details.
and …
$ systemctl status dinkum-skills.service
● dinkum-skills.service - Mycroft service skills.service
Loaded: loaded (/etc/systemd/system/dinkum-skills.service; static; vendor preset: enabled)
Active: activating (auto-restart) (Result: protocol) since Mon 2022-12-26 13:39:29 UTC; 3s ago
Process: 2178 ExecStart=/opt/mycroft-dinkum/.venv/bin/python -m service --service-id skills --skill /opt/mycroft-dinkum/skills/alarm.mark2 --skill /opt/mycroft-dinkum/skills/date.ma>
Main PID: 2178 (code=exited, status=0/SUCCESS)
and
journalctl -xe
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/services/messagebus/service/event_handler.py”, line 52, in on_message
Dec 26 13:40:14 localhost.localdomain python[1953]: client.write_message(message)
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 337, in write_message
Dec 26 13:40:14 localhost.localdomain python[1953]: raise WebSocketClosedError()
Dec 26 13:40:14 localhost.localdomain python[1953]: tornado.websocket.WebSocketClosedError
Dec 26 13:40:14 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/services/messagebus/service/event_handler.py”, line 52, in on_message
Dec 26 13:40:14 localhost.localdomain python[1953]: client.write_message(message)
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 337, in write_message
Dec 26 13:40:14 localhost.localdomain python[1953]: raise WebSocketClosedError()
Dec 26 13:40:14 localhost.localdomain python[1953]: tornado.websocket.WebSocketClosedError
Dec 26 13:40:14 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/services/messagebus/service/event_handler.py”, line 52, in on_message
Dec 26 13:40:14 localhost.localdomain python[1953]: client.write_message(message)
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 337, in write_message
Dec 26 13:40:14 localhost.localdomain python[1953]: raise WebSocketClosedError()
Dec 26 13:40:14 localhost.localdomain python[1953]: tornado.websocket.WebSocketClosedError
Dec 26 13:40:14 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/services/messagebus/service/event_handler.py”, line 52, in on_message
Dec 26 13:40:14 localhost.localdomain python[1953]: client.write_message(message)
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 337, in write_message
Dec 26 13:40:14 localhost.localdomain python[1953]: raise WebSocketClosedError()
Dec 26 13:40:14 localhost.localdomain python[1953]: tornado.websocket.WebSocketClosedError
Dec 26 13:40:14 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/services/messagebus/service/event_handler.py”, line 52, in on_message
Dec 26 13:40:14 localhost.localdomain python[1953]: client.write_message(message)
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 337, in write_message
Dec 26 13:40:14 localhost.localdomain python[1953]: raise WebSocketClosedError()
Dec 26 13:40:14 localhost.localdomain python[1953]: tornado.websocket.WebSocketClosedError
Dec 26 13:40:14 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/services/messagebus/service/event_handler.py”, line 52, in on_message
Dec 26 13:40:14 localhost.localdomain python[1953]: client.write_message(message)
Dec 26 13:40:14 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 337, in write_message
Dec 26 13:40:14 localhost.localdomain python[1953]: raise WebSocketClosedError()
Dec 26 13:40:14 localhost.localdomain python[1953]: tornado.websocket.WebSocketClosedError
Dec 26 13:40:14 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:15 localhost.localdomain python[1953]: ERROR:asyncio:Task exception was never retrieved
Dec 26 13:40:15 localhost.localdomain python[1953]: future: <Task finished name=‘Task-79084’ coro=<WebSocketProtocol13.write_message..wrapper() done, defined at /opt/mycroft-din>
Dec 26 13:40:15 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:15 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 1102, in wrapper
Dec 26 13:40:15 localhost.localdomain python[1953]: await fut
Dec 26 13:40:15 localhost.localdomain python[1953]: tornado.iostream.StreamClosedError: Stream is closed
Dec 26 13:40:15 localhost.localdomain python[1953]: During handling of the above exception, another exception occurred:
Dec 26 13:40:15 localhost.localdomain python[1953]: Traceback (most recent call last):
Dec 26 13:40:15 localhost.localdomain python[1953]: File “/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/tornado/websocket.py”, line 1104, in wrapper
Dec 26 13:40:15 localhost.localdomain python[1953]: raise WebSocketClosedError()
Dec 26 13:40:15 localhost.localdomain python[1953]: tornado.websocket.WebSocketClosedError
Dec 26 13:40:16 localhost.localdomain python[1958]: INFO:mycroft.util.log:Training… (single_thread=True)
I ran into the same thing. I didn’t mess with Mycroft prior to receiving the MK2. I attempted to port a skill and ran into the same issue. I opened a bug in the repo. No updates yet but figured I’d leave it here in case it does get updated.
Finally got it working by reading up on Mycroft before MK2 https://mycroft-ai.gitbook.io/docs/skill-development/skill-structure … and the point I missed was that the last bit of the code in init.py is outside the class definition, that is it needs no indentation for the first line of …
def create_skill():
return HelloWorldSkill()
That was painful, my vi editing skills are very rusty … although I have learned a lot
If you have the debug console (mycroft-start debug) going, any time you save changes to your code, Mycroft will detect them and reload the code. If you have syntax errors, they will show up immediately. I keep my IDE and the debug env’t side by side. It’s a pretty cool model they’ve come up with
I did not know that. Is there a good page for setting up the development environment? I saw an issue in the dinkum repo where people are asking for that?
Also, I’ve started a repo for skills I’ve converted. If anyone wants to PR into to spread the labor out, I’ll test the PR against mine and merge it in.
I think that’s going to fall under getting a dev environment setup. There’s an issue open. I was going to try and take some time next weekend and see if I could get a container running and using my laptop’s speakers/microphone for testing. If I get anywhere, I’ll share it.
My shorter term plan is swapping the USBs and having a dev and prod version of the OS on each USB.