jamesmf / mycroft-mozilla-iot-skill

CommonIoT Implementation for interacting with Mozilla IoT Gateway from Mycroft
GNU Lesser General Public License v3.0
2 stars 3 forks source link

Unable to connect with IoT Devices #6

Open 5trongthany opened 4 years ago

5trongthany commented 4 years ago

When trying to communicate with a device, it fails quickly and gives the following in the skills log:

requests.exceptions.MissingSchema: Invalid URL '0.0.0.0/things/': No schema supplied. Perhaps you meant http://0.0.0.0/things/?
2020-10-26 15:23:21.267 | ERROR    |   845 | mycroft.skills.skill_loader:_communicate_load_status:327 | Skill mycroft-mozilla-iot-skill.jamesmf failed to load
2020-10-26 15:25:06.397 | INFO     |   845 | SpotifySkill | Couldn't fetch credentials
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-10-26 15:25:38.424 | INFO     |   845 | QuestionsAnswersSkill | Searching for turn off lamp
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-10-26 15:25:39.194 | INFO     |   845 | QuestionsAnswersSkill | Timeout occured check responses

I have replaced the IP for the device for privacy reasons.

Let me know if other logs or information would be helpful.

jamesmf commented 4 years ago

have you tried it with the http:// added like it suggested? If that works I'll add it to the docs

5trongthany commented 4 years ago

Reset my Mark 1, flashed the SD card. reinstalled the skill. Side note, when I try to do a custom install, it gets stuck loading and the power needs to be manually reset.

Logs from trying to turn on a lamp, then trying to turn off a fan.

TypeError: download() takes 1 positional argument but 2 were given
2020-11-10 21:46:19.748 | INFO     |   824 | mycroft.skills.settings:_emit_settings_change_events:378 | Emitting skill.settings.change event for skill @dd90d275-2693-4afc-b4eb-1bd36534fee5|mycroft-mozilla-iot-skill 
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-10 21:46:25.595 | INFO     |   824 | QuestionsAnswersSkill | Searching for turn on lamp
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-11-10 21:46:26.417 | INFO     |   824 | QuestionsAnswersSkill | Timeout occured check responses
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-10 21:47:51.631 | INFO     |   824 | QuestionsAnswersSkill | Searching for turn on lamp
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-11-10 21:47:52.081 | INFO     |   824 | QuestionsAnswersSkill | Timeout occured check responses
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-10 21:48:41.644 | ERROR    |   824 | concurrent.futures | exception calling callback for <Future at 0x5c8c4450 state=finished raised TypeError>
Traceback (most recent call last):
  File "/opt/python/lib/python3.7/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_executor.py", line 60, in _callback
    self.emit('error', exc)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_base.py", line 111, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_base.py", line 83, in _emit_handle_potential_error
    raise error
  File "/opt/python/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: download() takes 1 positional argument but 2 were given
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-10 21:48:51.599 | INFO     |   824 | msm.mycroft_skills_manager | Best match (0.75): mycroft-mozilla-iot-skill.jamesmf by jamesmf
2020-11-10 21:48:51.600 | ERROR    |   824 | SkillInstallerSkill | MSM failed: AlreadyInstalled(mycroft-mozilla-iot-skill.jamesmf)
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-10 21:49:01.161 | INFO     |   824 | QuestionsAnswersSkill | Searching for turn on the lamp
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-11-10 21:49:02.231 | INFO     |   824 | QuestionsAnswersSkill | Timeout occured check responses
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-10 21:49:11.690 | INFO     |   824 | QuestionsAnswersSkill | Searching for turn off fan
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-11-10 21:49:12.234 | INFO     |   824 | QuestionsAnswersSkill | Timeout occured check responses
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-10 21:49:20.546 | INFO     |   824 | mycroft.skills.settings:_emit_settings_change_events:378 | Emitting skill.settings.change event for skill mycroft-mark-1|20.08 
2020-11-10 21:49:20.577 | INFO     |   824 | mycroft.skills.mycroft_skill.mycroft_skill:handle_settings_change:308 | Updating settings for skill Mark1
2020-11-10 21:49:20.583 | INFO     |   824 | mycroft.skills.settings:save_settings:111 | Skill settings successfully saved to /opt/mycroft/skills/mycroft-mark-1.mycroftai/settings.json
jamesmf commented 4 years ago

hmm, it looks like it tries and fails to update the skill perhaps? I'll see if anyone more familiar with msm can help

jamesmf commented 4 years ago

What does it look like when you first boot up? If it's working it should speak a list of the Things on your gateway. If that's failing it might be with a more informative error

krisgesling commented 4 years ago

Does this differ between Master and Dev branches of Mycroft-core?

We recently got a bug fixed upstream in Pyee and Dev uses the fixed version whilst Master is still running the old one. So this may resolve itself on the next release of core.

forslund commented 4 years ago

I think the download() thing is a red herring. You fixed that issue here

krisgesling commented 4 years ago

oh yeah lol - yay me!

So it will be resolved with the next mycroft-core release :D

5trongthany commented 4 years ago

Updated the underlying OS on the Mark1 as it seemed to be pretty out of date(174 missing packages) and also installed a python package called `` that something in the startup complained about. Looking at the logs while I'm booting up the system I see the following log lines. I included some extra likes from before and after for context.

2020-11-16 18:40:36.982 | INFO     |   845 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-spelling.mycroftai/settings.json
2020-11-16 18:40:37.105 | INFO     |   845 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-spelling.mycroftai loaded successfully
2020-11-16 18:40:37.115 | INFO     |   845 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-mozilla-iot-skill.jamesmf
2020-11-16 18:40:37.158 | INFO     |   845 | mycroft.skills.settings:get_local_settings:78 | /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json
2020-11-16 18:40:37.225 | INFO     |   845 | MozillaIoTSkill | Removing all handlers...
2020-11-16 18:40:37.290 | ERROR    |   845 | mycroft.skills.skill_loader:_create_skill_instance:289 | Skill initialization failed with IndexError('string index out of range')
Traceback (most recent call last):
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_loader.py", line 283, in _create_skill_instance
    self.instance.initialize()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 143, in initialize
    self._setup()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 147, in _setup
    token=self.settings.get("token"), host=self.settings.get("host")
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 61, in __init__
    if isinstance(host, str) and host[-1] == "/":
IndexError: string index out of range
2020-11-16 18:40:37.296 | ERROR    |   845 | mycroft.skills.skill_loader:_communicate_load_status:327 | Skill mycroft-mozilla-iot-skill.jamesmf failed to load
2020-11-16 18:40:37.300 | INFO     |   845 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-audio-record.mycroftai
2020-11-16 18:40:37.340 | INFO     |   845 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-audio-record.mycroftai/settings.json
2020-11-16 18:40:37.443 | INFO     |   845 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-audio-record.mycroftai loaded successfully

Hopefully this helps, I'm not entirely sure what these lines mean. Any suggestions for what I should do next?

krisgesling commented 4 years ago

Have you run: sudo mycroft-use unstable This will switch you to the dev branch

jamesmf commented 4 years ago

This looks right to me if you just don't have the info saved in your settings (the url and gateway token)

On Mon, Nov 16, 2020, 1:43 PM 5trongthany notifications@github.com wrote:

Updated the underlying OS on the Mark1 as it seemed to be pretty out of date(174 missing packages) and also installed a python package called `` that something in the startup complained about. Looking at the logs while I'm booting up the system I see the following log lines. I included some extra likes from before and after for context.

2020-11-16 18:40:36.982 | INFO | 845 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-spelling.mycroftai/settings.json 2020-11-16 18:40:37.105 | INFO | 845 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-spelling.mycroftai loaded successfully 2020-11-16 18:40:37.115 | INFO | 845 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-mozilla-iot-skill.jamesmf 2020-11-16 18:40:37.158 | INFO | 845 | mycroft.skills.settings:get_local_settings:78 | /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json 2020-11-16 18:40:37.225 | INFO | 845 | MozillaIoTSkill | Removing all handlers... 2020-11-16 18:40:37.290 | ERROR | 845 | mycroft.skills.skill_loader:_create_skill_instance:289 | Skill initialization failed with IndexError('string index out of range') Traceback (most recent call last): File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_loader.py", line 283, in _create_skill_instance self.instance.initialize() File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/init.py", line 143, in initialize self._setup() File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/init.py", line 147, in _setup token=self.settings.get("token"), host=self.settings.get("host") File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/init.py", line 61, in init if isinstance(host, str) and host[-1] == "/": IndexError: string index out of range 2020-11-16 18:40:37.296 | ERROR | 845 | mycroft.skills.skill_loader:_communicate_load_status:327 | Skill mycroft-mozilla-iot-skill.jamesmf failed to load 2020-11-16 18:40:37.300 | INFO | 845 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-audio-record.mycroftai 2020-11-16 18:40:37.340 | INFO | 845 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-audio-record.mycroftai/settings.json 2020-11-16 18:40:37.443 | INFO | 845 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-audio-record.mycroftai loaded successfully

Hopefully this helps, I'm not entirely sure what these lines mean. Any suggestions for what I should do next?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jamesmf/mycroft-mozilla-iot-skill/issues/6#issuecomment-728251624, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3SRJDG362FK75CVZ46OLLSQFXF5ANCNFSM4S7Q7RIA .

5trongthany commented 4 years ago

Possibly. I have the settings saved in home.mycroft.ai correctly, but it's possible it didn't get saved to the skill running on the Mycroft. Where would I find go to check that?

This looks right to me if you just don't have the info saved in your settings (the url and gateway token) On Mon, Nov 16, 2020, 1:43 PM 5trongthany @.***> wrote: Updated the underlying OS on the Mark1 as it seemed to be pretty out of date(174 missing packages) and also installed a python package called `` that something in the startup complained about. Looking at the logs while I'm booting up the system I see the following log lines. I included some extra likes from before and after for context. 2020-11-16 18:40:36.982 | INFO | 845 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-spelling.mycroftai/settings.json 2020-11-16 18:40:37.105 | INFO | 845 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-spelling.mycroftai loaded successfully 2020-11-16 18:40:37.115 | INFO | 845 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-mozilla-iot-skill.jamesmf 2020-11-16 18:40:37.158 | INFO | 845 | mycroft.skills.settings:get_local_settings:78 | /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json 2020-11-16 18:40:37.225 | INFO | 845 | MozillaIoTSkill | Removing all handlers... 2020-11-16 18:40:37.290 | ERROR | 845 | mycroft.skills.skill_loader:_create_skill_instance:289 | Skill initialization failed with IndexError('string index out of range') Traceback (most recent call last): File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_loader.py", line 283, in _create_skill_instance self.instance.initialize() File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/init.py", line 143, in initialize self._setup() File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/init.py", line 147, in _setup token=self.settings.get("token"), host=self.settings.get("host") File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/init.py", line 61, in init if isinstance(host, str) and host[-1] == "/": IndexError: string index out of range 2020-11-16 18:40:37.296 | ERROR | 845 | mycroft.skills.skill_loader:_communicate_load_status:327 | Skill mycroft-mozilla-iot-skill.jamesmf failed to load 2020-11-16 18:40:37.300 | INFO | 845 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-audio-record.mycroftai 2020-11-16 18:40:37.340 | INFO | 845 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-audio-record.mycroftai/settings.json 2020-11-16 18:40:37.443 | INFO | 845 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-audio-record.mycroftai loaded successfully Hopefully this helps, I'm not entirely sure what these lines mean. Any suggestions for what I should do next? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#6 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3SRJDG362FK75CVZ46OLLSQFXF5ANCNFSM4S7Q7RIA .

5trongthany commented 4 years ago

I have not tried to use the unstable yet, do you think that would help in this issue?

Have you run: sudo mycroft-use unstable This will switch you to the dev branch

forslund commented 4 years ago

Try changing the last part of the erroring line to host[-1:] == "/" which should work for the empty string as well

The whole line would be

    if isinstance(host, str) and host[-1:] == "/":
jamesmf commented 4 years ago

that's a good suggestion - when I wrote it using a .get('token') I assumed that it would be missing, not defaulted to blank, and therefore would be either None or a string with len > 0.

That said, it will just error elsewhere until it gets a valid token.

@5trongthany I'm not sure why your settings aren't being downloaded fast enough, but you can always try editing your local settings.json to confirm that it works once you paste the right values there.

I doubt you need to use the unstable branch if you successfully got to the point where it complains about a missing token.

5trongthany commented 4 years ago

@jamesmf should I have a file named settings.json? All I have are what the following screenshot contains. If I can edit the settingsmeta.yaml then I can give that a try. Otherwise I wonder if that might be a fault of a bad install. image

I had mentioned before somewhere that I was having issues installing the skill, as the following would happen:

  1. enter the url into the custom skill installer on home.mycroft.ai
  2. tell Mycroft to update configuration
  3. tell mycroft "install custom skill"
  4. the loading animation on the faceplate would start
  5. Mycroft would be unresponsive and require a hard reboot(unplug power, wait 10 seconds, plug it back in)
forslund commented 4 years ago

settings.json is now by default created in the XDG dir... (so /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf), check if it's there. if host and/or token is set to the empty string "" add some content?

@jamesmf you're right the value should be None there :/ but I guess technically it could be set to an empty string in the backend? (the yaml defaults the string to '' so it may be what happens)

5trongthany commented 4 years ago

Thanks for the pointer to where that setting is. I took a look in the json and it was empty, so I manually entered in the settings myself. I then tried to invoke the skill, which didn't work. I told it then to try to update config, to which I was told "no changes to apply"

2020-11-19 19:16:44.766 | INFO     |   860 | mycroft.skills.skill_updater:_log_next_download_time:265 | Next scheduled skill update: 2020-11-19 20:16:44.762792
2020-11-19 19:16:44.769 | INFO     |   860 | mycroft.skills.skill_updater:update_skills:168 | Skill update complete
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-19 19:46:05.629 | INFO     |   860 | QuestionsAnswersSkill | Searching for turn on lamp
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-11-19 19:46:06.044 | INFO     |   860 | QuestionsAnswersSkill | Timeout occured check responses
2020-11-19 19:46:18.201 | ERROR    |   860 | concurrent.futures | exception calling callback for <Future at 0x710d4290 state=finished raised TypeError>
Traceback (most recent call last):
  File "/opt/python/lib/python3.7/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_executor.py", line 60, in _callback
    self.emit('error', exc)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_base.py", line 111, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_base.py", line 83, in _emit_handle_potential_error
    raise error
  File "/opt/python/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: download() takes 1 positional argument but 2 were given

I then try rebooting. Tailing the logs I see that it suggests I change the address for the gateway to "http://myipaddress/thing/" instead of just the IP address. I try changing it again and reboot once more. Here are the logs it provides after that change and me trying to turn on my lamp:

2020-11-19 19:52:03.065 | INFO     |   839 | mycroft.skills.mycroft_skill.mycroft_skill:handle_settings_change:308 | Updating settings for skill MozillaIoTSkill
2020-11-19 19:52:03.070 | INFO     |   839 | mycroft.skills.settings:save_settings:111 | Skill settings successfully saved to /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json
2020-11-19 19:52:03.071 | INFO     |   839 | MYCROFT | 10.10.10.10/things/
2020-11-19 19:52:03.073 | ERROR    |   839 | concurrent.futures | exception calling callback for <Future at 0x5b8cded0 state=finished raised MissingSchema>
Traceback (most recent call last):
  File "/opt/python/lib/python3.7/concurrent/futures/_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_executor.py", line 60, in _callback
    self.emit('error', exc)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_base.py", line 111, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/pyee/_base.py", line 83, in _emit_handle_potential_error
    raise error
  File "/opt/python/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/mycroft_skill/mycroft_skill.py", line 312, in handle_settings_change
    self.settings_change_callback()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 155, in on_websettings_changed
    self._setup()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 147, in _setup
    token=self.settings.get("token"), host=self.settings.get("host")
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 68, in __init__
    self.things = self.get_things()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 92, in get_things
    resp = self.request("GET", "/things/")
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 82, in request
    response = requests.request(method, url, json=data, headers=self.headers)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/sessions.py", line 510, in request
    prep = self.prepare_request(req)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/sessions.py", line 453, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '10.10.10.10/things/': No schema supplied. Perhaps you meant http://10.10.10.10/things/?
2020-11-19 19:52:03.184 | INFO     |   839 | SkillInstallerSkill | Will install [] from the marketplace
2020-11-19 19:52:03.539 | INFO     |   839 | SkillInstallerSkill | Will remove [] from the marketplace
2020-11-19 19:52:03.540 | INFO     |   839 | SkillInstallerSkill | Will remove [] from the marketplace
2020-11-19 19:52:38.423 | INFO     |   839 | ConfigurationSkill | Remote configuration updated
2020-11-19 19:52:47.438 | INFO     |   839 | QuestionsAnswersSkill | Searching for turn on lamp
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-11-19 19:52:48.051 | INFO     |   839 | QuestionsAnswersSkill | Timeout occured check responses
jamesmf commented 4 years ago

hmmm, it looks like in that second set of logs, it still doesn't see the http:// in there. Not sure what would cause that

5trongthany commented 4 years ago

Anything you want me to try or to tinker with?

DClarke1989 commented 4 years ago

I had the same issue (mycroft complained about missing 'http://') and solved by doing the following.

Uninstalled all skills: sudo rm -R /opt/mycroft/skills/ Uninstalled skills folder in following location: /home/mycroft/.config/mycroft/ Reinstalled default skills: msm default Reinstalled miot skill: mycroft-msm install https://github.com/jamesmf/mycroft-mozilla-iot-skill setup skill in account with: http://192.168.0.XX + access token

i tried just uninstalling the skill, but that did not remove json file, and reinstalling skill did not help without removing folder from .config/skills.

It was necessary to add 'http://' at front of IP address

jamesmf commented 4 years ago

I will add error handling to that piece - it looks like that error happens during the settings_change_callback which I'm guessing means the skill can't update its settings (which it needs to do in order to work).

Let me know if that doesn't fix it

5trongthany commented 3 years ago

Bad news is that we're still running into issues trying to get it manipulate the connected devices. The good news is that it looks to be trying now, so we got some progress!

Here's what I get when I tail logs while trying to interact with the skill

2020-11-30 17:59:55.326 | INFO     |   844 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.OFF, thing=None, attribute=None, entity="fan", scene=None, value=None, state=None)
2020-11-30 17:59:55.394 | INFO     |   844 | MYCROFT | Mozilla IoT was consulted
2020-11-30 17:59:55.395 | INFO     |   844 | MYCROFT | null
2020-11-30 17:59:55.395 | INFO     |   844 | MYCROFT | mozilla-iot: no such thing as fan
Removing event skill-iot-control.mycroftai:RunIotRequest
Removing event skill-iot-control.mycroftai:DeleteRequest
2020-11-30 18:00:05.305 | INFO     |   844 | skill-iot-control_mycroftai:_delete_request:225 | Delete request 882179c3-7aa2-4a33-a46d-b757e991bd49
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-11-30 18:00:28.235 | INFO     |   844 | skill-iot-control_mycroftai:_trigger_iot_request:299 | state is None
2020-11-30 18:00:28.241 | INFO     |   844 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.ON, thing=None, attribute=None, entity="bedroom lamp", scene=None, value=None, state=None)
2020-11-30 18:00:28.277 | INFO     |   844 | MYCROFT | Mozilla IoT was consulted
2020-11-30 18:00:28.278 | INFO     |   844 | MYCROFT | null
2020-11-30 18:00:28.281 | INFO     |   844 | MYCROFT | mozilla-iot: no such thing as bedroom lamp
Removing event skill-iot-control.mycroftai:RunIotRequest
Removing event skill-iot-control.mycroftai:DeleteRequest
2020-11-30 18:00:38.411 | INFO     |   844 | skill-iot-control_mycroftai:_delete_request:225 | Delete request 8d0a635f-c654-4b65-8949-c6ff608c45e8

When I try to interact with the skill, Mycroft says "I could not find any skills to handle that request."

I double checked my settings.json and tried it both with just the IP address for the mozilla gateway, with http, and with https. Same results each time.

Let me know if there should be anything else I am checking. Thanks!

jamesmf commented 3 years ago

When the skill starts up (or when the settings change) you should see the skill print you a list of all the names of Things it finds - does that happen?

LOG.info(f"Entities Registered: {self._entities}") should make it say what the entities it registered are.

My guess is that the initial call to get the names of all the Things on your gateway is failing, but since it fails gracefully now you can't see it. You might check the logs for either

MissingSchema or HTTPError as those are the two error types the skill catches now

5trongthany commented 3 years ago

I get a number of logs when I watch Mycroft start up. First thing I noticed is as follows:

2020-12-01 21:05:16.237 | INFO     |   863 | mycroft.skills.settings:get_local_settings:78 | /opt/mycroft/skills/mycroft-spelling.mycroftai/settings.json
2020-12-01 21:05:18.515 | INFO     |   863 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-spelling.mycroftai loaded successfully
2020-12-01 21:05:19.713 | INFO     |   863 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-mozilla-iot-skill.jamesmf
2020-12-01 21:05:19.760 | INFO     |   863 | mycroft.skills.settings:get_local_settings:78 | /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json
2020-12-01 21:05:19.828 | INFO     |   863 | MYCROFT | 10.10.10.10/things/
2020-12-01 21:05:19.841 | INFO     |   863 | MYCROFT | Entities Registered: dict_keys([])
2020-12-01 21:05:19.847 | INFO     |   863 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-mozilla-iot-skill.jamesmf loaded successfully
2020-

then a bit later

2020-12-01 21:05:48.132 | INFO     |   863 | msm.mycroft_skills_manager | building SkillEntry objects for all skills
2020-12-01 21:05:48.147 | INFO     |   863 | mycroft.skills.padatious_service:train:100 | Training... (single_thread=False)
--- Logging error ---
Traceback (most recent call last):
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 83, in request
    response = requests.request(method, url, json=data, headers=self.headers)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/sessions.py", line 510, in request
    prep = self.prepare_request(req)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/sessions.py", line 453, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '10.10.10.10/things/': No schema supplied. Perhaps you meant http://10.10.10.10/things/?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/python/lib/python3.7/logging/__init__.py", line 1025, in emit
    msg = self.format(record)
  File "/opt/python/lib/python3.7/logging/__init__.py", line 869, in format
    return fmt.format(record)
  File "/opt/python/lib/python3.7/logging/__init__.py", line 608, in format
    record.message = record.getMessage()
  File "/opt/python/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/opt/python/lib/python3.7/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/opt/python/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_manager.py", line 234, in run
    self._load_on_startup()
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_manager.py", line 271, in _load_on_startup
    self._load_new_skills()
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_manager.py", line 293, in _load_new_skills
    loader = self._load_skill(skill_dir)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_manager.py", line 300, in _load_skill
    load_status = skill_loader.load()
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_loader.py", line 162, in load
    return self._load()
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_loader.py", line 220, in _load
    if skill_module and self._create_skill_instance(skill_module):
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/skill_loader.py", line 283, in _create_skill_instance
    self.instance.initialize()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 153, in initialize
    self._setup()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 157, in _setup
    token=self.settings.get("token", ""), host=self.settings.get("host", "")
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 68, in __init__
    self.things = self.get_things()
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 101, in get_things
    resp = self.request("GET", "/things/")
  File "/opt/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/__init__.py", line 87, in request
    e,
Message: 'caught requests.exceptions.MissingSchema error in mycroft-mozilla-iot-skill: '
Arguments: (MissingSchema("Invalid URL '10.10.10.10/things/': No schema supplied. Perhaps you meant http://10.10.10.10/things/?"),)

What does this read to you to mean?

jamesmf commented 3 years ago

gotcha - that makes it seem like when the skill loads, it still isn't getting the version with the http:// in front.

Does it have the http:// in front in the settings at /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf

5trongthany commented 3 years ago

gotcha - that makes it seem like when the skill loads, it still isn't getting the version with the http:// in front.

Does it have the http:// in front in the settings at /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf

By default it does not. I added the http:// to the line manually and rebooted the Mark1. Here's what I get in the logs:

2020-12-03 16:55:07.297 | INFO     |   839 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-spelling.mycroftai loaded successfully
2020-12-03 16:55:07.302 | INFO     |   839 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-mozilla-iot-skill.jamesmf
2020-12-03 16:55:07.349 | INFO     |   839 | mycroft.skills.settings:get_local_settings:78 | /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json
2020-12-03 16:55:07.416 | INFO     |   839 | MYCROFT | http://10.10.10.10/things/
2020-12-03 16:55:07.650 | INFO     |   839 | MYCROFT | Entities Registered: dict_keys([`proceeds to list my smart things, which it does correctly`])
2020-12-03 16:55:07.657 | INFO     |   839 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-mozilla-iot-skill.jamesmf loaded successfully

However, when I try to invoke the skill by saying, for example, "turn off fan", I get a failure and the following log lines:

2020-12-03 16:58:35.487 | INFO     |   839 | skill-iot-control_mycroftai:_trigger_iot_request:299 | state is None
2020-12-03 16:58:35.491 | INFO     |   839 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.OFF, thing=None, attribute=None, entity="fan", scene=None, value=None, state=None)
2020-12-03 16:58:35.552 | INFO     |   839 | MYCROFT | Mozilla IoT was consulted
2020-12-03 16:58:35.552 | INFO     |   839 | MYCROFT | null
2020-12-03 16:58:35.553 | INFO     |   839 | MYCROFT | mozilla-iot: no such thing as fan
Removing event skill-iot-control.mycroftai:RunIotRequest
Removing event mycroft-mark-1.mycroftai:IdleCheck
Removing event skill-iot-control.mycroftai:DeleteRequest

and if I go back into the settings.json, I see the ip address is missing the http at the start, even though I put it there earlier. Trying it again but without rebooting, I still am unable to interact with my smart devices. I decided to try adding an http:// to the line of the settingsmeta.yaml and rebooting to see if it would stick after that, and sure enough it did. However, trying to turn off a lamp or a fan after this still prooved fruitless.

2020-12-03 17:04:45.702 | INFO     |   857 | mycroft.skills.settings:save_settings:111 | Skill settings successfully saved to /opt/mycroft/skills/mycroft-mark-1.mycroftai/settings.json
2020-12-03 17:04:50.783 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:299 | state is None
2020-12-03 17:04:50.788 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.OFF, thing=None, attribute=None, entity="lamp", scene=None, value=None, state=None)
2020-12-03 17:04:50.831 | INFO     |   857 | MYCROFT | Mozilla IoT was consulted
2020-12-03 17:04:50.833 | INFO     |   857 | MYCROFT | null
2020-12-03 17:04:50.834 | INFO     |   857 | MYCROFT | mozilla-iot: no such thing as lamp
2020-12-03 17:04:50.846 | INFO     |   857 | mycroft.skills.settings:save_settings:111 | Skill settings successfully saved to /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json
Removing event skill-iot-control.mycroftai:RunIotRequest
Removing event skill-iot-control.mycroftai:DeleteRequest
2020-12-03 17:05:00.363 | INFO     |   857 | skill-iot-control_mycroftai:_delete_request:225 | Delete request 4b254149-989f-4261-bb1c-1aaaceeb8e68
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-12-03 17:06:43.292 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:299 | state is None
2020-12-03 17:06:43.299 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.OFF, thing=None, attribute=None, entity="fan", scene=None, value=None, state=None)
2020-12-03 17:06:43.332 | INFO     |   857 | MYCROFT | Mozilla IoT was consulted
2020-12-03 17:06:43.333 | INFO     |   857 | MYCROFT | null
2020-12-03 17:06:43.334 | INFO     |   857 | MYCROFT | mozilla-iot: no such thing as fan
Removing event skill-iot-control.mycroftai:RunIotRequest
Removing event skill-iot-control.mycroftai:DeleteRequest
2020-12-03 17:06:53.054 | INFO     |   857 | skill-iot-control_mycroftai:_delete_request:225 | Delete request 29d545fa-8ad1-4b0c-b783-577497488974
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-12-03 17:07:22.425 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:299 | state is None
2020-12-03 17:07:22.429 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.ON, thing=None, attribute=None, entity="bedroom lamp", scene=None, value=None, state=None)
2020-12-03 17:07:22.459 | INFO     |   857 | MYCROFT | Mozilla IoT was consulted
2020-12-03 17:07:22.460 | INFO     |   857 | MYCROFT | null
2020-12-03 17:07:22.461 | INFO     |   857 | MYCROFT | mozilla-iot: no such thing as bedroom lamp

So I am once again stuck.

jamesmf commented 3 years ago

hmmmm. in the proceeds to list my smart things, which it does correctly are "fan" and "bedroom lamp" or "bedroom light" listed there exactly?

I'm not an expert on the interplay between settingsmeta.yml, what you enter in the account, and how often your local settings.json gets updated, but that sounds problematic.

5trongthany commented 3 years ago

Correct the sanitized version of the list is as follows:

spotify', 'lamp', 'light', 'lights', 'bedroom lamp', 'bedroom light', 'bedroom lights', 'phone', 'fan', 'datetime', 'weather (apartment)', 'weather (hometown)'

jamesmf commented 3 years ago

somehow it seems like your settings are getting overwritten. I am not sure why the save_settings call keeps happening...

2020-12-03 17:04:50.846 | INFO | 857 | mycroft.skills.settings:save_settings:111 | Skill settings successfully saved to /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json

I'm gonna add a 'debug what's available to the logs every time you miss` line

jamesmf commented 3 years ago

just merged a quick update

5trongthany commented 3 years ago

Updated by running git pull origin master and tried again. Here comes some logs

2020-12-03 18:06:07.202 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:299 | state is None
2020-12-03 18:06:07.217 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.OFF, thing=None, attribute=None, entity="fan", scene=None, value=None, state=None)
2020-12-03 18:06:07.246 | INFO     |   857 | MYCROFT | Mozilla IoT was consulted
2020-12-03 18:06:07.246 | INFO     |   857 | MYCROFT | mozilla could not find fan. Available options are: []
2020-12-03 18:06:07.247 | INFO     |   857 | MYCROFT | mozilla-iot: no such thing as fan
Removing event skill-iot-control.mycroftai:RunIotRequest
Removing event skill-iot-control.mycroftai:DeleteRequest
2020-12-03 18:06:17.237 | INFO     |   857 | skill-iot-control_mycroftai:_delete_request:225 | Delete request 6f7282a1-3621-4e95-95dc-942a112eb578
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-12-03 18:06:35.684 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:299 | state is None
2020-12-03 18:06:35.700 | INFO     |   857 | skill-iot-control_mycroftai:_trigger_iot_request:310 | Looking for handlers for: IoTRequest(action=Action.OFF, thing=None, attribute=None, entity="lamp", scene=None, value=None, state=None)
2020-12-03 18:06:35.724 | INFO     |   857 | MYCROFT | Mozilla IoT was consulted
2020-12-03 18:06:35.725 | INFO     |   857 | MYCROFT | mozilla could not find lamp. Available options are: []
2020-12-03 18:06:35.725 | INFO     |   857 | MYCROFT | mozilla-iot: no such thing as lamp

No reboot tried. Let me know if I should test anything else.

jamesmf commented 3 years ago

I would try a reboot just in case the settings got overwritten and a reboot fixes.... if it doesn't, I'll need some help from someone who understands settings a bit better!

5trongthany commented 3 years ago

startup:

2020-12-03 18:11:42.678 | INFO     |   860 | mycroft.skills.skill_loader:load:161 | ATTEMPTING TO LOAD SKILL: mycroft-mozilla-iot-skill.jamesmf
2020-12-03 18:11:42.726 | INFO     |   860 | mycroft.skills.settings:get_local_settings:78 | /home/mycroft/.config/mycroft/skills/mycroft-mozilla-iot-skill.jamesmf/settings.json
2020-12-03 18:11:42.790 | INFO     |   860 | MYCROFT | 10.10.10.10/things/
2020-12-03 18:11:42.804 | INFO     |   860 | MYCROFT | Entities Registered: []
2020-12-03 18:11:42.810 | INFO     |   860 | mycroft.skills.skill_loader:_communicate_load_status:320 | Skill mycroft-mozilla-iot-skill.jamesmf loaded successfully
2020

trying to start or stop things:

Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-12-03 18:12:30.820 | INFO     |   860 | mycroft.skills.settings:save_settings:111 | Skill settings successfully saved to /opt/mycroft/skills/mycroft-mark-1.mycroftai/settings.json
2020-12-03 18:12:34.155 | INFO     |   860 | QuestionsAnswersSkill | Searching for turn off the fan
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-12-03 18:12:35.407 | INFO     |   860 | QuestionsAnswersSkill | Timeout occured check responses
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-12-03 18:12:46.453 | INFO     |   860 | QuestionsAnswersSkill | Searching for turn off fan
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-12-03 18:12:47.432 | INFO     |   860 | QuestionsAnswersSkill | Timeout occured check responses
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-12-03 18:12:53.926 | INFO     |   860 | ConfigurationSkill | Remote configuration updated
Removing event mycroft-mark-1.mycroftai:IdleCheck
2020-12-03 18:13:18.955 | INFO     |   860 | QuestionsAnswersSkill | Searching for turn on the bedroom lamp
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2020-12-03 18:13:20.035 | INFO     |   860 | QuestionsAnswersSkill | Timeout occured check responses
jamesmf commented 3 years ago

@krisgesling do you have any thoughts on the skill settings here? something seems off. Everytime it starts back up the skill is getting the version of the host attribute of the settings that doesn't have the http:// in front. When settingsmeta.yaml is manually changed it'll work for a bit, but it seems to get overwritten eventually.

Is there at least a best way to get back to a clean slate to get rid of every reference to the ip-only value?

forslund commented 3 years ago

Currently at startup the skill will(/should) get the value stored in home.mycroft.ai. Is it this that overwrites the value?

Changing the settingsmeta.yaml (adding a text section or something) should be enough to make sure that the all settings on mycroft home are cleared and the default set in the settingsmeta.yaml should be provided.

krisgesling commented 3 years ago

Sorry there's a lot of log output above.

It looks like this is forked from HomeAssistant is that right? I did a small update to the Common IoT branch of HA recently to improve the handling of settings on first load and updates of settings. Primarily this commit. Some of that may be useful here.

Mycroft should fetch new settings at startup, and check for any updates from the backend every minute. The settings changed callback won't be called by default on first boot though.

If you change anything in the settingsmeta.yaml the backend will treat it as a new settings block and so user settings will be effectively cleared requiring them to input them again. It's a big limitation we need to address as it means that even fixing typo's in labels would "wipe" user settings.

Is there any chance the switch to XDG is causing issues? settings.json used to be stored in the Skill directory /opt/mycroft/skills/skill-name/settings.json but is now stored in the XDG config which is most likely ~/.config/mycroft/skills/skill-name/settings.json. @5trongthany can you check which of these files exists, or if both exist delete the one from /opt/mycroft/...

5trongthany commented 3 years ago

I will be happy to help test this, but I will need to caveat that I won't be able to test quite as quickly for a couple of days. I recently moved and due to a mess up on multiple levels I am without internet at my new place. I am sending this from a mobile hotspot, which caps connected devices to 50-75kbps speed. Point being I won't be able to further test this until I get a more permanent solution set up at my new home. I'll be sure to update once I have more information.

Is there any chance the switch to XDG is causing issues? settings.json used to be stored in the Skill directory /opt/mycroft/skills/skill-name/settings.json but is now stored in the XDG config which is most likely ~/.config/mycroft/skills/skill-name/settings.json. @5trongthany can you check which of these files exists, or if both exist delete the one from /opt/mycroft/...

jamesmf commented 3 years ago

@krisgesling looking at that commit, I'd still expect what is currently implemented to work (though I like the idea of catching the error and speaking instead of just not registering entities). I followed the pattern of calling ._setup() (whose contents/name you improved in that commit) in initialize(). Looking at that code is informative.

I won't touch settingsmeta.yaml yet then.

I might add a check for 'http(s)://' since multiple people have had this issue