Mycroft Community Forum

MycroftOS - A bare minimal (production type of) OS based on Buildroot

Can use some help from the experts / guru’s. Running into some monkey business and just don’t see it anymore ?!

Running the services does not adhere the population of “~/” for the location of the configuration file within the users it home directory. It is most likely not a Mycroft issues, more like a busybox init issue, but who knows you guys see it. (getting a bit blind for that stuff atm)

A first (very) early alpha release is ready. Still a lot of things to fix/change/create/etc however it looks like I have all Mycroft stuff working one way or the other. I could use some feedback, both positive as negative.

So if you have some free/spare time and a spare SD card, please give it a go and let me know your thoughts. However please have a look at the information section as this is like I said a very early release and still have some quircks.

MycroftOS_0.1_rpi3_alpha2

You can download the image in 7z archive which is about 180 MB in size here;
https://j1nx.stackstorage.com/s/diuT4DeeB0UBR9L

In case you can’t handle the 7z archive, an uncrompressed IMG file which can be written to SD card straight away here (however this file takes a bit longer to download with it’s size of 1 GB);
https://j1nx.stackstorage.com/s/Uaaigj4a0iNH9WE

If you are interested in the development, or want to check or build it yourself. All sources are available on github;

Information

  • Linux kernel 4.14 (LT)
  • Buildroot 2018.11.x
  • Mycroft 18.08.11
  • Raspberry Pi 3B

I have a Raspberry Pi 3B, but I believe it should also boot and work on the normal RPi3 and RPi3B+. If you have one of those, please by all means give it a go and report back to me.

Quircks

The system has the LAN configured for DHCP. Wifi has not yet been covered. So first boot with a LAN cable connected.

Find the IP of the device by any method you like. You can SSH into the box. The default credentials are;

  • user: root
  • passwd: mycroft

Change the password by the normal linux command; “passwd” !!!

If you rather want to use the wifi, you need to manually edit the wpa_supplicant.conf file. In the next version, this will be handled by advertising the device as a hotspot;

The filesystem is 1GB in size and the plan is to have this to be auto-expanded at first boot. However, that part is still one of the quircks. However you can run the script manually and then it works ?!? SSH into the device and run the command;

  • /etc/init.d/S00resize_sdcard start

This should expand the filesystem over the whole size of the SD card.

This image also has the drivers for the ReSpeaker HAT, so if you have one of those, again by all means give it a go and let me know the outcome. HOWEVER;

I have no clue if standard USB microphones are working and that is where “you” come in. I will have a look to buy some of the mostly used mic’s but until then, you can see if you a) they work out of the box, or b) configure them manually over SSH and let me know the steps.

Bare in mind that at the very first boot, Mycroft does start but also is downloading all the default skills. So first boot takes a bit longer. The default 3.5 jack of the RPi is configured as default and Mimic is available locally, so at some point you will hear the famous robotic words; I need to be activated, blah blah.

One other quirck that is still there is the issue with ncurses. The Mycroft CLI does not look good, however it does work. Pure cosmetics…

The standard scripts to start/stop Mycroft are available so you clould easily SSH into the box and run the ;

  • start-mycroft all
  • start-mycroft debug
  • start-mycroft cli
  • stop-mycroft all
  • etc

Please feel free to report any issues here or even better on the issue tracking of Github. Puul Requests are welcome as I am the only developer at the moment.

Enjoy!

7 Likes

@gez-mycroft I wasn’t aware of the “modding” section on the forums. I believe that is a better section for this topic to be placed. (I am developing on the RPi atm, but has nothing todo with picroft other then that)

Is it possible this topic get’s moved over there?

1 Like

Hi, I don’t have anything important to add other than I wanted to say great work and I’m glad you’re working on this. Every last drop of performance we can get out of a Pi will help the experience.

How is it progressing since the last post? Also, how much work do you think would be required to get this working on different boards than Pi?

Thanks, much appreciated. To answer your questions;

  1. Progress, well not much or nothing at all. At the moment my daytime job is consuming most of my time. The small bits of time left are spent on the family and getting my Home Assisant installation up to specs.

  2. Adding other boards would be rather “simple”. As long as the linux kernel sources are available, they should be easy to add. You could consider MycroftOS (Buildroot) as the overlay filesystem / OS. So if the kernel and drivers are available and the right confguration files are made, it should be easy to support more devices. As other projects using Buildroot are also supporting them, here is an initial list of possible boards that could be integrated as soon as the rest of the OS is in a workable state;

2 Likes

I need a bit of help, because I think my RPi development board has a broken WiFi/BT of some kind. Never ever used the WiFi so far, other then some quick testing with raspbian when the PI arrived. Quickly switched to a LAN conection and did not look back.

However, for MycroftOS I am now at the step to have a go at the wifi/network setup wizard system and could not get the wifi up. Thought is has something todo with software as that is what MycroftOS is all about. However after countless tries, I finally was smart enough to flash a fresh raspbian image and also no wifi there…

So I have pushed the current state of MycroftOS online to download for someone that is willing to help me out a bit. You can download it here;

https://www.j1nx.nl/downloads/mycroftos-0-1-0-alpha3-rpi3/

If anyone has some time, a RPI3 and a SD card available, could you please download and flash the image to boot into MycroftOS. WiFi is not configured, so you need a LAN cable as well.

So in short;

  • Download and flash image to SD card
  • Boot the RPI
  • Wait a bit as the first boot prepares some stuff including expanding the image over the SD
  • SSH into the RPI over the LAN and it’s IP it got/have
  • log in with; mycroft/mycroft

If someone could then give me the output of the command “dmseg”

Secondly. What happens is you run the command “sudo ifconfig wlan0 up”

Hope someone can help me out a bit here.

According to my experience in Europe I would suggest you to look at the Picroft Installation and edit the wpa_supplicant.conf file manually, as I did.

You might change your wpa_supplicant.conf`

country=US <-- to you country code NL
network={
        ssid="MyNetworkSSID"
        psk="mypassword"
}

Thanks, but that is not what this is about. This is about the kernel not seeing / initiating the wifi hardware.

Even if i load the kernel driver itself manually, all it does is loading the firmware, but is does not see the chip, so you can’t bring it up nor configure it. At this point I am down to two possible causes;

  1. Missing/wrong DTB overlay
  2. Hardware failure

Considering the fact that a fresh raspbian also doesn’t initiate the hardware I suspect it is caused by the 2nd. But to make sure, I need to test it on a second RPI. The problem is, I have only one myself.

I have uploaded a new alpha version for people to test. This is the fourth alpha version.

Information

  • Linux kernel 4.19.x
  • Buildroot 2019.11.x
  • Mycroft 19.08.4
  • Raspberry Pi 3/3B/3B+/(4)

I have a Raspberry Pi 3B, but I believe it should also boot and work on the normal RPi3 and RPi3B+. If you have one of those, please by all means give it a go and report back to me.

With Buildroot 2019.11.x there is also Raspberry Pi 4 support. I compiled it blind for the RPI4, so untested. If you feel adventurous you could give it a go. Again, please report back, both positive and negative.

At the very first boot, the OS get’s expanded over the full size of the SD card and Mycroft when started will first download and install all default skills including all the python packages via the requirements.txt within all those skills.

All sound input and output is forced to PulseAudio which has Acoustic Echo Cancellation enabled.

ReSpeaker RPI HAT’s are supported, all tested with my 4Mic HAT, but the 2Mic, 4Mic lineair and 6Mic should be supported as well.

Quircks

The system has the LAN configured for DHCP. Wifi has still not yet been covered. So first boot with a LAN cable connected. WiFi setup manager is very high on the todo list and a requirement before I can call the next version “beta”

Find the IP of the device by any method you like. You can SSH into the box. The default credentials are;

  • user: mycroft
  • passwd: mycroft

Change the password by the normal linux command; “passwd” !!!

If you rather want to use the wifi, you need to manually edit the wpa_supplicant.conf file over SSH, so you need to boot with a LAN cable first.

Downloads

Raspberry Pi 3
https://www.j1nx.nl/downloads/mycroftos-0-1-0-alpha4-rpi3/
https://j1nx.stackstorage.com/s/dqXgcQp058T8vhi

Raspberry Pi4
https://www.j1nx.nl/downloads/mycroftos-0-1-0-alpha4-rpi4/
https://j1nx.stackstorage.com/s/nkMNt1OngmTzn2C

1 Like

Hmmm, strange. If you click the j1nx.nl redirect link, it doesn’t proper redirect, while if you copy&paste the link, it works ?!?! (Perhaps an issue with the forum upgrade)

Anyhow, included the redirect links in above post.

EDIT: IMages can also be downloaded from github

Gave it a quick try on my RPI3b with AIY-VoiceKit:

Wifi does not come up (changed wpa_supplicant of course)

No sound (obviously as AIY-VoiceKit is not supported yet)

mycroft-cli-client fails with error message:

  File "/bin/mycroft-cli-client", line 11, in <module>
    load_entry_point('mycroft-core==19.8.4', 'console_scripts', 'mycroft-cli-client')()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.8/site-packages/mycroft/client/text/__main__.py", line 21, in <module>
    from .text_client import (
  File "/usr/lib/python3.8/site-packages/mycroft/client/text/text_client.py", line 39, in <module>
    locale.setlocale(locale.LC_ALL, "")  # Set LC_ALL to user default
  File "/usr/lib/python3.8/locale.py", line 608, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

here is output of locale

LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

how does it know that I am from Germany ?

command export LC_ALL="C" helped, now CLI is coming up and i could successfully pair the device

msm install picroft-google-aiy fails with

ERROR: Could not find a version that satisfies the requirement RPi.GPIO (from versions: none)
ERROR: No matching distribution found for RPi.GPIO

Quick test with what time is it and what is the weather via CLI worked fine.

1 Like

Perfect feedback!

Had a very busy day yesterday, but will dig into it today and report back.

Again, thanks. Much appreciated that some “other eyes” are looking at it and different hardware at a different location. There is only so much that you can test yourself.

Right! To be honest, because my rpi3 board is faulty if it comes to the WiFi chip I did not really spent time on it. However didn’t realise it was this bad. Will look at it with another wifi chip/dongle. Although I am still not sure how to tackle the WiFi setup, getting the WiFi up manually should ofcourse still work.

Google AIY Voicekit is next on the list. Still investigating how to use pulseaudio and udev together to automatically configure the device if AIY is found at boot.

At the very fist boot and therefor first start-up of Mycroft, all default skill get downloaded and with that it will pip install a whole bunch of additional python packages via their requirements.txt

This take a few minutes to fully complete. Runningh the mycroft-cli-client before this process is finished will give an error about some sort of python package not being found. This will resort itself as soon as everything is installed.

I need to figure out, how to communicate this to the user. However that part is on the nice to have list atm.

With the last Buildroot upgrade, Python also got upgraded to 3.8 however a lot of wheels are not present for 3.8 yet. And as we do not have any compilers and such within Buildroot at run time, we can not install from sources (for the C related packages that it is)

I am compiling a new version at the moment, that reverts back to Python 3.7 till all the wheels are there.

To be honest. No clue :smiley:

Thx, will include this simple command at boot time. This to make sure it works everywhere in the world.

Anyhow, as soon as a new build with Python 3.7.4 is ready I can have another look at the other things.

1 Like

Uploaded a new version, reverted back to Puildroot 2019.08.3 which included Python 3.7.4 instead of 3.8.

https://j1nx.stackstorage.com/s/r4g2dol4tdOSG4M

@Dominik If you have the change are willing to, could you give it a go? Not touched the WiFi stuff yet. Just wanted to know if this is a better base to build upon.

Download was a bit slooooow today, but here we are:

  • no more locale issues!
  • connected my Respeaker 4mic USB v2… works perfect!
  • configured wpa_supplicant but doesn’t work
1 Like

Great, thx!

Haven’t touched WiFi as of yet. Just reverted a lot of patches and buildroot.

Onwards we go. WiFi is next.

Worked straight away for me with a PS Eye. It’s throwing a “cannot get min/max values for control 2” for that device, but it doesn’t seem to affect its operation.

Also I have it plugged into a monitor and it selected the HDMI rather than the 3.5mm for audio out, but that might be preferred for a lot of people.

Nice work on this!

1 Like

@gez-mycroft You tested the alpha5 version, right?

Yep - that was alpha5

HAPPY NEW YEAR

@gez-mycroft To comment on your sound over HDMI feedback; Yes indeed, I have sound auto select on boot. If there is a HDMI connected, it uses the HDMI as sound output. If you boot without HDMI connected, the 3.5 jack will be used. Later on in time, I will see if I can make this switchable, but for now, you need to boot with either HDMI or without.


I uploaded a sixed alpha version to my STACK drive for you guys to test.

Changelog:

  • Disabled Pulse-AEC as default for now.
  • Bumped Mycroft to latest 19.8.5
  • Switched starting all mycroft services to proper systemd units
    – This in preparation for watchdog support
    – Services linked to each other
    – Not starting if network is not up
    – Wait for internet before starting mycroft stack within systemd.
  • Make the HDMI screen pretty again.
    – This in preparation for FRamebuffer support within the enclosure code.
  • Fixed the whole WIFI system. @Dominik
    – When no wifi configuration present at the first boot it will setup an Open Acces point; MycroftOS-WiFiSetup.
    – Use another wifi device such as a phone or tablet.
    – Connect to the open network.
    – Modern devices will automatically open the webbased configuration. (mimic a captive portal)
    – The webbased config scans for available networks.
    – Select your SSID from the list.
    – Insert your WIFI password and press the connect button.
    – (or select the skip at the bottom to disable the AP. You need to use a LAN connection then)
    – The device will reboot and connect to your wifi and continue.
    (If you would like to skip the whole setup and just use your own wpa_supplicant.conf settings/setup; Just copy the wpa_supplicant.conf at the FAT /boot partition before youi start the device)

Two more things to go before I consider this a first official release;

  1. Enclosure code to be run for;
    – Shutdown/Reboot handle
    – Enable/Disable SSH (default user/passwd == mycroft/mycroft )
    – PulseAudio volume control
    – Listener/Thinking/Speaking visuals over the Framebuffer
  2. Pull and build precise from source at build time.
    –(This would allow me to take a stab at 64bit support)

From there on I can start adding features such as ;

  • Airplay 1
  • Spotify
  • Bluetooth
  • mpd
  • Squeezebox
  • etc. (open for ideas)

Here are the download links for this intermediate test release;

RPI3:
https://j1nx.stackstorage.com/s/9zbgEWywJAEjbWy

RPI4:
https://j1nx.stackstorage.com/s/t74ohd06ib2v8NO

DISCLAIMER: As my RPI wifi is broken, I did all above coding with a cheap ass wifi dongle. Really hope it all works with the onboard wifi as well

1 Like