Skip to content
SDB
02Technology

Meet my Raspberry Pi programmed Alexa

Turning an old Raspberry Pi into an Echo Dot–like Alexa Voice Service device — USB mic and speaker, Amazon developer profile, AVS sample app, companion service, Java client auth, and Sensory wake word — for home automation and voice Q&A.

Subhendu Datta Bhowmik3 min read

This post is how I converted an old Raspberry Pi into an Amazon Echo Dot–like device using Alexa Voice Service (AVS). The goal was a voice front-end for home-automation IoT work — news, weather, time, general Q&A — not a music appliance. Amazon Music does not work on this Pi path; other free skills can still cover a lot.

Raspberry Pi in a purple 3D-printed case beside a glowing portable speaker
Pi + external speaker — DIY Echo hardware on the workbench

Extra hardware on the Pi

On top of the stock Pi modules I added:

  • USB wireless microphone
  • USB Wi-Fi (already built into this Pi model for internet)
  • External speaker via the auxiliary audio jack
  • A Raspberry Pi case I printed on my DIY 3D printer — see Meet my live DIY 3D printer

After wiring speaker and microphone I verified capture and playback with arecord and aplay before touching any Amazon setup.

Amazon developer account and device profile

Register a free Amazon Developer account and create a product profile for the Pi.

Register the product

  1. Sign in to the Amazon Developer console and open the Alexa tab
  2. Register a Product Type → Device
  3. Name the device type and display name (example: My Pi AVS) → Next
  4. On Security Profile, Create new profile
  5. Under General, set Security Profile Name and description → Next
  6. Note the generated Product ID, Client ID, and Client Secret
  7. Web Settings → Edit:
    • Allowed Origins → Add: https://rpi-ip:3000
    • Allowed Return URLs → Add: https://rpi-ip:3000/authresponse
  8. Device Details — category, description, timeline, and 0 for device count are fine for a personal build → Next

Install AVS sample app on the Pi

With the developer profile ready:

  1. Install git
  2. Clone the sample app:
git clone https://github.com/alexa/alexa-avs-sample-app.git
  1. Run the installer (≈ 20 minutes, with interactive questions):
cd alexa-avs-sample-app
./automated_install.sh
  1. Install Node.js (current LTS on the Pi) before the next steps
  2. Start the companion service (I used nohup so it stays up):
cd ~/Desktop/alexa-avs-sample-app/samples/companionService
npm start

That opens communication with Amazon and serves the AVS JavaScript sample on port 3000:

https://rpi-ip:3000
  1. Install Maven, then in another terminal:
cd ~/Desktop/alexa-avs-sample-app/samples/javaclient
mvn exec:exec
  1. When prompted to authenticate the device, choose Yes — a browser opens; sign in to Amazon and confirm tokens are ready
  2. Keep the advised command windows open
  3. Start the wake-word agent (Sensory or KITT.AI — I used Sensory):
cd wakeWordAgent/src
./wakeWordAgent -e sensory

Using it

Say “Alexa.” You should hear a beep when it is listening. Then ask things like:

  • “What’s the weather?”
  • “What is the current time in the USA?”
  • “What are today’s major news highlights?”
LayerRole
USB mic + speakerCapture and playback
Wake word (Sensory)Local “Alexa” trigger
Companion service :3000OAuth / Amazon link
Java AVS clientDevice session with Alexa
Pi + skillsAnswers for IoT / home use

Watch the build

Original walkthrough (also on my YouTube channel):

Watch on YouTube

References

This piece was first published on 15 June 2018 as Meet My Raspberry Pi programmed Alexa, and is carried here under Technology as part of the digital journey archive.

Filed under

  • Alexa
  • Echo
  • Raspberry Pi
  • AVS
  • DIY
  • IoT

Keep reading

Technology3 min read

The honest case for AI in the enterprise

Most enterprise AI programmes fail for the same reason enterprise search failed in 2008: nobody owned the data. Here is what actually has to be true before a model earns a place in production.

Read essay →
Technology5 min read

Visualize NodeMCU-plugged MPU6050 realtime movement on OLED

NodeMCU ESP8266 + MPU6050 gyro/accelerometer with SSD1306 OLED readout, optional DHT11, InvenSense teapot packets over serial, and a Processing 3D visualiser — motion on the bench and on the screen.

Read essay →