Mycroft on FreeBSD

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?

You are sure you have all the stuff from the requirements.txt ?

Looks like you are still missing stuff…

1 Like

Yes. I collected a list with pip list > list.txt and compared this with the file requirements.txt. I now have everything install with one exception: pocketsphinx==0.1.0. This fails to compile with:

   clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -I/home/guru/Mycroft-test/mycroft-core/.venv/include -I/usr/local/include/python3.6m -c deps/sphinxbase/src/libsphinxbase/lm/lm_trie_quant.c -o build/temp.freebsd-13.0-CURRENT-amd64-3.6/deps/sphinxbase/src/libsphinxbase/lm/lm_trie_quant.o
    In file included from deps/sphinxbase/src/libsphinxbase/lm/lm_trie_quant.c:40:
    deps/sphinxbase/include/sphinxbase/prim_type.h:88:10: fatal error: 'sphinx_config.h' file not found
    #include <sphinx_config.h>
             ^~~~~~~~~~~~~~~~~
    1 error generated.

But, ./start-mycroft.sh debug works now, Mycroft does even listen to me and answers in audio,

1 Like

I have a clean patch file (diff -c output) which incorporates the FreeBSD related changes in

start-mycroft.sh
mimic/src/audio/au_alsa.c
dev_setup.sh
requirements.txt

To whom I should send this?

The best and easiest for Mycroft staff (IMHO) is to fork the mycroft-core repo and create a Pull Request.

Apart of git clone ... I’ve never done anything real with git, please help me with the required commends. Thanks.