Picroft fresh boot - only two skills load

I tried clearing the skills directory and it didn’t seem to help. The output of msm seemed normal; it downloaded / installed every skill without any issues.

Running ls -l on the .skills-repo showed oddly that the owner/group is pi and not mycroft.
There are a few files (e.g. test-requirements.txt and mycroft.svg) with -rw-r–r-- instead of drwxr-xr-x but I presume that is normal.

I’m not sure how to change the owner/group, however. Running sudo chown mycroft:mycroft .skills-repo gives “invalid user: mycroft:mycroft”.

Lastly, the DEFAULT-SKILLS file seems to list all the expected skills, although fallback-aiml is commented out.

Thanks.

I thing @gez-mycroft mybe are wrong - on picroft the user would be pi both in /opt/mycroft/skills nnd /opt/mycroft/.skills-repo

What model of RaspberryPi are you using ? maybe that is the problem…

What I do when I reflash a pi is something lige this:
Boot and login with ssh pi@picroft

Ctrl+C to exit startupscript

update entiere system by sudo apt-get update and sudo apt-get upgrade and then sudo reboot.

after boot login by ssh and follow the setup guide and get to the cli and pair. Then some more reboots as picroft will temt to opdate mycroft to latest version. If I am not patient Ill sk him what version, and he vill tell nnd ask if he should update :slight_smile:

It weorks for me every time, so why it dosnt for you only reasons I can think of

  • is bad internet connection

  • bad flashing of the sdcard

  • bad sdcard

  • old or to small Raspberry pi whit to little memmory.

1 Like

I believe I am working on a Raspberry Pi 3 Model B V1.2.

I’ve tried this on two different SD cards, and tried reflashing the image. Neither seems to help.

I do have a weak internet connection, however, and sometimes this causes the client to stall (when messagebus fails to make a connection a few times, the client becomes unresponsive for some reason), but I have managed to pair and try out the Volume skill a number of times. Also, I have a Mark 1 which is working fine on the same internet connection.

Thanks.

Sorry I was wrong about the file owner, it should be pi.

Is it still the same two skills that are working? Pairing and volume?

Can you try to invoke some others like “Hey Mycroft, what time is it?” then post the voice and skills logs in a pastebin?

Yep, it is always the pairing and volume skills that work.

As for the logs, I ran the client with new logs:

skills log: https://pastebin.com/npnRZJXK
voice log: https://pastebin.com/rTUwLfnb

Just to note, I had a few unrelated errors that show up as well. In particular,

  1. there were some issues establishing a messagebus connection;
  2. for some reason I had to reinstall pulseaudio (it was showing up as not installed), which is why the volume skill has a processing error at one point.

For reference, I tried the volume, time, and joke skills.

Thanks.

Hey thanks for the logs, it looks like you’ve also got a problem with ALSA on your machine. When the volume skill tries to import the ALSA mixer, it fails with this error:
VolumeSkill - ERROR - Couldn't allocate mixer, ALSAAudioError('Unable to find mixer control Master,0 [default]',)

This may be blocking the other skills from loading.

Can you run: start-mycroft.sh audiotest -l
and post the list of devices back here.

Then run: amixer
and post the full output.

Also see if you are able to run alsamixer - it should give you screen that looks like this.

The “Unable to find mixer control Master” is a known issue with the stretch RPI rasbian, as it does not have a Master but a PCM. I believe this brach fixes that part, but needs testing;

However that is not the issue as it only prevents you from setting the volume.

The issue is I believe that the messagebus falls on it’s knees and therefor the other services including the skills service are halted before all downloads are ready.

I see some ALSA invalid sample rate stuff, so perhaps you should have a look at this thread;

Sorry, I think the mixer allocation issue and the “Invalid sample rate” were from before I installed/reinstalled pulseaudio. I tried clearing the logs and re-doing everything (after resolving the pulseaudio and connection issues) and the logs don’t seem to have that. Mea culpa, I should have just done that in the first place.

New logs
skills: https://pastebin.com/9u4uN6h0
voice: https://pastebin.com/rZp4yMvG

I am still having an issue with amixer, which at startup says “Unable to find simple control ‘PCM’,0” . Additionally, amixer does for some reason still say it is using Master:

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 1 [0%] [on]
  Front Right: Playback 1 [0%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined
  Capture channels: Mono
  Limits: Capture 0 - 65536
  Mono: Capture 26281 [40%] [on]

As for the audiotest, I could only capture the following output (there were a number of ALSA lib errors, which fortunately seem to show up in the logs):

Index	Device Name
 2:	 USB PnP Sound Device: Audio (hw:1, 0)
 5:	 default

Input device: Default device @ sample rate: 16000 Hz
Playback commandline: aplay -Dhw:0,0 WAV_FILE

Lastly, I am able to run alsamixer fine. Interestingly, it gives me three options for sound cards: PulseAudio, bcm2835 ALSA, and USB PnP Sound Device. I’m not sure what’s up with that. The default is PulseAudio, but I could have sworn I was using bcm2835 ALSA before. It also lists item as Master when I thought it said PCM before (this might just reflect my lack of understanding of the display).

Thanks.

Thanks @j1nx that certainly looks connected, I’ll see if we can get that update to skill-volume validated and pushed out.

@jmaibach - I’m assuming the soundtest didn’t allow you to record a sample and play it back?

Let’s try a few things in order of how easy they are and see if it is working after each.

  1. Switch sound card in alsamixer
    In alsamixer, hit F6 to select sound card and choose the USB PnP device. This will set it as your default card in ALSA which should cause everything else to use it as default.
    Rerun the ./start-mycroft.sh soundtest -l and see if it lets you record.

  2. Setting your default device via mycroft.conf
    Follow these instructions regarding USB devices
    Worth a reboot after this to ensure the new configuration is adopted.

  3. Editing your ALSA config
    nano ~/.asoundrc
    This is likely empty as it usually doesn’t exist. We’re creating a user level config to override the system level, thus if it creates any problems or just doesn’t work, we can simply delete it.
    Then is you want the USB device as both input and output you’d put the following in the file:

pcm.!default { 
    type asym playback.pcm { type plug slave.pcm “hw:1” }
    capture.pcm { type plug slave.pcm “hw:1” }
    }
  1. Changing your pulse settings
    I don’t think this will work, but if none of the above does it’s worth trying the Pulse troubleshooting steps here

@gez-mycroft Sorry, I meant to mention that the sound test worked fine.

Yeah right, that changes things…

Are you using the stable or unstable build at the moment?
Unstable is from 2018-12-17 whilst the stable build will be labelled 2018-09-12.

I’ve been hearing more trouble with the unstable build recently so if you are running that one, I’d try downloading the stable image and see if that resolves the problem.

If you’re already using stable, you could still try number 3 in the post above, but I wouldn’t bother with the others.

As J1nx said, there is also an update to the volume skill coming that may solve all this too. It does still need to go through testing, as we don’t want to create more issues than we solve. I will let you know when that should be coming out to devices, which should download automatically.

The image I flashed was of the stable build. However, I just tried running mycroft-use stable to check; it said I’m already on stable, but threw an error message as well:
cat: /etc/apt/sources.list.d/repo.mycroft.ai.list: No such file or directory
Hopefully that is incidental.

I created the .asoundrc file, but unfortunately it doesn’t seem to solve the problem. After rebooting, the error “Unable to find simple control ‘PCM’,0” is still there, and still only the two skills load.

Is there a way I could disable the volume skill altogether and see if the other skills will load? I imagine that simply deactivating it from the console is insufficient.

Sorry, I meant the command line client, not the console.

Well that’s interesting you can add the stable repo with:
echo "deb http://repo.mycroft.ai/repos/apt/debian debian main" >> /etc/apt/sources.list.d/repo.mycroft.ai.list

then rerun mycroft-use stable

To be honest, I’m not sure what the effect of fully removing the volume skill would be. To test that you’d need to run mycroft-msm remove mycroft-volume.mycroftai
and as it’s a default skill, to stop it returning you can add it as a blacklisted skill to your mycroft.conf
"blacklisted_skills": ["mycroft-volume.mycroftai"],

Good news! I was able to get other skills to load.

I disabled the volume skill by removing from the priority skills. It seems like picroft only wants to load the priority skills, so I put count and mycroft-weather in priority, and both loaded successfully.

However, I did have to re-delete the .skills-repo first. For some reason, even when I reboot it does not reload skills; rather deleting the .skills-repo is the only way to change what is loaded.

Notably, even though both skills claim to have loaded, only the weather skill is working. When I try the count skill, I get the “please wait a moment” message along with the ‘failed to find intent’ error.

Thanks for all the help! I’ll try and figure out the remaining issues and post later.

1 Like

That is good news. But it is sertenly strange that you cant get a picroft to boot up without problems.

1 Like

Yay for progress!

It does sound like there’s some more fundamental problems happening though. If you have a spare micro SD card it would be great to try a fresh image and see if you have the same problem.

1 Like

I do have an old SD I flashed with the unstable version (18.8.11), which is where I originally was having the issues. I tried the same fix on it, which worked. Additionally, the skills log looks very similar.

For comparison:
(unstable) skills.log: https://pastebin.com/wZ6p2X6L
(stable) skills.log: https://pastebin.com/nfinfyi9

The similarities seem to be:

  1. the many git.cmd calls
  2. messagebus.client.ws calling remove and on_error
  3. the python exception in skills_manager.py at the end of the log:
    “AttributeError: ‘MycroftSkillsManager’ object has no attribute ‘lock’”

I’m pretty sure #2 is just the web-connection issue, but #3 seems potentially relevant. I’ll have to track down msm.lock (the attribute which apparently does not exist) since I couldn’t find it last time I looked into mycroft-core.

Also, it doesn’t seem like the issue is with the volume skill, since I was able to get the other skills to load without disabling it.

I think focus should be on the ERRORS in the log

20:43:26.341 - mycroft.skills.settings:_poll_skill_settings:389 - ERROR - Failed to fetch skill settings: FileNotFoundError(2, 'No such file or directory')
20:48:13.622 - mycroft.messagebus.client.ws:on_error:76 - ERROR - === ConnectionResetError(104, 'Connection reset by peer') ===
20:48:13.639 - mycroft.messagebus.client.ws:on_error:83 - ERROR - Exception closing websocket: Exception("Uncaught 'error' event.",)
20:48:13.651 - mycroft.skills.skill_manager:stop:526 - ERROR - Shutting down skill: /opt/mycroft/skills/mycroft-version-checker.mycroftai
20:48:13.701 - mycroft.skills.skill_manager:stop:526 - ERROR - Shutting down skill: /opt/mycroft/skills/mycroft-audio-record.mycroftai
20:48:13.707 - mycroft.skills.skill_manager:stop:526 - ERROR - Shutting down skill: /opt/mycroft/skills/mycroft-configuration.mycroftai
20:48:13.751 - mycroft.skills.skill_manager:stop:526 - ERROR - Shutting down skill: /opt/mycroft/skills/count.andlo
20:48:13.816 - mycroft.skills.skill_manager:stop:526 - ERROR - Shutting down skill: /opt/mycroft/skills/mycroft-weather.mycroftai
20:48:13.822 - mycroft.skills.skill_manager:stop:526 - ERROR - Shutting down skill: /opt/mycroft/skills/mycroft-date-time.mycroftai
20:48:13.864 - mycroft.skills.skill_manager:stop:526 - ERROR - Shutting down skill: /opt/mycroft/skills/mycroft-pairing.mycroftai

``Mainly the first ERROR found looks interesting.
following that line is this:

  File "/home/pi/mycroft-core/mycroft/skills/settings.py", line 382, in _poll_skill_settings
    self.initialize_remote_settings()
  File "/home/pi/mycroft-core/mycroft/skills/settings.py", line 156, in initialize_remote_settings
    self.save_skill_settings(skill_settings)
  File "/home/pi/mycroft-core/mycroft/skills/settings.py", line 224, in save_skill_settings
    self._save_uuid(skill_settings['uuid'])
  File "/home/pi/mycroft-core/mycroft/skills/settings.py", line 259, in _save_uuid
    with open(uuid_file, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/.mycroft/skills/TimeSkill/uuid'

Why a fresh install should have this kind of errors i dont understand…but could be that you earlier had a working mycroft, and had used the timerskill to set an alarm?
And maybe that setting is tored on home.mycroft.ai and at initialasion is fetched down, and as the timerskill isnt yet installed and setup tehre is an errro.

If that is the reason - then try make making the directory /home/pi/.mycroft/skills/TimeSkill/ and restart mycroft.

I have opened a issue on mycroft-core about this error. #1986 https://github.com/MycroftAI/mycroft-core/issues/1986

I also did try to make a PR that could fix it, but I am not that good githubber so cant figure out how to do that without also making a PR with other changes :frowning:

Please let us know if adding the directry helped in any way.

1 Like