Maximum PC

HOW TO INSTALL PICROFT OR MYCROFT

Let amusing human-computer voice interactio­ns begin!

-

THE PROCESS OF installing Picroft starts the same way as installing Raspbian: writing an SD card image. There are stable and unstable versions available at https://

github.com/MycroftAI/enclosure-picroft. We’ll work with the stable image for this tutorial, but do give the unstable one a shot later to see some new features (and possibly bugs). Download the image to your machine— any machine running any OS; just be aware it’s 2.2GB zipped and 4.9GB unzipped, so make sure you have enough space. The image can be burned with a graphical program, such as the multi-platform Etcher ( https://

etcher.io), or the old-fashioned way with dd on Linux:

$ sudo dd if=raspbian-stretch_ Picroft_2018-09-12. img of=/dev/sdX status=progress bs=4K Replace /dev/sdX with the appropriat­e device (the

lsblk command will help you figure this out if you’re not sure). That will take some time to write, so now is a great opportunit­y to make your first cup of coffee.

When done, put the SD card into the Pi, and fire it up. You need a display and keyboard connected to the Pi to run the initial setup, but afterward, these aren’t needed unless something goes wrong. On first boot, Picroft resizes its partition to use all available space on the SD card. When it finishes booting a second time, it asks if you would like some help setting up your system. Unfortunat­ely, this help doesn’t include setting up wireless networking, so you need to say no here, unless you’re using a wired connection for your Pi.

If no network connection is found, you’re directed to a different script, which tries to sort this out. For basic Wi-Fi (WPA or WPA2 with a password), choose the first option, and enter your network’s SSID and password. For more complicate­d setups, use option 3 to edit the “/etc/wpa_supplicant/wpa_supplicant.conf” file.

The Mycroft CLI should start, and you should be able to pair your Pi to Mycroft Home, which we’ll get to in a minute. First, though, you need to set up your microphone and speakers via the setup wizard. Exit the

CLI by typing :quit then restart the setup wizard with: $ mycroft-setup-wizard

First, choose the sound output that best matches your hardware: Analog, HDMI, or USB. Next, set the desired audio level. If you’ve just plugged in a USB speaker and aren’t getting any output, you may need to reboot (by pressing R) for it to be picked up. Then comes the microphone test; only a couple of USB mics and the Google AIY kit are supported out of the box, but other hardware (such as the Seeed ReSpeaker we used) can be made compliant once the relevant drivers are installed. Use option 4 to postpone setting this up if your hardware needs further convincing.

Next you’re asked whether to auto-update the master branch, which is a good thing to say yes to. You’re then asked if you want to allow passwordle­ss sudo—the default behavior, which is insecure depending on who has access to your Pi. Finally, you have the option to change the default “mycroft” password for the pi user, which you probably should do. Setup then continues the same as on desktop, so skip to the “Creating a Mycroft Account” section.

MYCROFT ON YOUR DESKTOP

For desktop Linux boxes, Mycroft provides a setup script on GitHub that works on Debian, Ubuntu, Fedora, and Arch. It can be made to work on other distros, but some manual setup is required—the script tells you which libraries are missing, and your job is to find the packages containing those. Whatever distro you’re running, you need Git to fetch the script. Grab it with:

$ cd ~ $ git clone https://github.com/ MycroftAI/mycroftcor­e.git

$ cd mycroft-core/

Then have a look at the “dev_setup.sh” script, because it’s imprudent to run random things from the Internet that are going to ask for root privileges, even if the folks at Mycroft are a trustworth­y bunch. You’ll see that the script sets up a virtual environmen­t so as not to interfere with your Python installati­on. Once you’re happy the script is kosher, run it with:

$ ./dev_setup.sh

You’re now asked which branch you want to check out. The default master branch is considered more stable, so go with this one first. Later, if you’re feeling adventurou­s, you can try the developmen­t branch. Next, you should allow the script to automatica­lly update the repo, unless you have some reason not to. The next question asks whether you want to build the Mimic TTS (text-to-speech) engine locally. This takes a long time on an older machine, but is worth it if you want Mycroft to talk to you during those dark times of Internet outage. Finally, you are asked whether to add the Mycroft Helper command path to your profile; this

makes your life easier, so say yes here. All Mycroft commands begin with mycroft , so typing this then pressing Tab helps you manipulate it. You are asked for a sudo password, and then a quite considerab­le number of packages are downloaded and installed. You might see a warning about an outdated version of Pip (we noticed it on Ubuntu 18.04.2), but this is apparently safe to ignore.

Now we’re ready to run Mycroft for the first time, which is done from the “mycroft-core/” directory with:

$ ./start-mycroft.sh debug

The debug option starts a command-line interface and shows extensive startup logs. Once everything’s loaded, it gives you a unique six-character registrati­on code to pair this device with the Mycroft Home service. Make a note of that, because we’ll need it in a moment. There’s not a lot that Mycroft can do until this pairing is complete.

CREATING A MYCROFT ACCOUNT Visit https://home.mycroft.ai— because the vocal prompts should tell you whether your speakers are working—to create an account from where your Mycroft devices can be managed. Enter the pairing code, and give your device a name and descriptio­n. The CLI started earlier should acknowledg­e the new device, and you can enter natural-language questions, commands (started with : —type :help to see a list), or speak directly to Mycroft through your microphone, audio setup permitting. It tries to answer anything that you precede with “Hey Mycroft.”

At this point, you can continue with keyboard and monitor plugged in, which is probably a good idea for the moment. However, if you’re planning on a headless Mycroft Pi setup, you’re going to be connecting to it over SSH, so you may as well practice that now. You need your Pi’s IP address, which you can either ask it for directly, or type the following into the CLI—Mycroft doesn’t care about apostrophe­s, incidental­ly:

whats my ip address

Mycroft should respond vocally, and output something like:

>> My network I.P. address is 192 dot 168 dot 0 dot 23

This means you can SSH into it from another machine with the following:

$ ssh username@192.168.0.23

If you’re talking to Picroft, the username is pi and the password is longer mycroft because, of course, you diligently carried out our earlier instructio­n to change it as soon as possible.

If the mic level in the CLI doesn’t respond, quit the CLI with Ctrl-C and check the output of:

$ arecord -L

If your mic is not detected, you need to battle with sorting out your particular hardware—the fairly ancient PlayStatio­n 3 Eye camera/mic is strongly recommende­d by the Mycroft team, and works out of the box. If, on the other hand, it is detected there, you may need to install and tweak Pulseaudio.

This is almost exclusivel­y going to be a Pi issue, as all major distros have this already. It was necessary on our ReSpeaker HAT, so check the box below for guidance. You can always return to the CLI client with:

$ mycroft-cli-client

 ??  ?? This is the screen you’ll want to type your registrati­on code into. We’re pretty sure this one will have expired by press day.
This is the screen you’ll want to type your registrati­on code into. We’re pretty sure this one will have expired by press day.
 ??  ?? The PS3 Eye works out of the box with Mycroft, even if we are only using its PS3 ear.
The PS3 Eye works out of the box with Mycroft, even if we are only using its PS3 ear.
 ??  ??

Newspapers in English

Newspapers from United States