Mycroft on FreeBSD

You’re very welcome - the no speech could be caused by the not working Pulseaudio daemon - which in turn is throwing this error :wink:

Hope you have a lovely vacation!

The pulseaudio is not starting at all (it’s crashing), also outside of Mycroft, see here:
https://lists.freebsd.org/pipermail/freebsd-questions/2018-November/283436.html

Hmmm :frowning: Sounds like this is more an issue of PulseAudio on FreeBSD rather than a Mycroft issue.

Of course, this is within FreeBSD (or the used ported software).

I have now updated my FreeBSD box to the bleeding edge (all from December 23, kernel and ports) and recompiled everything of Mycroft. Now cli is unwilling to start, it gives:

...
Starting cli
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/home/guru/Mycroft-test/mycroft-core/mycroft/__init__.py", line 17, in <module>
    from mycroft.api import Api
  File "/usr/home/guru/Mycroft-test/mycroft-core/mycroft/api/__init__.py", line 23, in <module>
    from mycroft.configuration import Configuration
  File "/usr/home/guru/Mycroft-test/mycroft-core/mycroft/configuration/__init__.py", line 15, in <module>
    from .config import Configuration, LocalConf, RemoteConf
  File "/usr/home/guru/Mycroft-test/mycroft-core/mycroft/configuration/config.py", line 23, in <module>
    from mycroft.util.json_helper import load_commented_json, merge_dict
  File "/usr/home/guru/Mycroft-test/mycroft-core/mycroft/util/__init__.py", line 39, in <module>
    from mycroft.util.parse import extract_datetime, extract_number, normalize
  File "/usr/home/guru/Mycroft-test/mycroft-core/mycroft/util/parse.py", line 18, in <module>
    from mycroft.util.time import now_local
  File "/usr/home/guru/Mycroft-test/mycroft-core/mycroft/util/time.py", line 18, in <module>
    from dateutil.tz import gettz, tzlocal
ModuleNotFoundError: No module named 'dateutil'

The followin py36 ports are installed:

root@c720-r342378:/usr/PKGDIR.20181223 # python3 --version
Python 3.6.7
root@c720-r342378:/usr/PKGDIR.20181223 # pkg info | grep py36
py36-cairo-1.14.1              Python 2 bindings for Cairo
py36-dateutil-2.7.3            Extensions to the standard Python datetime module
py36-dateutils-0.6.6_1         Various utilities for working with date and datetime objects
py36-gobject3-3.28.3           Common files for the Python bindings for GObject
py36-pytz-2018.7,1             World Timezone Definitions for Python
py36-setuptools-40.6.2         Python packages installer
py36-six-1.12.0                Python 2 and 3 compatibility utilities

What is missing?

Is this using a venv? If so is that the results from the venv?

I sourced before starting . ./venv-activate.sh. Is this your question? If not, please clarify.

yes…though it’s not showing the (venv) bit I’d usually expect to see there. If, as the mycroft user, you run python3, then do “import dateutil”, does that error out?

$ python3
Python 3.6.7 (default, Dec 24 2018, 12:25:59) 
[GCC 4.2.1 Compatible FreeBSD Clang 7.0.1 (tags/RELEASE_701/final 349250)] on freebsd13
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dateutil'

I mean, that’s pretty straightforward then. It can’t load that module, but not clear why. Try pip3 install dateutil (might be python-dateutil) as the mycroft user in the venv?

I did that before already, here’s what it says:

pip3 install dateutil
Collecting dateutil
  Could not find a version that satisfies the requirement dateutil (from versions: )
No matching distribution found for dateutil
You are using pip version 18.0, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

python-dateutil doesn’t work, either?

Also, potentially py-dateutil.

But, I have installed this module (see here post 55). I will check in the FreeBSD python community for this issue.

In post 55 I see that you might have it installed systemwide, but probably it is not installed within the VENV of mycroft, otherwise post 58 wouldn’t fail…

Repeat post 60 with;

pip3 install python-dateutil

But make sure you are in the VENV Mycroft is using.

Thanks, this worked and now the nex module is missing: ‘fasteners’

I now understand, that I shouldl first deal with the errors from
pip install -r requirements.txt
and come up with a complete FreeBSD package list which must be installed or checked by dev_setup.sh

I have deleted everything and did a fresh git clone. Based on this the run of ./dev_setup.sh (with modifications for FreeBSD) produces the following nohup.out file: http://www.unixarea.de/nohup.out
Can someone please have a look into and clarify this compilation error of C-code:

  gcc49 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_BSD=1 -DPSUTIL_VERSION=521 -DPSUTIL_FREEBSD=1 -I/home/guru/Mycroft-test/mycroft-core/.venv/include -I/usr/local/include/python3.6m -c psutil/arch/bsd/freebsd_socks.c -o build/temp.freebsd-13.0-CURRENT-amd64-3.6/psutil/arch/bsd/freebsd_socks.o
  psutil/arch/bsd/freebsd_socks.c: In function 'psutil_search_tcplist':
  psutil/arch/bsd/freebsd_socks.c:126:37: error: 'struct xtcpcb' has no member named 'xt_tp'
           tp = &((struct xtcpcb *)xig)->xt_tp;

if this is an issue wwith FreeBSD or Mycroft. I do not even find the source file to check the code in the source. From where this is unpacked?

Can you figure out at which step it is?

Is it some C code in one of the python requirements or perhaps Mimic1? If it is the former, you could check if there is a binary wheel for it instead of sources.

I finally have the cli running, but it does not respond on any utterance, for example Hey, Microft sing a song In the window of the cli I have the following lines after this command:

Establishing Mycroft Messagebus connection...                   
Connected to Messagebus!                                              
13:10:31.925 - mycroft.skills.core:load_skill:145 - INFO - Loaded mycroft-alarm.mycroftai
~~~~7 - INFO - ATTEMPTING TO LOAD SKILL: mycroft-singing.mycroftai with ID mycroft-singing.mycroftai
13:10:31.956 - SingingSkill - WARNING - self.emitter is deprecated switch to "self.bus"
13:10:31.958 - mycroft.skills.core:load_skill:145 - INFO - Loaded mycroft-singing.mycroftai
~~~~nt_service:handle_utterance:345 - ERROR - 'PadatiousService' object has no attribute 'container'
Traceback (most recent call last):                              
~~~~/guru/Mycroft-test/mycroft-core/mycroft/skills/intent_service.py", line 323, in handle_utterance
    utterances[0])                                 
~~~~me/guru/Mycroft-test/mycroft-core/mycroft/skills/padatious_service.py", line 146, in calc_intent
    return self.container.calc_intent(utt)
AttributeError: 'PadatiousService' object has no attribute 'container'
  ^--- NEWEST ---^                                                    

And the log files still have these errors which I don’t know how to solve:

$ grep ERROR /var/log/mycroft/*
/var/log/mycroft/audio.log:13:10:17.354 - mycroft.audio.audioservice:load_services:108 - ERROR - Failed to import module chromecast
/var/log/mycroft/audio.log:13:10:17.382 - mycroft.audio.audioservice:load_services:108 - ERROR - Failed to import module mplayer
/var/log/mycroft/audio.log:13:10:17.402 - mycroft.audio.audioservice:load_services:108 - ERROR - Failed to import module vlc
/var/log/mycroft/audio.log:13:12:06.990 - mycroft.messagebus.client.ws:on_error:83 - ERROR - Exception closing websocket: Exception("Uncaught 'error' event.",)
/var/log/mycroft/skills.log:13:10:16.274 - mycroft.skills.padatious_service:__init__:43 - ERROR - Padatious not installed. Please re-run dev_setup.sh
/var/log/mycroft/skills.log:13:10:59.009 - mycroft.skills.intent_service:handle_utterance:345 - ERROR - 'PadatiousService' object has no attribute 'container'
/var/log/mycroft/skills.log:13:12:06.936 - mycroft.messagebus.client.ws:on_error:83 - ERROR - Exception closing websocket: Exception("Uncaught 'error' event.",)
/var/log/mycroft/skills.log:13:12:11.945 - mycroft.messagebus.client.ws:on_error:76 - ERROR - === ConnectionRefusedError(61, 'Connection refused') ===
/var/log/mycroft/skills.log:13:12:11.953 - mycroft.messagebus.client.ws:on_error:83 - ERROR - Exception closing websocket: Exception("Uncaught 'error' event.",)
/var/log/mycroft/voice.log:13:10:31.059 - mycroft.client.speech.hotword_factory:initialize:293 - ERROR - Could not create hotword. Falling back to default.
/var/log/mycroft/voice.log:13:10:31.064 - mycroft.client.speech.hotword_factory:initialize:293 - ERROR - Could not create hotword. Falling back to default.

Any help on this?