Building The Open Source Amazon Echo-Jasper

I have always been interested in AI and know that this is a field that I want to spend a lot of time on. One of the sub-fields of AI, which is Intelligent Personal Assistant(think Siri on iPhones and Google Now on Androids), has always fascinated me. With Amazon Echo being very popular and this gave me the idea to build the software side of Echo myself, but after doing some research, I found Jasper, an open source version of Amazon Echo, with instructions on how to assemble the hardware yourself and setup the software on a Raspberry Pi. I thought it would be awesome to build one myself, so I talked to one of my CS professors, Professor David Evans, and began the journey of building one myself.


Hardware

On the Jasper website, you can find list of hardwares you need. I tried to buy things exactly as shown on the site, but issues came up. For example, I found that the speaker listed on the website is already sold out on Amazon and I don’t think they will get restock soon, so I had to resort to a different model. For you convenience, here is the list of items that I bought to build my Jasper, which is just a more updated version of what the website has:

  • Raspberry Pi Model B
  • USB Microphone
  • 16GB SD Card-(First, Jasper’s official website recommended 4GB SD Card but I found that a 16GB SD Card is $6 on Amazon while a 4GB SD Card is $15, so I recommend just getting a 16GB one; second, for this, I had to cancel my order on Amazon since it was taking forever to ship my 4GB SD Card, so I bought a 16 GB version at a local BestBuy.)
  • Ethernet Cable
  • Airlink Mini-USB Adapter
  • Micro-USB Cable
  • USB Wall Charging Adapter
  • Speakers that work through the Raspberry Pi audio jack (The documentation has a link to a speaker that I was not able to find anywhere online, so I had to choose my own speaker. The one I link to requires a USB connection to get power and use audio jack as well. I didn’t choose to use a speaker that only uses the audio jack since I was not sure if powering a speaker through Raspberry Pi’s audio jack would drain all the energy and lead to it not working at all. Currently if you plug in the Airline Mini-USB Apapter for wifi and the microphone, you won’t have a remaining USB port for the speaker. What I do currently is have my laptop next to Jasper and plug the USB port for the speaker into my laptop and the audio jack into the Raspberry Pi. This worked for me, but I just bought a USB hub so I will try this solution and update the blog once I determine how feasible the USB hub solution is)

That’s it for all the hardware you will need.

Raw parts before assembling

Assembling the hardware

It was quite simple assembling the hardware. Most things are pretty obvious where they should go, but two things might be a bit more difficult to figure out. First, where the micro-USB cable should be plugged on the Pi board. Below is a picture to show you where to plug the micro-USB port.

This picture shows you where the micro-USB cable should be plug for power for the Pi

Below is another picture that shows you where to put the SD Card.

This shows you where to plug the SD Card

Everything else should be easy. Once you get the Pi running(the power light is on), plug in your ethernet cable now.


Setting up the Pi

I followed the documentation from here on. I put the disk image onto the SD Card and plug that into the Pi, but this was a bit difficult for me, since my Mac does not have a ethernet cable, so I can’t use ethernet cable to connect my Mac and the Pi so that I can ssh into the Pi to configure it. I had to resort to connecting the Pi to my router, then connect the Pi to an external monitor and keyboard. Power up the Pi, see things fly by on the screen. Once you get to the login prompt, log in as user ‘pi’ and password ‘raspberry’. Then use this link to get your ip address. Once you know the IP address of the Pi, you can just ssh into it using your laptop’s command line. Then follow the tutorial for configuring the Pi’s software. It was a long process for me since some packets required a long, long time to install, so be prepared for that, and don’t think it’s not working just because your command line is not returning anything. It is working, just taking forever. I think a script file could be used here just so that for users who are using the pre-existing disk image to install everything with one command. I might write that in the future so that things are easier. Another thing that came up during the installation which I didn’t expect was that I ran out of disk space. It might be because I didn’t delete the .zip files once I finished installing the packets. Anyway, I had to use this link to expand my space so that my Pi will use the all 16GB disk space. And everything else was smooth sailing from there.

This is what hackers look like in movies, right?

I did have one issue which was when I first plug in my microphone, my Pi didn’t recognize it. Just when I was getting frustrated, I restarted my Pi, and the microphone’s power light started blinking and it’s now working. So once you plug in your microphone, just restart the Pi to get it recognized.

I chose to use local Speech-To-Text(STT) and Text-To-Speech(TTS) libraries, which protects my privacy but has a less-than-ideal performance, which I will talk about in a bit.

Assembled Jasper

“Jasper, what time is it?”

After everything is setup, we can start asking Jasper questions. The first question I tried was asking it the time. Since I am using local STT library, Jasper had a really hard time understanding me. When I ask it the time, sometimes it won’t be able to interpret what I’m saying. I think, but haven’t tested yet, that using an online STT might improve the performance significantly.

Me asking Jasper what time it is

Next Steps

Here are a few things I plan to explore, please let me know if you have other ideas as well:

  • Changing the name of the bot, I am thinking about changing it to Jarvis, which is what Iron Man calls its AI
  • Trying different STT and TTS libraries, especially online ones, to see if online SST/TTS services offer better performance in terms of respond speed and accuracy in interpretation

Thanks for reading! Please let me know if you have any questions or cool ideas for Jasper. Also, thanks to the creators of Jasper! I couldn’t have built my own Amazon Echo without your hard work.