Using a Raspberry pi to build a Mycroft AI, also known as a Picroft
Why build your own AI?
Who doesn’t like AI (Artificial Intelligence) right? Right! So why not build one yourself and use it at home? Is it because you think it would be too difficult or would take too much of your time? Well, fear not! You can easily build your own AI in about 2 hours without even having any programming skills. Of course, having some programming knowledge will be beneficial should you want to advance, configure or extend Mycroft functionality with your ideas.
Why use Mycroft?
Mycroft is open source. This means that the code used by Mycroft can be inspected, copied, modified, and contributed back to the Mycroft community for everyone to enjoy.
Why not instead show you what Mycroft is all about? See for yourselves. https://mycroft.ai/about-mycroft/#what-can-you-do
What will you need?
- First, you will need to download the software for the specific platform you would like to run it on. Currently, it is not supported on Windows and Mac computers. In this article, I will show you how to get this up and running on a raspberry pi. You can find the required software at https://mycroft.ai/get-mycroft/.
- You will need a raspberry pi with all the basics (SD card, Power adapter, HDMI cable etc.). All the required items are included in the kit. You can get a kit at https://www.pishop.co.za/store/raspberry-pi-3-kit-boxed.
- The next thing that you will need for your setup is a Google AIY Voice Kit. You can get your hands on one at https://www.pishop.co.za/store/google-aiy-voice-kit. You can also use a mic and speakers if you have any lying around.
- You will require something that can Burn images to SD cards & USB drives, safely and easily. I prefer Etcher for this task: https://etcher.io/
AI for Everyone
Mycroft runs anywhere – on a desktop, Mycroft runs anywhere – on a desktop computer, inside an automobile, or on a Raspberry Pi. This is open source software which can be freely remixed, extended, and improved. Mycroft may be used in anything from a science project to an enterprise software application.
This is the official Mycroft
- First, you will need to write the image file to the SD card you will use in the raspberry pi. You will use etcher for this. It is quite a simple tool to use, just run it and choose the image file you downloaded, select the SD card you want to write to and then click on the flash button. Now insert the SD card into your raspberry pi.
- If you are using your own mic and speakers, then connect them to the pi. If you decide to use a Google AIY Voice Kit, you will receive assembly instructions along with your kit. You can also access these instructions online at https://aiyprojects.withgoogle.com/voice/#assembly-guide. Follow the instructions up to the point where they finish building the cardboard box. They will also include steps to set up Google Voice assistant on the pi, but we will skip this step seeing that we want to install Mycroft on our pi.
- Now if you used the Google AIY kit, you should have something that looks like a speaker box with a button on top of it.
- Next step is to power up your Picroft! Connect your power cord to your raspberry. Should you want to see if the Mycroft software is booting up, you can plug in your HDMI cable and connect it to a screen. This is also handy for debugging or seeing command given to Mycroft and how they are interpreted. You can also give commands to your Picroft through the terminal.
- If you are using a raspberry pi 2, you will need a WIFI adapter else if you are using a pi 3 you are sorted. I do not recommend the pi zero. Some people in the Mycroft community say that they have it up and running on a pi zero, but I have tried mine many times, and each time it seems like a new issue/bug occurs. The experience is not stable and there is quite a delay in response. I would definitely recommend a pi 2 or 3. Once your Picroft has booted up, it will tell you that it could not connect to a WIFI network. You can then use any device which has WIFI and look for a WIFI Network with the name MYCROFT. You can connect to it using the default password 12345678. Then you can navigate to https://mycroft.ai/get-started/ in your browser and configure/connect to the network you want your Picroft to use. You can also configure multiple connections.
- After you have connected your Picroft to the internet, it will read out a registration code to you. You will need to create an account at https://home.mycroft.ai/. Once you have an account, you can click on add a device. Here you will need to enter the registration code your Mycroft has read to you and then select Picroft as your device type. You can also give a name to your Picroft and a description.
- If it still doesn’t respond, you can try a restart. Now try asking it something like “What’s the weather like?”. Note that Mycroft will only listen to you should you say his wake word. The default wake word is “Hey Mycroft”. Then after you hear it turning on you can ask him something. If you are using the Google AIY kit, you will see the button on top light up when you say the wake word. Give it a few seconds to respond though. Sometimes it can take him a while to process your request. Should you struggle with any of these steps, you can visit https://mycroft.ai for more information about configurations for your Picroft.
This is what the Google AIY Voice Kit will look like after you have assembled the kit following the instructions given along with your kit.
Now you should have a working AI that you can use around the house. If you have multiple Mycrofts or Picrofts they can connect to one another, and you can communicate through one to someone in another room where there is also a Mycroft device.
If you are looking for more skills for your Mycroft you can find some on their GIT repo here: https://github.com/MycroftAI/mycroft-skills.
Please do read the README of the repo before firing away with installing skills. Each skill should have its own install instructions and should you perhaps have python programming experience you can update existing skills or write your own skills for your Mycroft and publish it for the community to use.
If you want to use Mycroft on other platforms such as Linux, you might have more configuration steps to get everything working as you want it. That is what makes the Picroft such a good choice. The image is preconfigured for you, and most of the stuff works by default.
Should you not have a screen for you Picroft, you can access it via SSH. The default connection details are username: pi, password: Mycroft.
Should you have a Linux Machine you can access it via SSH the following way:
You can obtain your IP address by asking Mycroft the following: “Hey Mycroft, what's your IP address?”
After entering the SSH command, it should now prompt you for a password. Enter mycroft and hit enter. You should now be connected to your Picroft.
If you are using a Windows machine you can download a tool called PUTTY to SSH into your Picroft.
Note that SSH is already configured on the Picroft image and that is why it works out of the box. For SSH to work, the device you are using to SSH into you Picroft needs to be on the same network as your Picroft.
If you used a Google AIY kit to build your Picroft and you are happy with the cardboard idea then great. If not, you can always build your own casing for your Picroft. You can design a case and have it 3D Printed or you can go old school and build it into an old speaker. You can also create a wooden box for it. The following images on the right show how I designed my Picroft. The amount of possibilities is endless.
Mycroft Official Logo
Should you be interested in learning more about Mycroft, you can visit their official website at https://mycroft.ai/documentation/. Mycroft also has different voices, but these voices are locked and can only be unlocked by a monthly subscription to support their open source development.
When logged into your profile at https://home.mycroft.ai/ , you can select your device and navigate to setting -> basic You can customise things like your Mycroft Voice, Units of Measurement, Time Format, Date Format and opt-in to make your Mycroft data set open (They can collect and use your data for improvements). The open data set is disabled by default for your privacy.
You can also navigate to settings -> advanced. Here you will be able to change stuff like your Mycroft wake word along with other system settings. I recommend leaving them as is unless you are comfortable with changing these values.
I hope you have enjoyed this article and that you found the content useful.