Before getting started, let's review what you'll need.
- Raspberry Pi 3 (Recommended) or Pi 2 Model B (Supported).
- MATRIX Voice or MATRIX Creator - Raspberry Pi does not have a built-in microphone, the MATRIX Voice & MATRIX Creator each have an 8 mic array - Buy MATRIX Voice or Buy MATRIX Creator.
- Micro-USB power adapter for Raspberry Pi.
- Micro SD Card (Minimum 8 GB) - An operating system is required to get started. You can download Raspbian Stretch and use the guides for Mac OS, Linux and Windows In the Raspberry Pi website.
- External Speaker with 3.5 mm audio cable.
- PortableBattery Pack
- Micro-USB Cable
- A USB Keyboard & Mouse, and an external HDMI Monitor - we also recommend having a USB keyboard and mouse as well as an HDMI monitor handy. You can also use the Raspberry Pi remotely, see this guide from Google.
- Internet connection (Ethernet or WiFi)
- (Optional) WiFi Wireless Adapter for Pi 2. Note: Pi 3 has built-in WiFi.
- Iron Man suit
If you haven't already, be sure to setup your Raspberry Pi with your MATRIX Device.
Once setup, ensure you enable SSH on your Raspberry Pi. This allows the SAM CLI tool to connect to your Pi.
Follow the steps below in order for Snips to work on your Raspberry Pi.
1. Connect SAM To Your Raspberry Pi (Personal Computer)By this step, you should have a snips.ai account and the Sam CLI Tool installed.
From your computer's terminal, sign in through the Sam CLI Tool.
sam login
Connect to your Raspberry Pi. When prompted for a username & password, you can press the enter key to insert the default Raspberry Pi credentials.
sam connect YOUR.PI.IP.HERE
Check if Snips is running.
sam status
# Example output
# If all services are not (running), use the `sam init` command
Service status:
snips-analytics .............. 0.60.10 (running)
snips-asr .................... 0.60.10 (running)
snips-audio-server ........... 0.60.10 (running)
snips-dialogue ............... 0.60.10 (running)
snips-hotword ................ 0.60.10 (running)
snips-nlu .................... 0.60.10 (running)
snips-skill-server ........... 0.60.10 (running)
snips-tts .................... 0.60.10 (running)
Begin viewing the Snips event stream. This will let us verify if your intents are being heard.
sam watch
2. Creating A Snips Assistant & AppIf you haven't already, sign up for an account on Snips.ai.
Once you have created an account, login to view your Snips Console.
- The first time you login, you’ll be prompted to create your first Voice Assistant directly.
- If it’s not the first time, go to the Console’s home page and click on Create a New Assistant.
Create an assistant called "IronMan" and select the language of your choice. In this guide, we chose English.
Once you have created your assistant, select "Jarvis" as the Wake word from the drop-down menu on the Snips console.
3. Adding the Iron Man App to Your Snips.ai AssistantClick on Add an App, then Create a new App.
Name your app and provide a description if desired.
Click on the ArcReactor app you just created on the Snips.ai console, then the click Edit appbutton.
Under the Intents tab, click Create New Intent. Name your intent "arcReactor" and add a description.
Go into your intent and create a custom slot as shown below with name "Power."
Add two values to the slot: On and Off.
Then begin adding as many training examples as you can think of. This improves the chances of your intent being recognized.
Make sure to save your intent by hitting the Savebutton on the bottom right of your screen.
7. Deploying Your Snips.ai AssistantOn your personal computer's terminal, type in the following command.
sam login
You will then be prompted to type your Snips.ai console email and password.
Once you have logged in to your Snips account through the SAM CLI tool, go back to the Snips Console on your browser.
Click on the Deploy Assistant button on the bottom right side panel of your Snips console. Then copy & paste the sam command Snips provides into the terminal on your personal computer.
8. Creating JavaScript Code with Everloop and MQTTThe following commands will download the ironman.js file from our GitHub and place it in the home/pi/lite_js folder (created when setting up MATRIX Lite JS).
(Run the following commands on your Raspberry PI)
cd /home/pi/lite_js
curl https://raw.githubusercontent.com/matrix-io/MATRIX-Iron-Man/master/ironman.js >> ironman.js
PASS YOUR SNIPS.AI USERNAME
Before moving on, you'll need to pass in your snips username into the snipsUserName variable.
var snipsUserName = "YOUR_SNIPS_USERNAME";
You can obtain your username from the top right of the Snips Console page.
Once you have ironman.js setup, use the following commands in your Raspberry Pi's terminal to download MQTT and run your ironman app.
npm install mqtt --save
node ironman.js
9. Running Your Iron Man App on BootOnce you have verified that your iron man app is running successfully, you can have ironman.js run on boot so that it starts whenever your Raspberry Pi starts up.
In your Raspberry Pi, open the rc.local file using the following command in the terminal.
sudo nano /etc/rc.local
Add the following line to the beginning of the file.
/home/pi/.nvm/versions/node/v8.6.0/bin/node /home/pi/lite_js/ironman.js &
Save the file by entering Ctrl-X, then Y.
Check to see if rc.local woks by running the following command in your pi's terminal.
/etc/rc.local
If ironman.js runs through rc.local as expected, then you are good to go. The file ironman.js will now run on boot and you can command your arc reactor as soon as your Pi turns on.
10. Finally, Embedding Your MATRIX Device into an Iron Man SuitYou can purchase a polyester iron man suit from Amazon or from a local store.
Make a horizontal slit near the top of the Arc Reactor print on the suit with an X-ACTO knife to make room for your MATRIX device's GPIO pins to poke through.
Use double-sided tape on the back of your MATRIX device to secure it to the suit. Make sure to leave the mics exposed as shown in the image below*.
*Be careful not to tape onto any of the small components!
Attach the Raspberry Pi from the inside of your suit to your MATRIX device's GPIO pins.
Don't forget to attach a speaker with an audio jack and a portable battery pack to power your Raspberry Pi.
Comfortably tuck away your speaker and batter pack in your pockets.
You are now ready for Halloween as Tony Stark!
Comments