Problems with installing Mycroft Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
GreenGentleman
Posts: 17
Joined: Mon Nov 09, 2020 4:10 pm

Problems with installing Mycroft

Post by GreenGentleman »

Hello! I'm new to Dietpi and Raspberry Pi in general. I'm using it for about a week, and got OwnCloud and Pi-Hole running. I'm using a Raspberry Pi 4. Today, I started the next project: Mycroft AI. I installed it as described in the guide here.

When I start the client, I get the following error for every single skill:

Image

I couldn't even pair my device. I assume the culprit is

Code: Select all

OSError: [Errno 18] Invalid cross-device link: '/tmp/tmpu_tbamtv' -> '/mnt/dietpi_userdata/mycroft-data/skills/mycroft-timer.mycroftai'
A bit of googling said that the error appears if it tries to create a symlink between two different devices, but this shouldn't be: I'm using a SD card and a portable HDD (mounted on /mnt/extern ), and this should all happen on the SD card.
I'm running the client as root.

I'm not sure if this problem is related to DietPi at all, but since it's an OSError, my first idea was to ask here.
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Problems with installing Mycroft

Post by Joulinar »

Hi,

many thanks for your message. I see some permission error on your screen print. (Last line). Pls can you have a look what permission are set?

BWT, next time copy/past the output from your SSH terminal. Contrast of the blue/black screen print is low and it's hard to read ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
GreenGentleman
Posts: 17
Joined: Mon Nov 09, 2020 4:10 pm

Re: Problems with installing Mycroft

Post by GreenGentleman »

Oh, yeah, of course. Sorry :D

Code: Select all

 16:08:18.945 | INFO     | 18698 | msm.skill_entry | Problem performing action. Restoring skill to previous state...
 16:08:18.945 | INFO     | 18698 | msm.mycroft_skills_manager | invalidating skills cache
 16:08:18.951 | WARNING  | 18698 | mycroft.skills.skill_updater:install_or_update:221 | Failed to install default skill: mycroft-weather
 16:08:18.952 | ERROR    | 18698 | msm.mycroft_skills_manager | Error running install_or_update on mycroft-weather:
Traceback (most recent call last):
  File "/usr/lib/python3.7/shutil.py", line 563, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/tmpl019bk89' -> '/mnt/dietpi_userdata/mycroft-data/skills/mycroft-weather.mycroftai'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/dietpi_userdata/mycroft-core/.venv/lib/python3.7/site-packages/msm/mycroft_skills_manager.py", line 461, in run_item
    func(skill)
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/skills/skill_updater.py", line 217, in install_or_update
    self.msm.install(skill, origin='default')
  File "/mnt/dietpi_userdata/mycroft-core/.venv/lib/python3.7/site-packages/msm/mycroft_skills_manager.py", line 73, in func_wrapper
    ret = func(self, *args, **kwargs)
  File "/mnt/dietpi_userdata/mycroft-core/.venv/lib/python3.7/site-packages/msm/mycroft_skills_manager.py", line 376, in install
    skill.install(constraints)
  File "/mnt/dietpi_userdata/mycroft-core/.venv/lib/python3.7/site-packages/msm/skill_entry.py", line 82, in wrapper
    func(self, *args, **kwargs)
  File "/mnt/dietpi_userdata/mycroft-core/.venv/lib/python3.7/site-packages/msm/skill_entry.py", line 479, in install
    move(tmp_location, self.path)
  File "/usr/lib/python3.7/shutil.py", line 574, in move
    symlinks=True)
  File "/usr/lib/python3.7/shutil.py", line 321, in copytree
    os.makedirs(dst)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/mnt/dietpi_userdata/mycroft-data/skills/mycroft-weather.mycroftai'
 16:08:19.033 | INFO     | 18698 | mycroft.skills.skill_updater:_log_next_download_time:265 | Next scheduled skill update: 2020-11-09 16:13:19.031303

The PermissionError refers to a folder that does not exist.

Code: Select all

root@DietPi:~# ls -l /mnt/dietpi_userdata/mycroft-data/skills/mycroft-weather.mycroftai
ls: cannot access '/mnt/dietpi_userdata/mycroft-data/skills/mycroft-weather.mycroftai': No such file or directory
root@DietPi:~# ls -l /mnt/dietpi_userdata/mycroft-data/skills/
total 0
root@DietPi:~# ls -l /mnt/dietpi_userdata/mycroft-data/
total 4
drwxr-xr-x 2 root root 4096 Nov  9 15:19 skills
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Problems with installing Mycroft

Post by Joulinar »

ok that's the issue. skills folder is owned by root. Therefore mycroft is not able to write data on it. pls do

Code: Select all

systemctl stop mycroft.service
chown mycroft:mycroft /mnt/dietpi_userdata/mycroft-data/skills/
systemctl start mycroft.service
mycroft-cli-client
Now you should see skills to be installed.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
GreenGentleman
Posts: 17
Joined: Mon Nov 09, 2020 4:10 pm

Re: Problems with installing Mycroft

Post by GreenGentleman »

This solved my problem, thank you very much! I could pair the device now and skills loaded.

I've noticed to more problems:

There's no sound output. I'm not sure where the problem is here, Pulseaudio was installed with Mycroft, but I'll look into it.

My OwnCloud isn't reachable anymore. The client says the responses are empty. Since it worked right before the installation of Mycroft, I assume it's somehow related, but I don't see how yet. I'm routing all incoming https traffic to my Pi.
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Problems with installing Mycroft

Post by Joulinar »

Are you running RPi4 and try to get sound via 3.5 jack??

Maybe this link could help https://github.com/MichaIng/DietPi/issues/3887

and pls check if Audio is activated on dietpi-config
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
GreenGentleman
Posts: 17
Joined: Mon Nov 09, 2020 4:10 pm

Re: Problems with installing Mycroft

Post by GreenGentleman »

I'm running RPi4, audio via headphone jack. No HDMI.

Code: Select all

root@DietPi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7

Code: Select all

root@DietPi:~# cat /etc/asound.conf
pcm.!default {
        type hw
        card 0
        device 0
}

ctl.!default {
        type hw
        card 1
}


Starting the Mycroft Audio Test:

Code: Select all

root@DietPi:~# mycroft-start audiotest.conf
Already up to date.
Initializing...
Starting audiotest
 ========================== Info ===========================
 Input device: Default device @ Sample rate: 48000 Hz
 Playback commandline: aplay WAV_FILE

 ===========================================================
 ==         STARTING TO RECORD, MAKE SOME NOISE!          ==
 ===========================================================
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/util/audio_test.py", line 132, in <module>
    main()
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/util/audio_test.py", line 119, in main
    record(args.filename, args.duration)
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/util/audio_test.py", line 66, in record
    with mic as source:
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/client/speech/mic.py", line 140, in __enter__
    return self._start()
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/client/speech/mic.py", line 151, in _start
    input=True,  # stream is an input stream
  File "/mnt/dietpi_userdata/mycroft-core/.venv/lib/python3.7/site-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/mnt/dietpi_userdata/mycroft-core/.venv/lib/python3.7/site-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
OSError: [Errno -9996] Invalid input device (no default output device)

I tried changing the Soundcard in dietpi-config, but no changes. Currently, it's set on [rpi-bcm2835-3.5mm].
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Problems with installing Mycroft

Post by Joulinar »

let's do following and try again

Code: Select all

sed -i 's/card 1/card 0/' /etc/asound.conf
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
GreenGentleman
Posts: 17
Joined: Mon Nov 09, 2020 4:10 pm

Re: Problems with installing Mycroft

Post by GreenGentleman »

Same problem.

speaker-test produces noise, though.
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Problems with installing Mycroft

Post by Joulinar »

let's ask the developer. @MichaIng any ideas regarding missing sound via jack 3.5
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply