-
Notifications
You must be signed in to change notification settings - Fork 27
Setting up Dev Machine
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.
- Clone Repo
- Setup Wakeword
- Setup Dialogflow
- Rename
config-dev.js
toconfig.js
- Setup on Mac OSX/Linux
- Additional Steps
Clone this repo and unzip the folder.
Peeqo uses snowboy for offline on-device wakeword detection. Follow these steps to get him to respond to you saying Peeqo.
- Go to https://snowboy.kitt.ai/dashboard
- Login using Google/Github/Facebook
- Type “Peeqo” in the “Search Hotwords” text box & hit enter. Only one result should turn up
- Click on the microphone icon near the Peeqo search result
- Click “Record my voice” in the popup that opens
- Follow the instructions and record yourself saying Peeqo three times. You will need to allow the browser microphone access
- Click on “Test the model”
- Enter the details on the left and say “Peeqo” a couple of times till it says “Test Successful”
- The model is now trained to respond to only you saying Peeqo
- Click on “Save and download”.
- This will create a file called
Peeqo.pmdl
. - Place this file in
/electron/app/config/
Peeqo uses Google's dialogflow for Speech-to-text. You can replace this with another service of your choice later.
- Go to dialogflow.com
- Click on “Go to console” in top right and login using your google id
- Grant permissions, select Country and accept terms & conditions
- Click “Create Agent”
- 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
- Once created, click on the cog icon near the agent name in the left hand menu to open agent settings
- Click on Export and Import > Import from Zip
- 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 - In the General settings of your agent, make a note of the “Project ID”. Enter this in
/app/config/config-dev.js
->speech.projectId
- Click on the link labeled Service Account. This will take you to your google cloud console page
- In the cloud console page, click on the three vertical dots in the Action column of this Service Account and select “Create Key”
- Make sure JSON is selected and click create.
- This will download a JSON file to your computer. Keep it safe and never share it. Rename this file
dialogflow.json
- Place this file in
/electron/app/config/
- 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. - 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.
After following the two steps above and entering the necessary keys and filepaths, rename config-dev.js
to config.js
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.
-
Install node version
- Select the installer for your OS from this link - https://nodejs.org/en/blog/release/v8.15.1/
- Check node and npm version
node -v // 8.15.1
npm -v // 6.4.1
- 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 snowboy dependencies on Mac (https://github.com/Kitt-AI/snowboy)
-
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
-
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
- 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