Mycroft installer broken?

Hey guys,

Just running a fresh install of DietPi v7.6.2 on my Raspberry Pi 4 and I’ve run into a glitch with the DietPi-optimized Mycroft installer.
It runs fine until the prompt for PocketSphinx comes up:

                    Welcome to Mycroft!  

This script is designed to make working with Mycroft easy.  During this
first run of dev_setup we will ask you a few questions to help setup
your environment.

The Precise Wake Word Engine requires the AVX instruction set, which is
not supported on your CPU. Do you want to fall back to the PocketSphinx
engine? Advanced users can build the precise engine with an older
version of TensorFlow (v1.13) if desired and change use_precise to true
in mycroft.conf.
  Y)es, I want to use the PocketSphinx engine or my own.
  N)o, stop the installation.
Choice [Y/N]:

If I select Yes, it fails:

Any ideas?

hmm I did a test installation and Mycroft installer was working as expected

[ INFO ] DietPi-Software | sudo -u mycroft ./ -sm, please wait...

                    Welcome to Mycroft!

This script is designed to make working with Mycroft easy.  During this
first run of dev_setup we will ask you a few questions to help setup
your environment.

Do you want to run on 'master' or against a dev branch?  Unless you are
a developer modifying mycroft-core itself, you should run on the
'master' branch.  It is updated bi-weekly with a stable release.
  Y)es, run on the stable 'master' branch
  N)o, I want to run unstable branches
Choice [Y/N]:  Y - using 'master' branch
Already on 'master'
Your branch is up to date with 'origin/master'.

Mycroft is actively developed and constantly evolving.  It is recommended
that you update regularly.  Would you like to automatically update
whenever launching Mycroft?  This is highly recommended, especially for
those running against the 'master' branch.
  Y)es, automatically check for updates
  N)o, I will be responsible for keeping Mycroft updated.
Choice [Y/N]:  Y - update automatically

There are several Mycroft helper commands in the bin folder.  These
can be added to your system PATH, making it simpler to use Mycroft.
Would you like this to be added to your PATH in the .profile?
Choice [Y/N]:  Y - Adding Mycroft commands to your PATH
Type mycroft-help to see available commands.

The standard location for Mycroft skills is under /opt/mycroft/skills.
For convenience, a soft link has been created called 'skills' which leads
to /opt/mycroft/skills.

(Developer) Do you want to automatically check code-style when submitting code.
If unsure answer yes.

Choice [Y/N]: Will install PEP8 pre-commit hook...

Interactive portion complete, now installing dependencies...

Interesting point, the question you got are different from what I have seen :thinking:

Could you share some more system details pls

Required Information

  • DietPi version | cat /boot/dietpi/.version
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
  • Kernel version | uname -a
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

Thanks for trying on your end Joulinar.
What version are you running?

It loos like your Mycroft install prompt didn’t warn you about not having AVX support? Which is when I’m prompted to fallback to PocketSphinx and the install script fails from there.

I am on RPi 4 8GB, so aarch64bit

$ cat /boot/dietpi/.version
G_LIVE_PATCH_STATUS[0]='not applicable'

bullseye 0

$ uname -a
Linux DietStack 5.10.63-v8+ #1457 SMP PREEMPT Tue Sep 28 11:27:02 BST 2021 aarch64 GNU/Linux

RPi 4 Model B (aarch64)

Digging through the setup file on GitHub, it seems they’ve changed the AVX/Pocketsphinx prompt last month to accommodate aarch64.

    # The AVX instruction set is an x86 construct
    # ARM has a range of equivalents, unsure which are (un)supported by TF.
    if ! grep -q avx /proc/cpuinfo && ! [[ $(uname -m) == 'arm'* || $(uname -m) == 'aarch64' ]]; then
      echo "
The Precise Wake Word Engine requires the AVX instruction set, which is
not supported on your CPU. [...]

So that explains the new prompt, but as for the install failing (the error from my original post):

bash: line1: jq: command not found

It looks like there’s a bug in the script where jq is called to write some json to file before it’s actually installed later as a dependency.

Line 194:

$SUDO bash -c 'jq ". + { \"use_precise\": true }" /etc/mycroft/mycroft.conf > tmp.mycroft.conf'

Line 468:


Looks like that line is mangled though:

parse error: Invalid numeric literal at line 1, column 3

Assuming a fresh install, a workaround I’ve found for now is to run the installer until the AVX/Pocketsphinx prompt, create a backup of the mycroft.conf file, delete the original, continue the installer until next prompt and then restore the mycroft.conf file. This just bypasses that if statement with jq.Or of course you could always install from source and modify the script.

I’m working on a pull request and I’ve submitted an issue to the Mycroft GitHub.

Ah yeah I tested on 32bit. Perfect you are going to submit a PR on Mycroft GitHub. :smiley:

Hey all. Submitted the pull-request here if any interested:

Turns out, the AVX on aarch64 problem is already fixed on the dev branch.
but you may run into it anyway if you elect to use the ‘master’ branch when prompted by the installer (as the official DietPi documentation recommends). It changes branches mid-install, but after the AVX check. If you cancel the install after switching branches and run it again later, you’ll be wrongly prompted that your system doesn’t support AVX. Hopefully this existing fix will be merged into master soon.

I did still end up writing a fix to solve the jq dependency issue for those actually running Intel/AMD without AVX support (unfortunately, probably very few users here! :rofl:’ ). It was also wrongly setting use_precise to ‘true’ instead of ‘false’ in mycroft.conf, so that should be good now.

thx for sharing and contributing to this issue at Mycroft GitHub :sunglasses: