Skip to content

Setting up Dev Machine

Abhishek Singh edited this page Jun 4, 2019 · 1 revision

These are the steps you need to follow to setup your dev machine. That way you can run the Peeqo application on your computer and develop skills with greater ease.

Setup Instructions

  1. Clone Repo
  2. Setup Wakeword
  3. Setup Dialogflow
  4. Rename config-dev.js to config.js
  5. Setup on Mac OSX/Linux
  6. Additional Steps

Clone Repo

Clone this repo and unzip the folder.

Setup Wakeword

Peeqo uses snowboy for offline on-device wakeword detection. Follow these steps to get him to respond to you saying Peeqo.

  1. Go to https://snowboy.kitt.ai/dashboard
  2. Login using Google/Github/Facebook
  3. Type “Peeqo” in the “Search Hotwords” text box & hit enter. Only one result should turn up
  4. Click on the microphone icon near the Peeqo search result
  5. Click “Record my voice” in the popup that opens
  6. Follow the instructions and record yourself saying Peeqo three times. You will need to allow the browser microphone access
  7. Click on “Test the model”
  8. Enter the details on the left and say “Peeqo” a couple of times till it says “Test Successful”
  9. The model is now trained to respond to only you saying Peeqo
  10. Click on “Save and download”.
  11. This will create a file called Peeqo.pmdl.
  12. Place this file in /electron/app/config/

Setup Dialogflow

Peeqo uses Google's dialogflow for Speech-to-text. You can replace this with another service of your choice later.

  1. Go to dialogflow.com
  2. Click on “Go to console” in top right and login using your google id
  3. Grant permissions, select Country and accept terms & conditions
  4. Click “Create Agent”
  5. Enter “Peeqo” in agent name and click “Create”. Change language and time zone if required. Make sure to leave the default option of “Create a new Google project” selected
  6. Once created, click on the cog icon near the agent name in the left hand menu to open agent settings
  7. Click on Export and Import > Import from Zip
  8. Drag and drop /electron/app/config/dialogflow-agent.zip from this repo. Type IMPORT in the text box and click Import to upload this agent
  9. In the General settings of your agent, make a note of the “Project ID”. Enter this in /app/config/config-dev.js -> speech.projectId
  10. Click on the link labeled Service Account. This will take you to your google cloud console page
  11. In the cloud console page, click on the three vertical dots in the Action column of this Service Account and select “Create Key”
  12. Make sure JSON is selected and click create.
  13. This will download a JSON file to your computer. Keep it safe and never share it. Rename this file dialogflow.json
  14. Place this file in /electron/app/config/
  15. Enter the full name of this file in /electron/app/config/config-dev.js -> speech.dialogflowKey. You can rename the file if needed to make it simpler.
  16. This agent should give you a good starting of some existing responses. You can now add your own responses and intents to it on dialogflow to add functionality. Go to https://dialogflow.com/docs/getting-started to learn more.

Rename config file

After following the two steps above and entering the necessary keys and filepaths, rename config-dev.js to config.js

Setup on System

You can currently run the app on Mac OSX or Ubuntu14.04 for development purposes. You can develop on your system and then push it to your Peeqo's raspberry pi. On other systems, if wakeword detection is unsupported, I have added a small button on the top left corner to simulate a wakeword.

Setup on Mac OSX:

  • Install node version
  • Install snowboy dependencies on Mac (https://github.com/Kitt-AI/snowboy)
    • brew install swig portaudio sox
    • pip install pyaudio
    • If you don't have Homebrew installed, please download it here. If you don't have pip, you can install it here.
  • Install snowboy dependencies on Linux
    • sudo apt-get install swig3.0 python-pyaudio python3-pyaudio sox
    • pip install pyaudio
    • sudo apt-get install libmagic-dev libatlas-base-dev
  • Clone github repo:
    • git clone https://github.com/shekit/peeqo.git
  • CD into github folder:
    • cd /path/to/repo/electron
  • Install packages:
    • npm install
    • ./node_modules/.bin/electron-rebuild --pre-gyp-fix
  • Run app in Debug Mode:
    • This will open the chrome inspector panel. Run from electron folder
    • NODE_ENV=debug npm start
  • Run app in Production Mode:
    • This will not open chrome inspector panel. Run from electron folder
    • npm start

Setup on Ubuntu 14.04:

  • Install node version (8.15.1)
    • curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
    • sudo apt-get install -y nodejs
    • Check node and npm version
      • node -v // 8.15.1
      • npm -v // 6.4.1 or higher
      • You can also use nvm to install node 8.15.1 if you already have another node version installed - https://github.com/creationix/nvm
  • Install git & pip:
    • sudo apt-get install git python-pip -y
  • Install snowboy dependencies:
    • sudo apt-get install swig3.0 python-pyaudio python3-pyaudio sox
    • pip install pyaudio
    • sudo apt-get install libmagic-dev libatlas-base-dev
  • Clone github repo:
    • git clone https://github.com/shekit/peeqo.git
  • CD into github folder:
    • cd /path/to/repo/electron
  • Install packages:
    • npm install
    • ./node_modules/.bin/electron-rebuild --pre-gyp-fix
  • Run app in Debug Mode:
    • This will open the chrome inspector panel. Run from electron folder
    • NODE_ENV=debug npm start
  • Run app in Production Mode:
    • This will not open chrome inspector panel. Run from electron folder
    • npm start

Setup on Unsupported OS (Ubuntu 18.04, Debian, Linux distros):

  • Follow all steps for Ubuntu 14.04 except Step 3 to install Snowboy
  • sudo apt install libgconf2-4
  • Run app with correct flag:
    • NODE_ENV=debug OS=unsupported npm start
    • This will show a hotword button in top left corner of the screen. Click this button and speak your command to simulate wakeword detection
Clone this wiki locally