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

Yes, the wifi setup currently used within alpha7 uses

  • Systemd-network (configuring the interfaces)
  • wpa_supplicant (configuring the wlan)
  • hostapd (Wifi ap)
  • dnsmasq (dns and resolve
  • nginx (redirect / captive portal)
  • systemd to manage all above

More information can be found here, but it is a buildroot package.
https://github.com/j1nx/MycroftOS/tree/develop/buildroot-external/package/wifi-ap

And this is the little Python code that uses flask to serve a little webpage that you use to setup your wifi,.
https://github.com/j1nx/MycroftOS/tree/develop/buildroot-external/board/raspberrypi/rootfs-overlay/opt/mycroft/wifisetup

In short it works like this;

  1. At boot systemd looks for the presence of /etc/wpa_supplicant/wpa_supplicant@wlan0.conf
  2. If it is not there, the wifi is not configured and will create a virtual wifi device called ap0
  3. ap@ is brought up in open ap mode via wpa_supplicant and hostapd (again using systemd-network)
  4. dnsmasq is started on that interface, resolving all ip’s to the ip of the app (this is fake internet connectivity
  5. ngix is started to redirect all trafic to the flask server with a the right redirect code to act as captive portal, so mobile devices automatically open that page
  6. The python code scans for SSID’s and shows them in a little webpage where you can select the SSID, insert your password and then writes a proper /etc/wpa_supplicant/wpa_supplicant@wlan0.conf and then reboots the device.

Rebooted it now sees the configured wpa_supplicant file and will there for just bring the wifi up with that information and all above services will not be started.

That is how it now works in alpha7, however working on some changes to remove the reboot and skip or quit above if the internet is or comes online. (LAN connection). Hopefully I am also able to scan for the configured SSID and if not found and therefor wifi can not connect, bring again the wifi setup up again (device is somewhere else, or the SSID is not present anymore or changed)

The little python code only handles the scanning and writing of the wpa_supplicant file. All the rest is handled on the OS level via systemd. Very robust.

For the next version, I will change the webpage to look like the Mycroft mark-1 version and use above framebuffer screens to visualize the process, similar as the mark-2 version.

I have that one on the list to be supported in the future.

It runs armbian, so kernel sources are available. The Rootfs of MycroftOS is all the same, for all devices. Support basically means; Bootloader, Kernel and drivers/firmware support. As soon as the rootfs is mounted and systemd takes over, all different devices run the same.

It is a very nice nifty device, but a bit to expensive for me know to already start cracking at it.

Edit: please read around the spelling mistake. In a hurry and to lazy atm :smiley:

2 Likes

Did I read it right, that spotify is not possible to enable out of the box on v. 7alpha?

-I enabled it in the MycroftOS Skill and then setup the Spotify-forslung skill but I was not able to play a song on mycroftOS itself neither as a spotify-connect-Speaker

Did I do something wrong?
The readme on github says just “More on that later…” and “At a later stage I will explain how to setup the Spotify skill, so you could also voice control your Spotify devices.”

Apologies, I copied that stuff straight from the forum here. However I made another post describing how to setup spotify connect.

1 Like

No need for excuses! We thank you all here for your work. I was just lazy to searchthe thread here :smiley:

I’ve read that spotify-free is now possbile one some devices. Is there a chance to enable this in MycroftOS too?

If you could find some info on where/how/what than I will look into it.

Am sure that @forslund will also look into it if his plugin is involved.

Have not heard about spotify-connect now be available for free accounts though…

I had not heard that connect was freely available now, I don’t think the skill is limited in any way but I’m pretty sure librespot (both spotifyd and raspotify is based on this library) has a hard check for premium accounts, but if that policy has been lifted maybe they’ll remove it.

1 Like

First hit :flushed:

Great news

1 Like

I just found this:

But it seems that spotify is handling this with a special contract for each company. Bose sound-systems, Google-Home and Sonos (+IKEA Symfonisk) seems to be able to play free-music.

Hey @j1nx - it took a while until I managed to set up my mopidy / snapcast environment, but by now I am using MycroftOS in production on three Raspi3 in my flat. And they work. So thanks for all your efforts making this possible!

A few things. On every new installation I need to set the hostname and the password for each machine on the command line. Perhaps you could ask for this info on the Phone-WLan screen during setup? I wouldn’t mind making WLan mandatory for setting everything up. Shouldn’t be a blocker for anyone these days.

My Raspis currently all run snapclient + mycroft. Not tested more than that. Currently I have to start snapclient manually on the console, even though I activated it on home.mycroft.ai - it seems not to start automatically. How would you suggest to handle this?

The biggest (and actually only) annoyance in daily use is: Snapclient mutes down as soon as it recognizes “Hey Mycroft”. After listening it turns music on again. Good so far. But: The music stays on when mycroft answers. I have fixed this by lowering the volume of snapclient and hence having mycroft talk out louder than snapclient - but I guess it would make sense to mute snapclient also when mycroft answers.

A bit of technical feedback:

  • I am using Tonor Microfons - They can be switched off, and stay switched off when the computer boots. When I turn them on too late during booting, Mycroft wont recognize them, even though they have been installed beforehand.
  • Using the FiiO K1 USB DAC works like a charm, the Oehlbach USB Bridge on the other hand has to be plugged in and out in order to be recognized.

So, overall, this must be the best 0.1.0 alpha 7 I have ever been playing around with :slight_smile: Keep on rocking! I will eagerly install your next candidate - esp. getting rid of those update notifications would be a great step forward :slight_smile:

2 Likes

Thanks, away from my pc at the moment but will reply properly to your post soon.

:+1:t2::muscle:t2:

Just out of curiosity do you have pulse audio echo cancellation enabled on rpi4 in your os build?

No problem! Great to hear about your “succes story”.

In the next version, at first boot when the OS is setting up the system, the Hostname will automatically be set to “MycroftOS-”. Where for the MAC address addition only the last three changing bits are used. This to prevent multiple devices on a network with the same Hostname if you use more MycroftOS devices. This is most likely the reason why you are changin it. Of course you can change it to whatever you want manually. Somewhere in the near future I will integrate setting/changing this into the skill-enclosure code.

About the password. During development, SSH is enabled by default for ease of use / testing. However as soon as the OS matures, I will disable SSH by default. You then need to explicitly enable it via the skill-enclosure settings. Then at first login, it will force you to set/change the password. This way we don’t have linux machines flying around on the internet with bad passwords.

Right! Well the mycroftos-enclosure-skill is still very rough and far from polished, so this kind of things might happen. My solution:

  • Enable it within the skill web configuration to prevent on/off issues from there.
  • Login over SSH and run the following commands;
sudo systemctl enable snapclient.service
sudo systemctl start snapclient.service

Snapclient is started with this command;

/usr/bin/snapclient $SNAPCLIENT_OPTS

Where it reads out the ````$SNAPCLIENT_OPTS from “/etc/snapcast/snapclient”
I am very intereted in your configuration OPTS so I can have a look and test some thing myself as well.

This is kind of expected, because I have not yet coded the whole Pulseaudio control code and just force-push all alsa to pulseaudio. When Mycroft picks up the “Hey Mycroft” it sends a MUTE command. This mutes just ALL sinks/streams (via alsa master control) and therefor works as expected for you. However really controlling the volume level via pulseaudio, it something different. There is however a quick-fix type of solution, but it is not readily available.

A “mycroft-snapclient-skill”.

Snapcast can be controlled by JSON API, as documented here;
https://github.com/badaix/snapcast/blob/master/doc/json_rpc_api/v2_0_0.md

This could be a very quick and minimal skill at first that doesn’t even require any intents. Just a TTS start and stop messagebus handler that; At TTS start does a " Client.GetStatus" request, saves the volume and then does a " Client.SetVolume" to set the volume to a very low (~10%) level. Then at TTS end, just sends the " Client.SetVolume" with the old volume again.

Unfortunately I do not have the time for this as of yet, but perhaps if you create a skill suggestion thread over at the skill suggestion section here on the forum some of the python-guru’s can pick it up as it really should be a wal;k in the park for them :wink:

For your USB hardware, I am going to contact you a bit later in time over DM so we can walk through the DMESG logs, which should allow me to get the proper hardware ID’s within Linux so I hopefully can properly support them within MycroftOS as soon as Linux sees them.

@pcwii It is available, just not enabled by default as it depends on the hardware and perhaps might need some tweaking. To start cracking with it, just SSH into the box and open “/etc/pulse/system.pa” at the bottom you can uncomment the following section;

### Enable Echo/Noise-Cancellation
#load-module module-echo-cancel aec_method=webrtc source_name=echoCancel_source sink_name=echoCancel_sink
#set-default-source echoCancel_source
#set-default-sink echoCancel_sink
2 Likes

Little teaser for the upcoming alpha 8 version.

Still quite some tweaking todo. This is the “normal” mycroft-gui running straight onto the DRM and the untweaked mycroft-mark2-skill.

Above video is running ona RPi4, but have a RPi3 version as well. Runs ok, just a little bit slower, but still very useable.

Also in progress of splitting things up. Nect version will come in two flavours. GUI and Headless, where the latter just have all screen related stuff removed.

7 Likes

:clap: :partying_face:
Well Done, Looking forward to giving this a spin. My next problem is finding a Raspberry Pi case that will fit my 47 inch tv :thinking:

1 Like

Luxery problems :joy::joy::joy:

The simple cases with 7" hdmi screens will make a nice Mark3

With two more little tweaks, this runs on the Mark2 hardware as well :shushing_face: :wink:

2 Likes

At this very moment I am downloading alpha 7 to test it on my rpi3 I am very excited hopefully and could try alpha 8 but I think it is not yet available :frowning:

OMG pandora doesn’t work :frowning:
I guess the reason is that you can’t install pianoman yet.
but even so and knowing that it is an alpha I am very excited because the potential of this project far exceeds Mark II.

I hope that in the future we will be able to install skills with dependencies.
For now I have had to return to my picroft installation :frowning:
I am very excited to try alpha 8
I can not wait more…! :slight_smile:

Hi, sorry for not responding earlier.

I will see if I can include the Pianobar CLI program in the next version, so you could easily install the Pandorra skill. Did the same for spotify, Airplay and Snapcast.

Good to hear, you already liked what you saw. It is far from fully ready, but slowly getting there…

1 Like

What I liked the most is how easy it can be installed!