LinusSkucas / communications-skill

An intercom, messaging, and (video) calling skill for Mycroft!
Apache License 2.0
16 stars 6 forks source link

Failed to load skill #6

Open adocampo opened 5 years ago

adocampo commented 5 years ago

Hi there, Just installed the skill under Arch linux. The skill fails to load.

14:20:11.341 - mycroft.skills.core:load_skill:169 - ERROR - Failed to load skill: communications-skill
Traceback (most recent call last):
  File "/home/malevolent/development/mycroft-core/mycroft/skills/core.py", line 131, in load_skill
    imp.PY_SOURCE))
  File "/usr/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/mycroft/skills/communications-skill/__init__.py", line 16, in <module>
    import py2p
ModuleNotFoundError: No module named 'py2p'

As the error suggest, I've installed (globally) py2p though pip

sudo pip install  py2p
Collecting py2p
  Downloading https://files.pythonhosted.org/packages/2b/2a/d85c006a08069fb987bf33d2aa0596553ddc5f809ede3980e0089a58ef75/py2p-0.7.878-py2.py3-none-any.whl (51kB)
     |████████████████████████████████| 61kB 1.8MB/s 
Collecting async-promises (from py2p)
  Downloading https://files.pythonhosted.org/packages/6e/86/baf2be0b3b9fe28ba1c1ae30176376ec8f828dbfe812b95d37645fd0a5e7/async_promises-1.1.1.tar.gz
Collecting custom-inherit (from py2p)
  Downloading https://files.pythonhosted.org/packages/0e/ea/9f5050a4f1563c8c196b3526c2057fb7846e638942d59a187b79e33d1c9e/custom_inherit-2.2.0.tar.gz
Collecting typing (from py2p)
  Downloading https://files.pythonhosted.org/packages/28/b8/a1d6b7cf322f91305bcb5e7d8f6c3028954d1e3e716cddc1cdce2ac63247/typing-3.7.4-py3-none-any.whl
Collecting base58 (from py2p)
  Downloading https://files.pythonhosted.org/packages/09/b2/21ac9591f055acc145afead895edeb73bbd69d95cf366fc5c2233f2434cb/base58-1.0.3-py3-none-any.whl
Collecting u-msgpack-python (from py2p)
  Downloading https://files.pythonhosted.org/packages/da/ec/9f984fc2be20b2b78bb4e7d9ee1a13f7868d2c075e812d7a1e0a8ef30142/u_msgpack_python-2.5.2-py2.py3-none-any.whl
Collecting pyee (from py2p)
  Downloading https://files.pythonhosted.org/packages/ad/d8/5608d571ffad3d7de0192b0b3099fe3f38d87c0817ebff3cee19264f0bc2/pyee-6.0.0-py2.py3-none-any.whl
Installing collected packages: typing, async-promises, custom-inherit, base58, u-msgpack-python, pyee, py2p
  Running setup.py install for async-promises ... done
  Running setup.py install for custom-inherit ... done
Successfully installed async-promises-1.1.1 base58-1.0.3 custom-inherit-2.2.0 py2p-0.7.878 pyee-6.0.0 typing-3.7.4 u-msgpack-python-2.5.2

But the error persists. Any idea?

LinusSkucas commented 5 years ago

Hi, What git commit are you on (the id). Also, what mycroft core version are you running?

On Aug 18, 2019, at 5:22 AM, Angel Docampo notifications@github.com wrote:

init

adocampo commented 5 years ago

I cloned the master version today, so I guess the id is a0ae13f. Mycroft core is also the latest, 19.2.14

adocampo commented 5 years ago

Well, I did nothing on my Mark I and it doesn't complain now when I say "Announce that "Dinner is ready"". I fact now it responds "Alright, I'll broadcast that to all your devices." or "I'm announcing that now" But I cannot hear anything on the other mycroft instances, instances where when I say "Announce that "Dinner is ready"" answer with the typical responses "I'm sorry, I don't understand" or "Please rephrase your request."

My Mark I is on wifi while the other mycroft instance is my computer on the same lan, but with ethernet cable. I will wait a while and restart mycroft-core several times on the computer to see if finally can communicate between them.

PS: on the computer's side, it seems to load the skill

21:01:48.569 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131
21:01:48.623 - Communications - INFO - Done connecting to device
21:01:49.281 - Communications - INFO - New Mycroft Communications device at: 192.168.1.10
21:01:49.287 - Communications - INFO - Done connecting to device

PS2: After a while, announces are working!!!!! :clinking_glasses:

LinusSkucas commented 5 years ago

Hmm, odd. Do you see anything interesting in your logs?

The skill did have a problem once with a computer because the skill was requesting the wrong interface…. I’ll have to look at what I did to solve it...

On Aug 20, 2019, at 12:02 PM, Angel Docampo notifications@github.com wrote:

Well, I did nothing on my Mark I and it doesn't complain now when I say "Announce that "Dinner is ready"". I fact now it responds "Alright, I'll broadcast that to all your devices." or "I'm announcing that now" But I cannot hear anything on the other mycroft instances, instances where when I say "Announce that "Dinner is ready"" answer with the typical responses "I'm sorry, I don't understand" or "Please rephrase your request."

My Mark I is on wifi while the other mycroft instance is my computer on the same lan, but with ethernet cable. I will wait a while and restart mycroft-core several times on the computer to see if finally can communicate between them.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LinusS1/communications-skill/issues/6?email_source=notifications&email_token=AEVDATFWPS4XVMY5IP2WLMLQFQ5PFA5CNFSM4IMSTM52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4XKQZQ#issuecomment-523151462, or mute the thread https://github.com/notifications/unsubscribe-auth/AEVDATC6RNENMVLZ7WDOUVTQFQ5PFANCNFSM4IMSTM5Q.

adocampo commented 5 years ago

arrrgggh, I went to make the dinner and now receiving computer doesn't receive the announce!!

After restarting mycroft-core on the computer twice, it began to work again... I see nothing of interest on the logs, they alway say

23:58:57.387 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131
23:58:57.409 - Communications - INFO - Done connecting to device
23:58:58.200 - Communications - INFO - New Mycroft Communications device at: 192.168.1.10
23:58:58.205 - Communications - INFO - Done connecting to device

But after a while, it stops announcing from Mark I

I also noticed the high CPU usage when this skill is loaded. Usually, mycroft-core python3 process uses 1 ~ 2% CPU, just by putting the skill on /opt/mycroft/skills and letting mycroft load it, CPU arises up to 12 ~ 13% usage (I'm on a i7 CPU)

On the Mark I is even worse, when the skill is loaded, mycroft-skills process eats a entire CPU of the RPi, while when it isn't loaded, CPU usage is between 16% to 30%.

Something is eating CPU cycles...

LinusSkucas commented 5 years ago

Are those two devices your computer and mark 1?

Do you see those lines on both devices?

On Aug 20, 2019, at 3:06 PM, Angel Docampo notifications@github.com wrote:

arrrgggh, I went to make the dinner and now receiving computer doesn't receive the announce!!

After restarting mycroft-core on the computer twice, it began to work again... I see nothing of interest on the logs, they alway say

23:58:57.387 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131 23:58:57.409 - Communications - INFO - Done connecting to device 23:58:58.200 - Communications - INFO - New Mycroft Communications device at: 192.168.1.10 23:58:58.205 - Communications - INFO - Done connecting to device But after a while, it stops announcing from Mark I

I also noticed the high CPU usage when this skill is loaded. Usually, mycroft-core python3 process uses 12% CPU, just by putting the skill on /opt/mycroft/skills and letting mycroft load it, CPU arises up to 1213% usage (I'm on a i7 CPU)

On the Mark I is even worse, when the skill is loaded, mycroft-skills process eats a entire CPU of the RPi, while when it isn't loaded, CPU usage is between 16% to 30%.

Something is eating CPU cycles...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LinusS1/communications-skill/issues/6?email_source=notifications&email_token=AEVDATAOK2VQ4RGSHV35LSTQFRTGXA5CNFSM4IMSTM52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4XZW7I#issuecomment-523213693, or mute the thread https://github.com/notifications/unsubscribe-auth/AEVDATFDYZA2A6RQU7F3YODQFRTGXANCNFSM4IMSTM5Q.

adocampo commented 5 years ago

Yes, those two devices are my Mark I (wlan0 192.168.1.131) and my computer (enp3s0 192.168.1.10), so the network interface names is working.

I've uninstalled the skill on both devices, just to confirm the CPU eating of the communications-skill, and re-added back. On the Mark I it seems to be loaded just fine, and only showed the message 00:58:57.387 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131

On the computer, the skill didn't log any output, so I restarted the mycroft-core on the computer The second attempt seems to show on both devices the log

01:08:50.455 - mycroft.skills.core:load_skill:151 - INFO - Loaded communications-skill
01:08:51.440 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131
01:08:51.477 - Communications - INFO - Done connecting to device
01:08:52.093 - Communications - INFO - New Mycroft Communications device at: 192.168.1.10
01:08:52.099 - Communications - INFO - Done connecting to device

But didn't work either, so I'd restarted the service on the computer once again, and then it worked.

01:09:28.520 - Communications - INFO - New intercom announcement incoming!: this is a test
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.25.11; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes

Directory: /home/malevolent/development/mycroft-core/mycroft/res/snd/
Playing MPEG stream 1 of 1: acknowledge.mp3 ...

MPEG 1.0 L III cbr128 44100 stereo

[0:00] Decoding of acknowledge.mp3 finished.
LinusSkucas commented 5 years ago

Oh wow… I’m learning all the interface names that computers have. Just to verify: the skill's working now, right?

I’m thinking that (especially for computers) I should add a config file so that when

On Aug 20, 2019, at 4:12 PM, Angel Docampo notifications@github.com wrote:

Yes, those two devices are my Mark I (wlan0 192.168.1.131) and my computer (enp3s0 192.168.1.10), so the network interface names is working.

I've uninstalled the skill on both devices, just to confirm the CPU eating of the communications-skill, and re-added back. On the Mark I it seems to be loaded just fine, and only showed the message 00:58:57.387 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131

On the computer, the skill didn't log any output, so I restarted the mycroft-core on the computer The second attempt seems to show on both devices the log

01:08:50.455 - mycroft.skills.core:load_skill:151 - INFO - Loaded communications-skill 01:08:51.440 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131 01:08:51.477 - Communications - INFO - Done connecting to device 01:08:52.093 - Communications - INFO - New Mycroft Communications device at: 192.168.1.10 01:08:52.099 - Communications - INFO - Done connecting to device But didn't work either, so I'd restarted the service on the computer once again, and then it worked.

01:09:28.520 - Communications - INFO - New intercom announcement incoming!: this is a test High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 version 1.25.11; written and copyright by Michael Hipp and others free software (LGPL) without any warranty but with best wishes

Directory: /home/malevolent/development/mycroft-core/mycroft/res/snd/ Playing MPEG stream 1 of 1: acknowledge.mp3 ...

MPEG 1.0 L III cbr128 44100 stereo

[0:00] Decoding of acknowledge.mp3 finished. — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LinusS1/communications-skill/issues/6?email_source=notifications&email_token=AEVDATASGAFROAMEPLRYLBLQFR26VA5CNFSM4IMSTM52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4X52MY#issuecomment-523230515, or mute the thread https://github.com/notifications/unsubscribe-auth/AEVDATEZ2BYHY2MMEFSHW73QFR26VANCNFSM4IMSTM5Q.

adocampo commented 5 years ago

Yes, it is working... I need to restart the core two or three times in order to make it work, sometimes seems to stop working without notice, and this skill is VERY CPU intensive, but it works :) and I love the user doesn't need to do anything in order to make it work (besides the opening of ports in the Mark I firewall )

El mié., 21 ago. 2019 1:42, Linus S notifications@github.com escribió:

Oh wow… I’m learning all the interface names that computers have. Just to verify: the skill's working now, right?

I’m thinking that (especially for computers) I should add a config file so that when

On Aug 20, 2019, at 4:12 PM, Angel Docampo notifications@github.com wrote:

Yes, those two devices are my Mark I (wlan0 192.168.1.131) and my computer (enp3s0 192.168.1.10), so the network interface names is working.

I've uninstalled the skill on both devices, just to confirm the CPU eating of the communications-skill, and re-added back. On the Mark I it seems to be loaded just fine, and only showed the message 00:58:57.387 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131

On the computer, the skill didn't log any output, so I restarted the mycroft-core on the computer The second attempt seems to show on both devices the log

01:08:50.455 - mycroft.skills.core:load_skill:151 - INFO - Loaded communications-skill 01:08:51.440 - Communications - INFO - New Mycroft Communications device at: 192.168.1.131 01:08:51.477 - Communications - INFO - Done connecting to device 01:08:52.093 - Communications - INFO - New Mycroft Communications device at: 192.168.1.10 01:08:52.099 - Communications - INFO - Done connecting to device But didn't work either, so I'd restarted the service on the computer once again, and then it worked.

01:09:28.520 - Communications - INFO - New intercom announcement incoming!: this is a test High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 version 1.25.11; written and copyright by Michael Hipp and others free software (LGPL) without any warranty but with best wishes

Directory: /home/malevolent/development/mycroft-core/mycroft/res/snd/ Playing MPEG stream 1 of 1: acknowledge.mp3 ...

MPEG 1.0 L III cbr128 44100 stereo

[0:00] Decoding of acknowledge.mp3 finished. — You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/LinusS1/communications-skill/issues/6?email_source=notifications&email_token=AEVDATASGAFROAMEPLRYLBLQFR26VA5CNFSM4IMSTM52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4X52MY#issuecomment-523230515>, or mute the thread < https://github.com/notifications/unsubscribe-auth/AEVDATEZ2BYHY2MMEFSHW73QFR26VANCNFSM4IMSTM5Q .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LinusS1/communications-skill/issues/6?email_source=notifications&email_token=AARJL5HBVNFFG5JOPEE557LQFR6MXA5CNFSM4IMSTM52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4X7MBI#issuecomment-523236869, or mute the thread https://github.com/notifications/unsubscribe-auth/AARJL5C2RTOZHHIAOCOWTITQFR6MXANCNFSM4IMSTM5Q .

LinusSkucas commented 5 years ago

okay thanks! Please let me know if this problem comes up again!

adocampo commented 5 years ago

Yes, the subject of this thread seems to be reproducible... I've installed it now on a Manjaro Linux (Arch Linux based distro) and the py2p error arises again. After restarting mycroft-core several times, I decided to wait... and I tried again 1h later. Then skill starts without error...

I'm not a python expert so, could it be some kind of cache and it complains of the py2p missing library even it is installed? Perhaps is something related to arch linux...

LinusSkucas commented 5 years ago

I bet that this is related to your environment - The skill works fine on picroft/mark 1

adocampo commented 5 years ago

Yes, you must be right, I didn't remember any problem on the Mark I. If I have the opportunity, I'll try it on another non-archlinux distro